From 0453d5e91aadc73ad93b813677fe8e0d70c7fd13 Mon Sep 17 00:00:00 2001 From: Mikhail Artemenko Date: Tue, 10 Sep 2024 12:26:03 +0000 Subject: [PATCH] small fixes --- src/Common/ZooKeeper/TestKeeper.cpp | 6 +++++- src/Coordination/KeeperStorage.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Common/ZooKeeper/TestKeeper.cpp b/src/Common/ZooKeeper/TestKeeper.cpp index ae8d95b806a..3982971163c 100644 --- a/src/Common/ZooKeeper/TestKeeper.cpp +++ b/src/Common/ZooKeeper/TestKeeper.cpp @@ -362,9 +362,13 @@ std::pair TestKeeperRemoveRecursiveRequest::process(TestKeepe std::vector> children; - for (const auto & [child_path, child_node] : container) + for (auto it = std::next(root_it); it != container.end(); ++it) + { + const auto & [child_path, child_node] = *it; + if (child_path.starts_with(path)) children.emplace_back(child_path, child_node); + } if (children.size() > remove_nodes_limit) { diff --git a/src/Coordination/KeeperStorage.cpp b/src/Coordination/KeeperStorage.cpp index 24d95a89a4d..1bd6c27fe63 100644 --- a/src/Coordination/KeeperStorage.cpp +++ b/src/Coordination/KeeperStorage.cpp @@ -1766,7 +1766,7 @@ private: return false; - auto children = node_it->value.getChildren(); + const auto & children = node_it->value.getChildren(); for (auto && child_name : children) { auto child_path = (root_fs_path / child_name.toView()).generic_string();