From f8d0aa4bc18d85d520408a10d3b74ebd032899e6 Mon Sep 17 00:00:00 2001 From: Antonio Andelic Date: Tue, 10 May 2022 09:53:15 +0000 Subject: [PATCH] Fix update delta --- src/Coordination/KeeperServer.cpp | 1 - src/Coordination/KeeperStorage.cpp | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Coordination/KeeperServer.cpp b/src/Coordination/KeeperServer.cpp index 22a3a4624c6..1f089ba2cb7 100644 --- a/src/Coordination/KeeperServer.cpp +++ b/src/Coordination/KeeperServer.cpp @@ -390,7 +390,6 @@ nuraft::ptr getZooKeeperLogEntry(int64_t session_id, int64_t tim DB::writeIntBinary(session_id, buf); request->write(buf); DB::writeIntBinary(time, buf); - DB::writeIntBinary(static_cast(0), buf); return buf.getBuffer(); } diff --git a/src/Coordination/KeeperStorage.cpp b/src/Coordination/KeeperStorage.cpp index 176e45d4cd4..b31b121caf1 100644 --- a/src/Coordination/KeeperStorage.cpp +++ b/src/Coordination/KeeperStorage.cpp @@ -324,7 +324,7 @@ Coordination::Error KeeperStorage::commit(int64_t commit_zxid, int64_t session_i bool finish_subdelta = false; auto result = std::visit( - [&, &path = delta.path](const DeltaType & operation) -> Coordination::Error + [&, &path = delta.path](DeltaType & operation) -> Coordination::Error { if constexpr (std::same_as) { @@ -925,13 +925,13 @@ struct KeeperStorageSetRequestProcessor final : public KeeperStorageRequestProce request.path, zxid, KeeperStorage::UpdateNodeDelta{ - [zxid, data = request.data, time](KeeperStorage::Node & value) mutable + [zxid, data = request.data, time](KeeperStorage::Node & value) { value.stat.version++; value.stat.mzxid = zxid; value.stat.mtime = time; value.stat.dataLength = data.length(); - value.setData(std::move(data)); + value.setData(data); }, request.version});