Fix concurrency issue with filter_block_set_

Summary:
filter_block_set_ access must also be protected with mutex.
Closes https://github.com/facebook/rocksdb/pull/2413

Differential Revision: D5193159

Pulled By: maysamyabandeh

fbshipit-source-id: 6987fc219d9a65c20b9c7e52151aef4b8e4882e6
main
Maysam Yabandeh 8 years ago committed by Facebook Github Bot
parent 2e64f450dc
commit cc5f9339ee
  1. 2
      table/partitioned_filter_block.cc

@ -207,9 +207,9 @@ PartitionedFilterBlockReader::GetFilterPartition(Slice* handle_value,
auto filter = auto filter =
table_->GetFilter(fltr_blk_handle, is_a_filter_partition, no_io); table_->GetFilter(fltr_blk_handle, is_a_filter_partition, no_io);
if (filter.IsSet()) { if (filter.IsSet()) {
WriteLock wl(&mu_);
filter_block_set_.insert(fltr_blk_handle); filter_block_set_.insert(fltr_blk_handle);
if (pin_cached_filters) { if (pin_cached_filters) {
WriteLock wl(&mu_);
std::pair<uint64_t, FilterBlockReader*> pair(fltr_blk_handle.offset(), std::pair<uint64_t, FilterBlockReader*> pair(fltr_blk_handle.offset(),
filter.value); filter.value);
auto succ = filter_cache_.insert(pair).second; auto succ = filter_cache_.insert(pair).second;

Loading…
Cancel
Save