From 5d89ca6cb9147dde6d8519f2ffa915f82a16e9c4 Mon Sep 17 00:00:00 2001 From: yangzq50 <58433399+yangzq50@users.noreply.github.com> Date: Mon, 11 Nov 2024 21:01:37 +0800 Subject: [PATCH] Update TableIndexReaderCache (#2223) ### What problem does this PR solve? Fix `TableIndexReaderCache::Invalidate()` Issue link:#2192 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- src/storage/invertedindex/column_index_reader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/storage/invertedindex/column_index_reader.cpp b/src/storage/invertedindex/column_index_reader.cpp index feb80c3592..b5fa57cac4 100644 --- a/src/storage/invertedindex/column_index_reader.cpp +++ b/src/storage/invertedindex/column_index_reader.cpp @@ -188,7 +188,6 @@ IndexReader TableIndexReaderCache::GetIndexReader(Txn *txn) { } String column_name = index_base->column_name(); auto column_id = table_entry_ptr_->GetColumnIdByName(column_name); - assert(table_index_entry->GetFulltexSegmentUpdateTs() <= last_known_update_ts_); if (auto &target_ts = cache_column_ts[column_id]; target_ts < begin_ts) { // need update result target_ts = begin_ts; @@ -226,7 +225,7 @@ IndexReader TableIndexReaderCache::GetIndexReader(Txn *txn) { void TableIndexReaderCache::Invalidate() { std::scoped_lock lock(mutex_); first_known_update_ts_ = 0; - last_known_update_ts_ = 0; + last_known_update_ts_ = std::max(last_known_update_ts_, cache_ts_); cache_ts_ = 0; cache_column_ts_.clear(); cache_column_readers_.reset();