Update NuRaft buffer to 64 bit size

This commit is contained in:
alesapin 2021-06-17 19:37:08 +03:00
parent 34d12063f8
commit dc893f9644
4 changed files with 8 additions and 4 deletions

2
contrib/NuRaft vendored

@ -1 +1 @@
Subproject commit 2a1bf7d87b4a03561fc66fbb49cee8a288983c5d Subproject commit 976874b7aa7f422bf4ea595bb7d1166c617b1c26

View File

@ -23,9 +23,10 @@ using IndexToLogEntry = std::unordered_map<uint64_t, LogEntryPtr>;
enum class ChangelogVersion : uint8_t enum class ChangelogVersion : uint8_t
{ {
V0 = 0, V0 = 0,
V1 = 1, /// with 64 bit buffer header
}; };
static constexpr auto CURRENT_CHANGELOG_VERSION = ChangelogVersion::V0; static constexpr auto CURRENT_CHANGELOG_VERSION = ChangelogVersion::V1;
struct ChangelogRecordHeader struct ChangelogRecordHeader
{ {

View File

@ -204,7 +204,7 @@ SnapshotMetadataPtr KeeperStorageSnapshot::deserialize(KeeperStorage & storage,
uint8_t version; uint8_t version;
readBinary(version, in); readBinary(version, in);
SnapshotVersion current_version = static_cast<SnapshotVersion>(version); SnapshotVersion current_version = static_cast<SnapshotVersion>(version);
if (current_version > SnapshotVersion::V1) if (current_version > CURRENT_SNAPSHOT_VERSION)
throw Exception(ErrorCodes::UNKNOWN_FORMAT_VERSION, "Unsupported snapshot version {}", version); throw Exception(ErrorCodes::UNKNOWN_FORMAT_VERSION, "Unsupported snapshot version {}", version);
SnapshotMetadataPtr result = deserializeSnapshotMetadata(in); SnapshotMetadataPtr result = deserializeSnapshotMetadata(in);

View File

@ -14,8 +14,11 @@ enum SnapshotVersion : uint8_t
{ {
V0 = 0, V0 = 0,
V1 = 1, /// with ACL map V1 = 1, /// with ACL map
V2 = 2, /// with 64 bit buffer header
}; };
static constexpr auto CURRENT_SNAPSHOT_VERSION = SnapshotVersion::V2;
struct KeeperStorageSnapshot struct KeeperStorageSnapshot
{ {
public: public:
@ -30,7 +33,7 @@ public:
KeeperStorage * storage; KeeperStorage * storage;
SnapshotVersion version = SnapshotVersion::V1; SnapshotVersion version = CURRENT_SNAPSHOT_VERSION;
SnapshotMetadataPtr snapshot_meta; SnapshotMetadataPtr snapshot_meta;
int64_t session_id; int64_t session_id;
size_t snapshot_container_size; size_t snapshot_container_size;