Fix recovery bug (transaction ID bumping)

Summary:
When performing recovery, ensure that the transaction ID in engine is
bumped to one after the max tx id seen in recovery.

Reviewers: dgleich

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1312
This commit is contained in:
florijan
2018-03-22 10:44:38 +01:00
parent b9c5af2568
commit c826fa6640
13 changed files with 158 additions and 10 deletions

View File

@@ -74,3 +74,10 @@ TEST(Engine, RunningTransaction) {
EXPECT_NE(t1, engine.RunningTransaction(t0->id_));
EXPECT_EQ(t1, engine.RunningTransaction(t1->id_));
}
TEST(Engine, EnsureTxIdGreater) {
SingleNodeEngine engine;
ASSERT_LE(engine.Begin()->id_, 40);
engine.EnsureNextIdGreater(42);
EXPECT_EQ(engine.Begin()->id_, 43);
}