|
|
@ -13,6 +13,7 @@ |
|
|
|
#include "rocksdb/filter_policy.h" |
|
|
|
#include "rocksdb/filter_policy.h" |
|
|
|
#include "table/block_based/block.h" |
|
|
|
#include "table/block_based/block.h" |
|
|
|
#include "table/block_based/block_based_table_reader.h" |
|
|
|
#include "table/block_based/block_based_table_reader.h" |
|
|
|
|
|
|
|
#include "test_util/testharness.h" |
|
|
|
#include "util/coding.h" |
|
|
|
#include "util/coding.h" |
|
|
|
|
|
|
|
|
|
|
|
namespace ROCKSDB_NAMESPACE { |
|
|
|
namespace ROCKSDB_NAMESPACE { |
|
|
@ -143,6 +144,7 @@ std::unique_ptr<FilterBlockReader> PartitionedFilterBlockReader::Create( |
|
|
|
use_cache, nullptr /* get_context */, |
|
|
|
use_cache, nullptr /* get_context */, |
|
|
|
lookup_context, &filter_block); |
|
|
|
lookup_context, &filter_block); |
|
|
|
if (!s.ok()) { |
|
|
|
if (!s.ok()) { |
|
|
|
|
|
|
|
IGNORE_STATUS_IF_ERROR(s); |
|
|
|
return std::unique_ptr<FilterBlockReader>(); |
|
|
|
return std::unique_ptr<FilterBlockReader>(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -254,7 +256,7 @@ bool PartitionedFilterBlockReader::MayMatch( |
|
|
|
Status s = |
|
|
|
Status s = |
|
|
|
GetOrReadFilterBlock(no_io, get_context, lookup_context, &filter_block); |
|
|
|
GetOrReadFilterBlock(no_io, get_context, lookup_context, &filter_block); |
|
|
|
if (UNLIKELY(!s.ok())) { |
|
|
|
if (UNLIKELY(!s.ok())) { |
|
|
|
TEST_SYNC_POINT("FilterReadError"); |
|
|
|
IGNORE_STATUS_IF_ERROR(s); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -272,7 +274,7 @@ bool PartitionedFilterBlockReader::MayMatch( |
|
|
|
no_io, get_context, lookup_context, |
|
|
|
no_io, get_context, lookup_context, |
|
|
|
&filter_partition_block); |
|
|
|
&filter_partition_block); |
|
|
|
if (UNLIKELY(!s.ok())) { |
|
|
|
if (UNLIKELY(!s.ok())) { |
|
|
|
TEST_SYNC_POINT("FilterReadError"); |
|
|
|
IGNORE_STATUS_IF_ERROR(s); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -312,7 +314,7 @@ void PartitionedFilterBlockReader::CacheDependencies(bool pin) { |
|
|
|
"Error retrieving top-level filter block while trying to " |
|
|
|
"Error retrieving top-level filter block while trying to " |
|
|
|
"cache filter partitions: %s", |
|
|
|
"cache filter partitions: %s", |
|
|
|
s.ToString().c_str()); |
|
|
|
s.ToString().c_str()); |
|
|
|
TEST_SYNC_POINT("FilterReadError"); |
|
|
|
IGNORE_STATUS_IF_ERROR(s); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -343,11 +345,6 @@ void PartitionedFilterBlockReader::CacheDependencies(bool pin) { |
|
|
|
prefetch_buffer.reset(new FilePrefetchBuffer()); |
|
|
|
prefetch_buffer.reset(new FilePrefetchBuffer()); |
|
|
|
s = prefetch_buffer->Prefetch(rep->file.get(), prefetch_off, |
|
|
|
s = prefetch_buffer->Prefetch(rep->file.get(), prefetch_off, |
|
|
|
static_cast<size_t>(prefetch_len)); |
|
|
|
static_cast<size_t>(prefetch_len)); |
|
|
|
#ifndef NDEBUG |
|
|
|
|
|
|
|
if (!s.ok()) { |
|
|
|
|
|
|
|
TEST_SYNC_POINT("FilterReadError"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// After prefetch, read the partitions one by one
|
|
|
|
// After prefetch, read the partitions one by one
|
|
|
|
ReadOptions read_options; |
|
|
|
ReadOptions read_options; |
|
|
@ -370,11 +367,7 @@ void PartitionedFilterBlockReader::CacheDependencies(bool pin) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#ifndef NDEBUG |
|
|
|
IGNORE_STATUS_IF_ERROR(s); |
|
|
|
if (!s.ok()) { |
|
|
|
|
|
|
|
TEST_SYNC_POINT("FilterReadError"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|