Fix update delta

This commit is contained in:
Antonio Andelic 2022-05-10 09:53:15 +00:00
parent 7eeb463fdb
commit f8d0aa4bc1
2 changed files with 3 additions and 4 deletions

View File

@ -390,7 +390,6 @@ nuraft::ptr<nuraft::buffer> getZooKeeperLogEntry(int64_t session_id, int64_t tim
DB::writeIntBinary(session_id, buf);
request->write(buf);
DB::writeIntBinary(time, buf);
DB::writeIntBinary(static_cast<int64_t>(0), buf);
return buf.getBuffer();
}

View File

@ -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]<typename DeltaType>(const DeltaType & operation) -> Coordination::Error
[&, &path = delta.path]<typename DeltaType>(DeltaType & operation) -> Coordination::Error
{
if constexpr (std::same_as<DeltaType, KeeperStorage::CreateNodeDelta>)
{
@ -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});