Open-source graph database, built for real-time streaming data, compatible with Neo4j.
Go to file
Matija Santl 5d5dfbb6f7 Fix how HA handles leader change during commit
Summary:
During it's leadership, one peer can receive RPC messages from other peers that his reign is over.
The problem is when this happens during a transaction commit.

This is handled in the following way.
If we're the current leader and we want to commit a transaction, we need to make sure the Raft Log is replicated before we can tell the client that the transaction is committed.
During that wait, we can only notice that the replication takes too long, and we report that with `LOG(WARNING)` messages.

If we change the Raft mode during the wait, our Raft implementation will internally commit this transaction, but won't be able to acquire the Raft lock because the `db.Reset` has been called.
This is why there is an manual lock acquire. If we pick up that the `db.Reset` has been called, we throw an `UnexpectedLeaderChangeException` exception to the client.

Another thing with long running transactions, if someone decides to kill a `memgraph_ha` instance during the commit, the transaction will have `abort` hint set. This will cause the `src/query/operator.cpp` to throw a `HintedAbortError`. We need to catch this during the shutdown, because the `memgraph_ha` isn't dead from the user perspective, and the transaction wasn't aborted because it took too long, but we can differentiate between those two.

Reviewers: mferencevic, ipaljak

Reviewed By: mferencevic, ipaljak

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1956
2019-05-20 16:39:44 +02:00
cmake Remove Cap'n Proto 2019-05-08 10:51:10 +02:00
config Implement full durability mode 2018-08-29 16:05:07 +02:00
customers Implement manage script for card fraud demo 2018-02-12 13:29:12 +01:00
docs Change ExpandUniquenessFilter to EdgeUniquenessFilter in planning docs 2019-05-20 11:14:17 +02:00
environment Migrate to Clang 8 2019-04-19 12:34:50 +02:00
experimental Integrate code coverage with Apollo 2018-01-15 12:20:11 +01:00
libs Pass CMAKE_INSTALL_LIBDIR=lib to rocksdb cmake 2019-05-13 16:22:03 +02:00
poc Clean utils folder (namespaces, function names) 2018-04-22 09:44:32 +02:00
release Add backpacking tutorial 2019-04-11 09:48:56 +02:00
src Fix how HA handles leader change during commit 2019-05-20 16:39:44 +02:00
tests Fix how HA handles leader change during commit 2019-05-20 16:39:44 +02:00
tools Add SSL support to HA RPC 2019-05-20 12:53:52 +02:00
.arcconfig arcconfig: Default to master for diff and land 2017-11-07 18:41:51 +01:00
.arclint Add basic support for arc lint with clang-tidy 2019-04-23 15:51:36 +02:00
.clang-format Edges data structure now supports multiple edge filtering (implicit OR) 2017-09-26 13:46:18 +02:00
.clang-tidy Enable more checks in clang-tidy 2019-05-07 09:38:25 +02:00
.gdbinit Add pretty printer to gdb for TypedValue 2017-08-16 11:32:25 +02:00
.gitignore Reimplement counter openCypher function 2019-05-16 11:09:02 +02:00
.ycm_extra_conf.py Add kafka library and integrate it into memgraph 2018-07-06 15:52:23 +02:00
apollo_archives.py Refactor Apollo build projects 2018-03-27 13:47:18 +02:00
apollo_archives.yaml Polish Bolt client and mg_client 2018-10-19 13:55:51 +02:00
apollo_build.yaml Use new toolchain for parent diff build 2019-04-23 13:07:20 +02:00
CHANGELOG.md Add recovery and GraphDbAccessor interface for UniqueLabelPropertyConstraint 2019-03-27 12:33:56 +01:00
CMakeLists.txt Remove Cap'n Proto 2019-05-08 10:51:10 +02:00
Doxyfile Add initial version of Apollo config files 2018-01-10 14:46:10 +01:00
Doxylogo.png Doxygen setup 2016-12-20 15:49:52 +01:00
init Quickload lcp and lcp/test to avoid any missing dependencies 2019-05-09 15:44:55 +02:00
README.md Migrate command line args to gflgs in tests 2017-07-06 13:54:12 +02:00

memgraph

Memgraph is an ACID compliant high performance transactional distributed in-memory graph database featuring runtime native query compiling, lock free data structures, multi-version concurrency control and asynchronous IO.

dependencies

Memgraph can be compiled using any modern c++ compiler. It mostly relies on the standard template library, however, some things do require external libraries.

Some code contains linux-specific libraries and the build is only supported on a 64 bit linux kernel.

  • linux
  • clang 3.8 (good c++11 support, especially lock free atomics)
  • antlr (compiler frontend)
  • cppitertools
  • fmt format
  • google benchmark
  • google test
  • glog
  • gflags