Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Log failed curl req url, and local sequence number.

kishorenc4152e69b6b21
diff --git a/src/http_client.cpp b/src/http_client.cpp
index 0b100c9c..f0b17dbe 100644
--- a/src/http_client.cpp
+++ b/src/http_client.cpp
@@ -114,7 +114,9 @@ long HttpClient::perform_curl(CURL *curl, std::map<std::string, std::string>& re
CURLcode res = curl_easy_perform(curl);
if (res != CURLE_OK) {
- LOG(ERROR) << "CURL failed. Code: " << res << ", strerror: " << curl_easy_strerror(res);
+ char* url = nullptr;
+ curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
+ LOG(ERROR) << "CURL failed. URL: " << url << ", Code: " << res << ", strerror: " << curl_easy_strerror(res);
curl_easy_cleanup(curl);
curl_slist_free_all(chunk);
return 500;
diff --git a/src/http_server.cpp b/src/http_server.cpp
index 9c431d5c..4af81fda 100644
--- a/src/http_server.cpp
+++ b/src/http_server.cpp
@@ -537,7 +537,6 @@ int HttpServer::process_request(const std::shared_ptr<http_req>& request, const
auto http_server = handler->http_server;
auto message_dispatcher = handler->http_server->get_message_dispatcher();
- auto api_handler = rpath->handler;
// LOG(INFO) << "Before enqueue res: " << response
handler->http_server->get_thread_pool()->enqueue([http_server, rpath, message_dispatcher,
diff --git a/src/raft_server.cpp b/src/raft_server.cpp
index a3f2166e..8ca37841 100644
--- a/src/raft_server.cpp
+++ b/src/raft_server.cpp
@@ -267,11 +267,12 @@ void ReplicationState::on_apply(braft::Iterator& iter) {
//LOG(INFO) << ":::" << "body size inside apply: " << request->body.size();
} else {
// Parse request from the log
- const std::string &data_str = iter.data().to_string();
request_generated->deserialize(iter.data().to_string());
//LOG(INFO) << "Parsed request from the log, body_size: " << request->body.size();
- /* uint64_t hash = StringUtils::hash_wy(data_str.c_str(), data_str.size());
+ /*
+ const std::string &data_str = iter.data().to_string();
+ uint64_t hash = StringUtils::hash_wy(data_str.c_str(), data_str.size());
if(hash == 12066143973577129900) {
LOG(INFO) << "get stuck here...";
}*/
@@ -441,8 +442,8 @@ void ReplicationState::refresh_nodes(const std::string & nodes) {
<< ", applying_index: " << nodeStatus.applying_index
<< ", pending_index: " << nodeStatus.pending_index
<< ", disk_index: " << nodeStatus.disk_index
- << ", pending_queue_size: " << nodeStatus.pending_queue_size;
-
+ << ", pending_queue_size: " << nodeStatus.pending_queue_size
+ << ", local_sequence: " << store->get_latest_seq_number();
if(node->is_leader()) {
RefreshNodesClosure* refresh_nodes_done = new RefreshNodesClosure;