From cc5f9339ee65d1a35c749a3c1eed0e1bac1a6a1c Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Tue, 6 Jun 2017 12:48:46 -0700 Subject: [PATCH] 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 --- table/partitioned_filter_block.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/table/partitioned_filter_block.cc b/table/partitioned_filter_block.cc index d0f931412..585700284 100644 --- a/table/partitioned_filter_block.cc +++ b/table/partitioned_filter_block.cc @@ -207,9 +207,9 @@ PartitionedFilterBlockReader::GetFilterPartition(Slice* handle_value, auto filter = table_->GetFilter(fltr_blk_handle, is_a_filter_partition, no_io); if (filter.IsSet()) { + WriteLock wl(&mu_); filter_block_set_.insert(fltr_blk_handle); if (pin_cached_filters) { - WriteLock wl(&mu_); std::pair pair(fltr_blk_handle.offset(), filter.value); auto succ = filter_cache_.insert(pair).second;