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

Server should not be ready during snapshot pull + load.

Kishore Nallan2f56c1aa5af1
diff --git a/src/collection_manager.cpp b/src/collection_manager.cpp
index 5d1ea24b..33cf12ec 100644
--- a/src/collection_manager.cpp
+++ b/src/collection_manager.cpp
@@ -162,7 +162,7 @@ Option<bool> CollectionManager::load(const size_t collection_batch_size, const s
size_t progress_modulo = std::max<size_t>(1, (num_collections / 10)); // every 10%
if(num_processed % progress_modulo == 0) {
- LOG(INFO) << "Loaded " << num_processed << " collection(s)";
+ LOG(INFO) << "Loaded " << num_processed << " collection(s) so far";
}
});
}
@@ -184,7 +184,7 @@ Option<bool> CollectionManager::load(const size_t collection_batch_size, const s
delete iter;
- LOG(INFO) << "Done loading all " << num_collections << " collection(s).";
+ LOG(INFO) << "Loaded " << num_collections << " collection(s).";
loading_pool.shutdown();
diff --git a/src/http_client.cpp b/src/http_client.cpp
index 9634b6c8..a21da373 100644
--- a/src/http_client.cpp
+++ b/src/http_client.cpp
@@ -94,6 +94,7 @@ void HttpClient::init(const std::string &api_key) {
"/etc/pki/tls/cacert.pem", // OpenELEC
"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", // CentOS/RHEL 7
"/usr/local/etc/openssl/cert.pem", // OSX
+ "/usr/local/etc/[email protected]/cert.pem", // OSX
};
HttpClient::ca_cert_path = "";
diff --git a/src/raft_server.cpp b/src/raft_server.cpp
index fe48b241..96f8a88a 100644
--- a/src/raft_server.cpp
+++ b/src/raft_server.cpp
@@ -561,6 +561,13 @@ void ReplicationState::refresh_catchup_status(bool log_msg) {
node->get_status(&n_status);
lock.unlock();
+ // `known_applied_index` guaranteed to be atleast 1 if raft log is available (after snapshot loading etc.)
+ if(n_status.known_applied_index == 0) {
+ LOG_IF(ERROR, log_msg) << "Node not ready yet (known_applied_index is 0).";
+ read_caught_up = write_caught_up = false;
+ return ;
+ }
+
// work around for: https://github.com/baidu/braft/issues/277#issuecomment-823080171
int64_t current_index = (n_status.applying_index == 0) ? n_status.known_applied_index : n_status.applying_index;
int64_t apply_lag = n_status.last_index - current_index;
diff --git a/test/string_utils_test.cpp b/test/string_utils_test.cpp
index 0ef28e96..bd374470 100644
--- a/test/string_utils_test.cpp
+++ b/test/string_utils_test.cpp
@@ -158,7 +158,7 @@ TEST(StringUtilsTest, ShouldParseQueryString) {
ASSERT_EQ("points :> 100", qmap["filter_by"]);
ASSERT_EQ("", qmap["enable_typos"]);
- qs = "foo=" + StringUtils::randstring(2000);
+ qs = "foo=" + StringUtils::randstring(4000);
qmap = StringUtils::parse_query_string(qs);
ASSERT_EQ(0, qmap.size());