From cb191a6e4f1dcfb209dbfc507ea211d3dbb82f5c Mon Sep 17 00:00:00 2001 From: chinaxing Date: Thu, 18 Jan 2024 09:12:56 +0000 Subject: [PATCH] [compatible] fix recovery checksum from version < 4.3 report warning --- src/storage/memtable/mvcc/ob_tx_callback_list.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage/memtable/mvcc/ob_tx_callback_list.cpp b/src/storage/memtable/mvcc/ob_tx_callback_list.cpp index f9cbe71686..63dce8291d 100644 --- a/src/storage/memtable/mvcc/ob_tx_callback_list.cpp +++ b/src/storage/memtable/mvcc/ob_tx_callback_list.cpp @@ -729,10 +729,12 @@ void ObTxCallbackList::update_checksum(const uint64_t checksum, const SCN checks { LockGuard guard(*this, LOCK_MODE::LOCK_ITERATE); if (checksum_scn.is_max()) { - if (checksum == 0) { + if (checksum == 0 && id_ > 0) { + // only check extends list, because version before 4.3 with 0 may happen + // and they will be replayed into first list (id_ equals to 0) TRANS_LOG_RET(ERROR, OB_ERR_UNEXPECTED, "checksum should not be 0 if checksum_scn is max", KPC(this)); } - checksum_ = checksum; + checksum_ = checksum ?: 1; } batch_checksum_.set_base(checksum); checksum_scn_.atomic_set(checksum_scn);