From 3e5c891de21a990be46fa9c4351c8e60a7783fc2 Mon Sep 17 00:00:00 2001 From: Aleksei Borzenkov Date: Fri, 12 Sep 2025 17:46:35 +0300 Subject: [PATCH] DataShard: don't leave processed checkpoints in the buffer (#24780) --- ydb/core/tx/datashard/memory_state_migration.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ydb/core/tx/datashard/memory_state_migration.cpp b/ydb/core/tx/datashard/memory_state_migration.cpp index 49ea8f109ae7..4a894cf5835a 100644 --- a/ydb/core/tx/datashard/memory_state_migration.cpp +++ b/ydb/core/tx/datashard/memory_state_migration.cpp @@ -91,6 +91,9 @@ class TDataShardInMemoryRestoreActor Buffer.Insert(Buffer.End(), std::move(payload)); } + // We must not have any checkpoints in the buffer yet + Y_ENSURE(Checkpoints.empty()); + size_t lastOffset = 0; for (size_t offset : msg->Record.GetSerializedStateCheckpoints()) { // These offsets are relative to the start of the new chunk, we make @@ -208,6 +211,8 @@ class TDataShardInMemoryRestoreActor Arena.Reset(); } + Checkpoints.clear(); + if (msg->Record.HasContinuationToken()) { // Request the next data chunk // Note: we have subscribed in the first request already