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

Housekeeping tasks.

kishorenc1b01de0c0c9c
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f3ffce2..8db4c262 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,6 +16,9 @@ if(NOT EXISTS ${DEP_ROOT_DIR})
file(MAKE_DIRECTORY ${DEP_ROOT_DIR})
endif()
+# Needed to enable Snappy on RocksDB
+add_definitions(-DSNAPPY)
+
if (APPLE)
add_definitions(-DGTEST_USE_OWN_TR1_TUPLE)
add_definitions(-D__GLIBCXX__)
diff --git a/cmake/RocksDB.cmake b/cmake/RocksDB.cmake
index a93adbb6..86427845 100644
--- a/cmake/RocksDB.cmake
+++ b/cmake/RocksDB.cmake
@@ -32,7 +32,10 @@ if(NOT EXISTS ${DEP_ROOT_DIR}/${ROCKSDB_NAME}/librocksdb.a AND BUILD_DEPS STREQU
set(ENV{ROCKSDB_DISABLE_BACKTRACE} 1)
set(ENV{ROCKSDB_DISABLE_PG} 1)
+ message(STATUS "Cleaning...")
execute_process(COMMAND make "clean" WORKING_DIRECTORY ${DEP_ROOT_DIR}/${ROCKSDB_NAME}/)
+
+ message(STATUS "Building static library...")
execute_process(COMMAND make "static_lib" WORKING_DIRECTORY ${DEP_ROOT_DIR}/${ROCKSDB_NAME}/
RESULT_VARIABLE ROCKSDB_BUILD)
if(NOT ROCKSDB_BUILD EQUAL 0)
diff --git a/include/raft_server.h b/include/raft_server.h
index 3eda8425..e2dc6561 100644
--- a/include/raft_server.h
+++ b/include/raft_server.h
@@ -101,10 +101,6 @@ public:
ReplicationState(Store* store, ThreadPool* thread_pool, http_message_dispatcher* message_dispatcher,
bool create_init_db_snapshot, std::atomic<bool>& quit_service);
- ~ReplicationState() {
- delete node;
- }
-
// Starts this node
int start(const butil::EndPoint & peering_endpoint, int api_port,
int election_timeout_ms, int snapshot_interval_s,
@@ -144,6 +140,7 @@ public:
void join() {
if (node) {
node->join();
+ delete node;
node = nullptr;
}
}
diff --git a/include/store.h b/include/store.h
index 20bb5529..2b2cbc32 100644
--- a/include/store.h
+++ b/include/store.h
@@ -64,6 +64,7 @@ public:
options.max_write_buffer_number = 2;
options.merge_operator.reset(new UInt64AddOperator);
options.compression = rocksdb::CompressionType::kSnappyCompression;
+ //options.bottommost_compression = rocksdb::CompressionType::kSnappyCompression;
// these need to be high for replication scenarios
options.WAL_ttl_seconds = wal_ttl_secs;
diff --git a/src/http_server.cpp b/src/http_server.cpp
index c3dbd9d3..a9dc31da 100644
--- a/src/http_server.cpp
+++ b/src/http_server.cpp
@@ -742,7 +742,6 @@ HttpServer::~HttpServer() {
}
h2o_timerwheel_run(ctx.loop->_timeouts, 9999999999999);
- h2o_timerwheel_destroy(ctx.loop->_timeouts);
h2o_context_dispose(&ctx);
diff --git a/src/typesense_server_utils.cpp b/src/typesense_server_utils.cpp
index e484fdb9..0ade9d35 100644
--- a/src/typesense_server_utils.cpp
+++ b/src/typesense_server_utils.cpp
@@ -373,7 +373,7 @@ int run_server(const Config & config, const std::string & version, void (*master
// we are out of the event loop here
LOG(INFO) << "Typesense API service has quit.";
- quit_raft_service = true;
+ quit_raft_service = true; // we set this once again in case API thread crashes instead of a signal
raft_thread.join();
curl_global_cleanup();