From 1a186c4108daf39365964e00497f962aea0bf214 Mon Sep 17 00:00:00 2001 From: Jin Hai Date: Mon, 13 Jan 2025 11:04:03 +0800 Subject: [PATCH] Add write mutex on segment index entry to fix checkpoint crash Signed-off-by: Jin Hai --- src/storage/meta/entry/segment_index_entry.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/storage/meta/entry/segment_index_entry.cpp b/src/storage/meta/entry/segment_index_entry.cpp index 81c4cbb1c0..734f4d8037 100644 --- a/src/storage/meta/entry/segment_index_entry.cpp +++ b/src/storage/meta/entry/segment_index_entry.cpp @@ -806,6 +806,7 @@ void SegmentIndexEntry::OptIndex(IndexBase *index_base, } bool SegmentIndexEntry::Flush(TxnTimeStamp checkpoint_ts) { + std::unique_lock lock(rw_locker_); auto index_type = table_index_entry_->index_base()->index_type_; if (index_type == IndexType::kFullText || index_type == IndexType::kHnsw) { // Fulltext index, Hnsw doesn't need to be checkpointed.