Skip to content

Commit

Permalink
Remove duplicate std::shared_lock (#2397)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Fix Bug: Trying to lock rw_locker_ twice will freeze all read / write
operations to TableIndexEntry.

Issue link: infiniflow/ragflow#4163

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
yangzq50 authored Dec 23, 2024
1 parent 4d11f30 commit 2c87e97
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/storage/meta/entry/table_index_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ nlohmann::json TableIndexEntry::Serialize(TxnTimeStamp max_commit_ts) {
json["index_dir"] = *this->index_dir_;
json["index_base"] = this->index_base_->Serialize();

std::shared_lock r_lock(rw_locker_);
for (const auto &[segment_id, index_entry] : this->index_by_segment_) {
if (!index_entry->CheckDeprecate(max_commit_ts)) {
segment_index_entry_candidates.push_back(index_entry);
Expand Down

0 comments on commit 2c87e97

Please sign in to comment.