From 0ac4afb9750a2bdf27aa710a3ca764301ca64c76 Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Fri, 23 Jun 2017 18:18:21 -0700 Subject: [PATCH] Sanitize partitioning options Summary: We currently do not support partitioning filters if indexes are not partitioned. The patch makes sure that these two are consistent. Closes https://github.com/facebook/rocksdb/pull/2455 Differential Revision: D5275644 Pulled By: maysamyabandeh fbshipit-source-id: b61701ac8914c2206d06f5e33ff6f67b24406d1d --- table/block_based_table_factory.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/table/block_based_table_factory.cc b/table/block_based_table_factory.cc index 8db76ea38e..4cd0ba51c0 100644 --- a/table/block_based_table_factory.cc +++ b/table/block_based_table_factory.cc @@ -47,6 +47,12 @@ BlockBasedTableFactory::BlockBasedTableFactory( if (table_options_.index_block_restart_interval < 1) { table_options_.index_block_restart_interval = 1; } + if (table_options_.partition_filters && + table_options_.index_type != + BlockBasedTableOptions::kTwoLevelIndexSearch) { + // We do not support partitioned filters without partitioning indexes + table_options_.partition_filters = false; + } } Status BlockBasedTableFactory::NewTableReader(