diff --git a/include/store.h b/include/store.h index fe58fded..b56a2c8e 100644 --- a/include/store.h +++ b/include/store.h @@ -74,6 +74,13 @@ public: if(!s.ok()) { LOG(ERR) << "Error while initializing store: " << s.ToString(); + if(s.code() == rocksdb::Status::Code::kIOError) { + LOG(ERR) << "It seems like the data directory " << state_dir_path << " is already being used by " + << "another Typesense server. "; + LOG(ERR) << "If you are SURE that this is not the case, delete the LOCK file " + << "in the data directory and try again."; + exit(1); + } } assert(s.ok()); diff --git a/src/typesense_server_utils.cpp b/src/typesense_server_utils.cpp index 36ee522d..61ebc02c 100644 --- a/src/typesense_server_utils.cpp +++ b/src/typesense_server_utils.cpp @@ -1,6 +1,7 @@ #include "core_api.h" #include "typesense_server_utils.h" #include +#include HttpServer* server;