diff --git a/src/Coordination/KeeperServer.cpp b/src/Coordination/KeeperServer.cpp index acce76a62e7..171fa2986eb 100644 --- a/src/Coordination/KeeperServer.cpp +++ b/src/Coordination/KeeperServer.cpp @@ -317,7 +317,7 @@ uint64_t KeeperServer::getSyncedFollowerCount() const uint64_t stale_followers = 0; const uint64_t stale_follower_gap = raft_instance->get_current_params().stale_log_gap_; - for (auto & fl : followers) + for (const auto & fl : followers) { if (last_log_idx > fl.last_log_idx_ + stale_follower_gap) stale_followers++; diff --git a/src/Coordination/KeeperStorage.h b/src/Coordination/KeeperStorage.h index 0cf173e9b80..44dc1b2b43b 100644 --- a/src/Coordination/KeeperStorage.h +++ b/src/Coordination/KeeperStorage.h @@ -186,7 +186,7 @@ public: uint64_t getApproximateDataSize() const { - return container.getApproximateSataSize(); + return container.getApproximateDataSize(); } uint64_t getTotalWatchesCount() const; diff --git a/src/Coordination/SnapshotableHashTable.h b/src/Coordination/SnapshotableHashTable.h index 98f4c6c8e14..7704825f830 100644 --- a/src/Coordination/SnapshotableHashTable.h +++ b/src/Coordination/SnapshotableHashTable.h @@ -274,7 +274,7 @@ public: return list.size(); } - uint64_t getApproximateSataSize() const + uint64_t getApproximateDataSize() const { return approximate_data_size; } diff --git a/src/Coordination/tests/gtest_coordination.cpp b/src/Coordination/tests/gtest_coordination.cpp index 710670f5b16..5b15044ab0d 100644 --- a/src/Coordination/tests/gtest_coordination.cpp +++ b/src/Coordination/tests/gtest_coordination.cpp @@ -940,33 +940,33 @@ TEST_P(CoordinationTest, SnapshotableHashMapDataSize) /// int DB::SnapshotableHashTable hello; hello.disableSnapshotMode(); - EXPECT_EQ(hello.getApproximateSataSize(), 0); + EXPECT_EQ(hello.getApproximateDataSize(), 0); hello.insert("hello", 1); - EXPECT_EQ(hello.getApproximateSataSize(), 9); + EXPECT_EQ(hello.getApproximateDataSize(), 9); hello.updateValue("hello", [](IntNode & value) { value = 2; }); - EXPECT_EQ(hello.getApproximateSataSize(), 9); + EXPECT_EQ(hello.getApproximateDataSize(), 9); hello.erase("hello"); - EXPECT_EQ(hello.getApproximateSataSize(), 0); + EXPECT_EQ(hello.getApproximateDataSize(), 0); hello.clear(); - EXPECT_EQ(hello.getApproximateSataSize(), 0); + EXPECT_EQ(hello.getApproximateDataSize(), 0); hello.enableSnapshotMode(); hello.insert("hello", 1); - EXPECT_EQ(hello.getApproximateSataSize(), 9); + EXPECT_EQ(hello.getApproximateDataSize(), 9); hello.updateValue("hello", [](IntNode & value) { value = 2; }); - EXPECT_EQ(hello.getApproximateSataSize(), 18); + EXPECT_EQ(hello.getApproximateDataSize(), 18); hello.clearOutdatedNodes(); - EXPECT_EQ(hello.getApproximateSataSize(), 9); + EXPECT_EQ(hello.getApproximateDataSize(), 9); hello.erase("hello"); - EXPECT_EQ(hello.getApproximateSataSize(), 9); + EXPECT_EQ(hello.getApproximateDataSize(), 9); hello.clearOutdatedNodes(); - EXPECT_EQ(hello.getApproximateSataSize(), 0); + EXPECT_EQ(hello.getApproximateDataSize(), 0); /// Node using Node = DB::KeeperStorage::Node; @@ -983,27 +983,27 @@ TEST_P(CoordinationTest, SnapshotableHashMapDataSize) /// 160 = sizeof Node /// 5 = sizeof key /// 4 = sizeof value - EXPECT_EQ(world.getApproximateSataSize(), 169); + EXPECT_EQ(world.getApproximateDataSize(), 169); world.updateValue("world", [&](Node & value) { value = n2; }); - EXPECT_EQ(world.getApproximateSataSize(), 171); + EXPECT_EQ(world.getApproximateDataSize(), 171); world.erase("world"); - EXPECT_EQ(world.getApproximateSataSize(), 0); + EXPECT_EQ(world.getApproximateDataSize(), 0); world.enableSnapshotMode(); world.insert("world", n1); - EXPECT_EQ(world.getApproximateSataSize(), 169); + EXPECT_EQ(world.getApproximateDataSize(), 169); world.updateValue("world", [&](Node & value) { value = n2; }); - EXPECT_EQ(world.getApproximateSataSize(), 340); + EXPECT_EQ(world.getApproximateDataSize(), 340); world.clearOutdatedNodes(); - EXPECT_EQ(world.getApproximateSataSize(), 171); + EXPECT_EQ(world.getApproximateDataSize(), 171); world.erase("world"); - EXPECT_EQ(world.getApproximateSataSize(), 171); + EXPECT_EQ(world.getApproximateDataSize(), 171); world.clear(); - EXPECT_EQ(world.getApproximateSataSize(), 0); + EXPECT_EQ(world.getApproximateDataSize(), 0); } void addNode(DB::KeeperStorage & storage, const std::string & path, const std::string & data, int64_t ephemeral_owner=0)