mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-26 16:30:56 +00:00
26f5dd9a5a
Summary: This diff addresses task #4296714 and rethinks how users provide us with TablePropertiesCollectors as part of Options. Here's description of task #4296714: I'm debugging #4295529 and noticed that our count of user properties kDeletedKeys is wrong. We're sharing one single InternalKeyPropertiesCollector with all Table Builders. In LOG Files, we're outputting number of kDeletedKeys as connected with a single table, while it's actually the total count of deleted keys since creation of the DB. For example, this table has 3155 entries and 1391828 deleted keys. The problem with current approach that we call methods on a single TablePropertiesCollector for all the tables we create. Even worse, we could do it from multiple threads at the same time and TablePropertiesCollector has no way of knowing which table we're calling it for. Good part: Looks like nobody inside Facebook is using Options::table_properties_collectors. This means we should be able to painfully change the API. In this change, I introduce TablePropertiesCollectorFactory. For every table we create, we call `CreateTablePropertiesCollector`, which creates a TablePropertiesCollector for a single table. We then use it sequentially from a single thread, which means it doesn't have to be thread-safe. Test Plan: Added a test in table_properties_collector_test that fails on master (build two tables, assert that kDeletedKeys count is correct for the second one). Also, all other tests Reviewers: sdong, dhruba, haobo, kailiu Reviewed By: kailiu CC: leveldb Differential Revision: https://reviews.facebook.net/D18579 |
||
---|---|---|
.. | ||
block.cc | ||
block.h | ||
block_based_table_builder.cc | ||
block_based_table_builder.h | ||
block_based_table_factory.cc | ||
block_based_table_factory.h | ||
block_based_table_reader.cc | ||
block_based_table_reader.h | ||
block_builder.cc | ||
block_builder.h | ||
block_hash_index.cc | ||
block_hash_index.h | ||
block_hash_index_test.cc | ||
block_test.cc | ||
filter_block.cc | ||
filter_block.h | ||
filter_block_test.cc | ||
flush_block_policy.cc | ||
format.cc | ||
format.h | ||
iter_heap.h | ||
iterator.cc | ||
iterator_wrapper.h | ||
merger.cc | ||
merger.h | ||
meta_blocks.cc | ||
meta_blocks.h | ||
plain_table_builder.cc | ||
plain_table_builder.h | ||
plain_table_factory.cc | ||
plain_table_factory.h | ||
plain_table_reader.cc | ||
plain_table_reader.h | ||
table_builder.h | ||
table_properties.cc | ||
table_reader.h | ||
table_reader_bench.cc | ||
table_test.cc | ||
two_level_iterator.cc | ||
two_level_iterator.h |