Implement storage lock

Summary:
The storage now uses a file in the data directory (`.lock`) to determine
whether there is another instance of the storage running with the same data
directory. That helps notify the user/administrator that the system is running
in an unsupported configuration.

Reviewers: teon.banek, ipaljak

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2719
This commit is contained in:
Matej Ferencevic
2020-03-12 11:50:40 +01:00
parent eaabcd8d0d
commit f48ad62647
8 changed files with 158 additions and 64 deletions

View File

@@ -735,10 +735,6 @@ int main(int argc, char *argv[]) {
FLAGS_id_type = upper;
}
// Verify that the user that started the Memgraph process is the same user
// that is the owner of the data directory.
VerifyDataDirectoryOwnerAndProcessUser(FLAGS_data_directory);
std::unordered_map<NodeId, storage::Gid> node_id_map;
storage::Storage store{
{.durability =