From 59f4b893612f187d9abe7f0bb0cf02b07d0dcb79 Mon Sep 17 00:00:00 2001 From: jbajic Date: Tue, 6 Dec 2022 12:34:36 +0100 Subject: [PATCH] Remove redundandt shard properties --- src/storage/v3/shard.cpp | 5 +---- src/storage/v3/shard.hpp | 32 -------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/storage/v3/shard.cpp b/src/storage/v3/shard.cpp index a77f42a76..39c0683cd 100644 --- a/src/storage/v3/shard.cpp +++ b/src/storage/v3/shard.cpp @@ -332,10 +332,7 @@ Shard::Shard(const LabelId primary_label, const PrimaryKey min_primary_key, vertex_validator_{schema_validator_, primary_label}, indices_{config.items, vertex_validator_}, isolation_level_{config.transaction.isolation_level}, - config_{config}, - uuid_{utils::GenerateUUID()}, - epoch_id_{utils::GenerateUUID()}, - global_locker_{file_retainer_.AddLocker()} { + config_{config} { CreateSchema(primary_label_, schema); StoreMapping(std::move(id_to_name)); } diff --git a/src/storage/v3/shard.hpp b/src/storage/v3/shard.hpp index b998c06cc..31259a0fe 100644 --- a/src/storage/v3/shard.hpp +++ b/src/storage/v3/shard.hpp @@ -393,38 +393,6 @@ class Shard final { // storage. std::list deleted_edges_; - // UUID used to distinguish snapshots and to link snapshots to WALs - std::string uuid_; - // Sequence number used to keep track of the chain of WALs. - uint64_t wal_seq_num_{0}; - - // UUID to distinguish different main instance runs for replication process - // on SAME storage. - // Multiple instances can have same storage UUID and be MAIN at the same time. - // We cannot compare commit timestamps of those instances if one of them - // becomes the replica of the other so we use epoch_id_ as additional - // discriminating property. - // Example of this: - // We have 2 instances of the same storage, S1 and S2. - // S1 and S2 are MAIN and accept their own commits and write them to the WAL. - // At the moment when S1 commited a transaction with timestamp 20, and S2 - // a different transaction with timestamp 15, we change S2's role to REPLICA - // and register it on S1. - // Without using the epoch_id, we don't know that S1 and S2 have completely - // different transactions, we think that the S2 is behind only by 5 commits. - std::string epoch_id_; - // History of the previous epoch ids. - // Each value consists of the epoch id along the last commit belonging to that - // epoch. - std::deque> epoch_history_; - - uint64_t wal_unsynced_transactions_{0}; - - utils::FileRetainer file_retainer_; - - // Global locker that is used for clients file locking - utils::FileRetainer::FileLocker global_locker_; - // Holds all of the (in progress, committed and aborted) transactions that are read or write to this shard, but // haven't been cleaned up yet std::map> start_logical_id_to_transaction_{};