From f717ec26baa6edbfdd1be7083cb7f343fa6a76ca Mon Sep 17 00:00:00 2001 From: xiangguangyxg <110401425+xiangguangyxg@users.noreply.github.com> Date: Wed, 8 Jan 2025 17:06:41 +0800 Subject: [PATCH] [BugFix] Fix snapshot versions in cross-cluster replication (#54790) Signed-off-by: xiangguangyxg (cherry picked from commit c6d368936f3283350803eedd4c2f3c707cdc1d10) --- be/src/storage/replication_txn_manager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/be/src/storage/replication_txn_manager.cpp b/be/src/storage/replication_txn_manager.cpp index eafdbc5715b07..7ad4c1d4016ce 100644 --- a/be/src/storage/replication_txn_manager.cpp +++ b/be/src/storage/replication_txn_manager.cpp @@ -158,7 +158,9 @@ Status ReplicationTxnManager::remote_snapshot(const TRemoteSnapshotRequest& requ } std::vector missed_versions; - tablet->calc_missed_versions(request.src_visible_version, &missed_versions); + for (auto v = request.visible_version + 1; v <= request.src_visible_version; ++v) { + missed_versions.emplace_back(v, v); + } if (UNLIKELY(missed_versions.empty())) { LOG(WARNING) << "Remote snapshot tablet skipped, no missing version" << ", type: " << KeysType_Name(tablet->keys_type()) << ", txn_id: " << request.transaction_id