Skip to content

Commit

Permalink
Update TableIndexReaderCache (#2223)
Browse files Browse the repository at this point in the history
### 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)
  • Loading branch information
yangzq50 authored Nov 11, 2024
1 parent ea8d51b commit 5d89ca6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/storage/invertedindex/column_index_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 5d89ca6

Please sign in to comment.