Add magic number to WAL and fix version consistency check
Summary: Recovery file is version inconsistent iff it starts with a correct magic number, has at least one integer written after that and that integer differs from kVersion. Reviewers: mferencevic, ipaljak, vkasljevic, buda Reviewed By: mferencevic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1565
This commit is contained in:
committed by
Matija Santl
parent
57b84f2da3
commit
146c35ec4a
@@ -409,8 +409,8 @@ void Convert(const std::vector<std::string> &nodes,
|
||||
// 5) All nodes, sequentially, but not encoded as a list.
|
||||
// 6) All relationships, sequentially, but not encoded as a list.
|
||||
// 7) Summary with node count, relationship count and hash digest.
|
||||
encoder.WriteRAW(durability::kMagicNumber.data(),
|
||||
durability::kMagicNumber.size());
|
||||
encoder.WriteRAW(durability::kSnapshotMagic.data(),
|
||||
durability::kSnapshotMagic.size());
|
||||
encoder.WriteValue(durability::kVersion);
|
||||
|
||||
encoder.WriteInt(0); // Worker Id - for this use case it's okay to set to 0
|
||||
|
||||
Reference in New Issue
Block a user