From 63a87db9529b58e48008a3094e530b7f0b22fe3b Mon Sep 17 00:00:00 2001 From: shenyushi Date: Thu, 19 Dec 2024 20:26:33 +0800 Subject: [PATCH] Fix unit test. --- src/storage/meta/entry/block_entry.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/storage/meta/entry/block_entry.cpp b/src/storage/meta/entry/block_entry.cpp index 0bd1aaa86..b0e479ab9 100644 --- a/src/storage/meta/entry/block_entry.cpp +++ b/src/storage/meta/entry/block_entry.cpp @@ -402,9 +402,15 @@ void BlockEntry::CommitBlock(TransactionID txn_id, TxnTimeStamp commit_ts) { } this->using_txn_id_ = 0; - if (min_row_ts_ == 0 || min_row_ts_ > max_row_ts_) { + if (min_row_ts_ > max_row_ts_) { UnrecoverableError(fmt::format("BlockEntry::CommitBlock invalid ts, min_row_ts_: {}, max_row_ts_: {}", min_row_ts_, max_row_ts_)); } + if (min_row_ts_ == 0) { + min_row_ts_ = commit_ts; + } + if (max_row_ts_ == 0) { + max_row_ts_ = commit_ts; + } if (!this->Committed()) { this->Commit(commit_ts);