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/D18579main
parent
2082a7d745
commit
26f5dd9a5a
@ -1,6 +1,17 @@ |
|||||||
|
// Copyright (c) 2013, Facebook, Inc. All rights reserved.
|
||||||
|
// This source code is licensed under the BSD-style license found in the
|
||||||
|
// LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
// of patent rights can be found in the PATENTS file in the same directory.
|
||||||
#pragma once |
#pragma once |
||||||
|
|
||||||
// Also update Makefile if you change these
|
// Also update Makefile if you change these
|
||||||
#define __ROCKSDB_MAJOR__ 3 |
#define ROCKSDB_MAJOR 3 |
||||||
#define __ROCKSDB_MINOR__ 0 |
#define ROCKSDB_MINOR 1 |
||||||
#define __ROCKSDB_PATCH__ 0 |
#define ROCKSDB_PATCH 0 |
||||||
|
|
||||||
|
// Do not use these. We made the mistake of declaring macros starting with
|
||||||
|
// double underscore. Now we have to live with our choice. We'll deprecate these
|
||||||
|
// at some point
|
||||||
|
#define __ROCKSDB_MAJOR__ ROCKSDB_MAJOR |
||||||
|
#define __ROCKSDB_MINOR__ ROCKSDB_MINOR |
||||||
|
#define __ROCKSDB_PATCH__ ROCKSDB_PATCH |
||||||
|
Loading…
Reference in new issue