Skip to content

Commit

Permalink
Revert "tto be revert: remove all locks"
Browse files Browse the repository at this point in the history
This reverts commit 5686b5c.
  • Loading branch information
CalvinNeo committed Jun 19, 2023
1 parent 5686b5c commit 94c9265
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dbms/src/Storages/Transaction/KVStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,9 +950,9 @@ void KVStore::compactLogByRowKeyRange(TMTContext & tmt, const DM::RowKeyRange &
auto region_id = region.first;
auto region_ptr = std::get<3>(region.second);
LOG_DEBUG(log, "flush extra segment of region {}, region range:[{},{}], flushed segment range:[{},{}]", region.first, region_rowkey_range.getStart().toDebugString(), region_rowkey_range.getEnd().toDebugString(), rowkey_range.getStart().toDebugString(), rowkey_range.getEnd().toDebugString());
auto region_task_lock = region_manager.genRegionTaskLock(region_id);
// Both flushCache and persistRegion should be protected by region task lock.
storage->flushCache(tmt.getContext(), std::get<2>(region.second));
auto region_task_lock = region_manager.genRegionTaskLock(region_id);
persistRegion(*region_ptr, std::make_optional(&region_task_lock), "triggerCompactLog");
}
// TODO Flush the segments that isn't related to any region. Is it really necessary?
Expand Down

0 comments on commit 94c9265

Please sign in to comment.