Skip to content

Commit

Permalink
Add lock
Browse files Browse the repository at this point in the history
  • Loading branch information
small-turtle-1 committed Dec 17, 2024
1 parent a94a50b commit d73bb87
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/storage/meta/entry/table_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,7 @@ SharedPtr<BlockIndex> TableEntry::GetBlockIndex(Txn *txn) {

SharedPtr<IndexIndex> TableEntry::GetIndexIndex(Txn *txn) {
SharedPtr<IndexIndex> result = MakeShared<IndexIndex>();
std::shared_lock<std::shared_mutex> rw_locker(this->rw_locker_);
auto index_meta_map_guard = index_meta_map_.GetMetaMap();
for (auto &[index_name, table_index_meta] : *index_meta_map_guard) {
auto [table_index_entry, status] = table_index_meta->GetEntryNolock(txn->TxnID(), txn->BeginTS());
Expand Down

0 comments on commit d73bb87

Please sign in to comment.