[Commits] c91814aef: Merge branch 'master' into spetrunia-range-locking-rocksdb-pr2-locktrack
revision-id: c91814aeffe1043714481723bdffb8b38034ec8a (v5.8-2696-gc91814aef) parent(s): 18221ef35c107f54861ee4330a0108dc382db582 8a1da56b961baf1b491b00af67f0fe8ab5c9afc5 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2020-08-10 15:21:23 +0300 message: Merge branch 'master' into spetrunia-range-locking-rocksdb-pr2-locktrack .circleci/cat_ignore_eagain | 54 + .circleci/config.yml | 212 +++- .circleci/ubsan_suppression_list.txt | 6 + .circleci/vs2015_install.ps1 | 23 + .circleci/vs2017_install.ps1 | 34 + .travis.yml | 11 +- CMakeLists.txt | 73 +- HISTORY.md | 53 +- LANGUAGE-BINDINGS.md | 4 +- Makefile | 1096 +++++++++----------- README.md | 5 +- TARGETS | 54 +- appveyor.yml | 13 +- buckifier/buckify_rocksdb.py | 75 +- buckifier/targets_builder.py | 24 + build_tools/build_detect_platform | 65 +- build_tools/fbcode_config.sh | 2 + build_tools/fbcode_config4.8.1.sh | 2 + build_tools/fbcode_config_platform007.sh | 2 + build_tools/rocksdb-lego-determinator | 230 +++- cache/cache_test.cc | 36 +- cache/lru_cache_test.cc | 5 +- db/arena_wrapped_db_iter.cc | 10 +- db/arena_wrapped_db_iter.h | 7 +- db/blob/blob_file_meta.cc | 9 +- db/blob/blob_file_meta.h | 22 +- {utilities/blob_db => db/blob}/blob_log_format.cc | 4 +- {utilities/blob_db => db/blob}/blob_log_format.h | 4 - {utilities/blob_db => db/blob}/blob_log_reader.cc | 17 +- {utilities/blob_db => db/blob}/blob_log_reader.h | 24 +- {utilities/blob_db => db/blob}/blob_log_writer.cc | 49 +- {utilities/blob_db => db/blob}/blob_log_writer.h | 29 +- db/blob/db_blob_index_test.cc | 2 +- db/builder.cc | 50 +- db/builder.h | 6 +- db/c.cc | 302 ++++++ db/c_test.c | 486 +++++++++ db/column_family.cc | 24 +- db/column_family.h | 2 + db/column_family_test.cc | 42 +- db/compact_files_test.cc | 9 +- db/compacted_db_impl.cc | 6 +- db/compaction/compaction.cc | 31 +- db/compaction/compaction.h | 5 + db/compaction/compaction_iterator.cc | 31 +- db/compaction/compaction_iterator.h | 3 +- db/compaction/compaction_job.cc | 179 +++- db/compaction/compaction_job.h | 6 +- db/compaction/compaction_job_stats_test.cc | 9 +- db/compaction/compaction_job_test.cc | 13 +- db/compaction/compaction_picker.cc | 17 +- db/compaction/compaction_picker.h | 9 +- db/compaction/compaction_picker_fifo.cc | 37 +- db/compaction/compaction_picker_fifo.h | 8 +- db/compaction/compaction_picker_level.cc | 18 +- db/compaction/compaction_picker_level.h | 3 +- db/compaction/compaction_picker_test.cc | 193 +++- db/compaction/compaction_picker_universal.cc | 34 +- db/compaction/compaction_picker_universal.h | 3 +- db/compaction/sst_partitioner.cc | 44 + db/comparator_db_test.cc | 5 +- db/corruption_test.cc | 86 +- db/cuckoo_table_db_test.cc | 5 +- db/db_basic_test.cc | 720 ++++++++++--- db/db_block_cache_test.cc | 6 +- db/db_compaction_filter_test.cc | 9 +- db/db_compaction_test.cc | 331 ++++-- db/db_dynamic_level_test.cc | 35 +- db/db_filesnapshot.cc | 51 - db/db_flush_test.cc | 10 +- db/db_impl/db_impl.cc | 222 +++- db/db_impl/db_impl.h | 63 +- db/db_impl/db_impl_compaction_flush.cc | 76 +- db/db_impl/db_impl_debug.cc | 12 +- db/db_impl/db_impl_experimental.cc | 6 +- db/db_impl/db_impl_files.cc | 58 +- db/db_impl/db_impl_open.cc | 127 ++- db/db_impl/db_impl_readonly.cc | 29 +- db/db_impl/db_impl_secondary.cc | 14 +- db/db_impl/db_impl_write.cc | 42 +- db/db_impl/db_secondary_test.cc | 2 +- db/db_info_dumper.cc | 5 +- db/db_info_dumper.h | 3 +- db/db_io_failure_test.cc | 9 +- db/db_iter.cc | 36 +- db/db_iter.h | 2 +- db/db_iter_stress_test.cc | 11 +- db/db_iterator_test.cc | 38 +- db/db_memtable_test.cc | 4 +- db/db_merge_operand_test.cc | 2 +- db/db_merge_operator_test.cc | 11 +- db/db_options_test.cc | 15 +- db/db_properties_test.cc | 36 +- db/db_range_del_test.cc | 29 +- db/db_sst_test.cc | 19 +- db/db_statistics_test.cc | 5 +- db/db_table_properties_test.cc | 28 +- db/db_test.cc | 204 ++-- db/db_test2.cc | 474 ++++++--- db/db_test_util.cc | 27 +- db/db_test_util.h | 81 +- db/db_universal_compaction_test.cc | 33 +- db/db_wal_test.cc | 362 ++++--- db/db_with_timestamp_basic_test.cc | 146 ++- db/db_write_test.cc | 8 +- db/dbformat.cc | 21 +- db/dbformat.h | 68 +- db/error_handler.cc | 203 +++- db/error_handler.h | 17 + db/error_handler_fs_test.cc | 786 +++++++++++++- db/event_helpers.cc | 4 +- db/external_sst_file_basic_test.cc | 294 +++++- db/external_sst_file_ingestion_job.cc | 167 ++- db/external_sst_file_ingestion_job.h | 11 + db/external_sst_file_test.cc | 64 +- db/fault_injection_test.cc | 6 +- db/filename_test.cc | 2 +- db/flush_job.cc | 8 +- db/flush_job.h | 5 +- db/flush_job_test.cc | 7 +- db/forward_iterator.cc | 16 +- db/import_column_family_test.cc | 22 +- db/internal_stats.cc | 2 +- db/listener_test.cc | 74 +- db/log_reader.cc | 1 + db/log_writer.cc | 2 + db/memtable.cc | 21 +- db/memtable_list.cc | 1 - db/obsolete_files_test.cc | 48 +- db/plain_table_db_test.cc | 23 +- db/prefix_test.cc | 13 +- db/repair.cc | 12 +- db/table_cache.cc | 80 +- db/table_cache.h | 16 +- db/version_builder.cc | 316 ++++-- db/version_builder.h | 3 +- db/version_builder_test.cc | 355 ++++++- db/version_edit.cc | 129 ++- db/version_edit.h | 85 +- db/version_edit_handler.cc | 26 +- db/version_edit_handler.h | 3 +- db/version_edit_test.cc | 205 ++++ db/version_set.cc | 254 ++--- db/version_set.h | 83 +- db/version_set_test.cc | 140 +-- db/wal_edit.cc | 175 ++++ db/wal_edit.h | 143 +++ db/wal_edit_test.cc | 127 +++ db/write_batch.cc | 3 +- db/write_callback_test.cc | 489 ++++----- db_stress_tool/cf_consistency_stress.cc | 29 +- db_stress_tool/db_stress_common.h | 57 +- db_stress_tool/db_stress_compaction_filter.h | 79 ++ db_stress_tool/db_stress_driver.cc | 18 +- db_stress_tool/db_stress_gflags.cc | 23 +- db_stress_tool/db_stress_test_base.cc | 129 ++- db_stress_tool/db_stress_test_base.h | 5 +- db_stress_tool/db_stress_tool.cc | 39 +- db_stress_tool/no_batched_ops_stress.cc | 2 +- env/composite_env_wrapper.h | 18 +- env/env.cc | 4 +- env/env_basic_test.cc | 44 +- env/env_chroot.cc | 3 +- env/env_encryption.cc | 566 +++++----- env/env_hdfs.cc | 6 +- env/env_posix.cc | 26 +- env/env_test.cc | 163 ++- env/file_system.cc | 2 +- env/file_system_tracer.cc | 319 ++++++ env/file_system_tracer.h | 330 ++++++ env/fs_posix.cc | 45 +- env/io_posix.cc | 21 +- env/mock_env.cc | 2 +- examples/CMakeLists.txt | 45 + examples/simple_example.cc | 2 +- file/delete_scheduler.cc | 4 +- file/delete_scheduler.h | 3 +- file/delete_scheduler_test.cc | 10 +- file/file_prefetch_buffer.cc | 13 +- file/file_prefetch_buffer.h | 10 +- file/file_util.cc | 110 ++ file/file_util.h | 19 +- file/random_access_file_reader.cc | 28 +- file/random_access_file_reader.h | 28 +- file/random_access_file_reader_test.cc | 262 ++++- file/sst_file_manager_impl.cc | 5 +- file/writable_file_writer.cc | 106 +- file/writable_file_writer.h | 76 +- hdfs/env_hdfs.h | 8 +- include/rocksdb/advanced_options.h | 4 +- include/rocksdb/c.h | 132 +++ include/rocksdb/compaction_filter.h | 2 + include/rocksdb/compression_type.h | 40 + include/rocksdb/convenience.h | 1 + include/rocksdb/db.h | 29 +- include/rocksdb/env.h | 22 +- include/rocksdb/env_encryption.h | 238 ++++- include/rocksdb/file_system.h | 21 +- include/rocksdb/listener.h | 72 +- include/rocksdb/merge_operator.h | 0 include/rocksdb/options.h | 100 +- include/rocksdb/persistent_cache.h | 6 + include/rocksdb/sst_partitioner.h | 135 +++ include/rocksdb/statistics.h | 8 + include/rocksdb/table.h | 48 +- include/rocksdb/table_properties.h | 13 + include/rocksdb/utilities/backupable_db.h | 92 +- include/rocksdb/utilities/leveldb_options.h | 3 +- include/rocksdb/utilities/stackable_db.h | 9 + include/rocksdb/version.h | 2 +- java/CMakeLists.txt | 8 +- java/Makefile | 4 + java/crossbuild/docker-build-linux-alpine.sh | 2 +- java/crossbuild/docker-build-linux-centos.sh | 2 +- java/{rocksjni.pom => pom.xml.template} | 40 +- java/rocksjni/options.cc | 42 +- java/rocksjni/portal.h | 69 ++ java/rocksjni/rocksjni.cc | 107 +- java/rocksjni/sst_partitioner.cc | 42 + java/rocksjni/table.cc | 25 +- .../java/org/rocksdb/BlockBasedTableConfig.java | 158 ++- java/src/main/java/org/rocksdb/ChecksumType.java | 6 +- .../main/java/org/rocksdb/ColumnFamilyOptions.java | 15 +- .../org/rocksdb/ColumnFamilyOptionsInterface.java | 17 + .../main/java/org/rocksdb/IndexShorteningMode.java | 60 ++ java/src/main/java/org/rocksdb/IndexType.java | 16 +- .../main/java/org/rocksdb/NativeLibraryLoader.java | 7 +- java/src/main/java/org/rocksdb/Options.java | 14 + java/src/main/java/org/rocksdb/RocksDB.java | 180 +++- .../java/org/rocksdb/SstPartitionerFactory.java | 15 + .../rocksdb/SstPartitionerFixedPrefixFactory.java | 19 + java/src/main/java/org/rocksdb/TickerType.java | 10 + .../org/rocksdb/BlockBasedTableConfigTest.java | 23 +- java/src/test/java/org/rocksdb/RocksDBTest.java | 7 + .../src/test/java/org/rocksdb/SecondaryDBTest.java | 135 +++ .../test/java/org/rocksdb/SstPartitionerTest.java | 43 + memtable/memtablerep_bench.cc | 2 +- monitoring/statistics.cc | 6 + monitoring/thread_status_updater_debug.cc | 3 +- options/cf_options.cc | 140 ++- options/cf_options.h | 12 +- options/db_options.cc | 32 +- options/db_options.h | 4 +- options/options.cc | 6 + options/options_helper.cc | 26 +- options/options_settable_test.cc | 76 +- options/options_test.cc | 166 +++ port/stack_trace.cc | 2 +- src.mk | 101 +- table/adaptive/adaptive_table_factory.cc | 10 +- table/adaptive/adaptive_table_factory.h | 3 +- table/block_based/binary_search_index_reader.cc | 10 +- table/block_based/binary_search_index_reader.h | 2 +- table/block_based/block.cc | 218 ++-- table/block_based/block.h | 296 +++--- table/block_based/block_based_filter_block.cc | 12 +- table/block_based/block_based_filter_block.h | 6 +- table/block_based/block_based_table_builder.cc | 65 +- table/block_based/block_based_table_builder.h | 3 +- table/block_based/block_based_table_factory.cc | 14 +- table/block_based/block_based_table_factory.h | 3 +- table/block_based/block_based_table_iterator.cc | 20 +- table/block_based/block_based_table_iterator.h | 78 +- table/block_based/block_based_table_reader.cc | 225 ++-- table/block_based/block_based_table_reader.h | 54 +- table/block_based/block_based_table_reader_test.cc | 20 +- table/block_based/block_test.cc | 54 +- table/block_based/data_block_hash_index_test.cc | 20 +- table/block_based/filter_block.h | 2 +- table/block_based/filter_policy.cc | 208 +++- table/block_based/filter_policy_internal.h | 10 + table/block_based/full_filter_block.cc | 12 +- table/block_based/full_filter_block.h | 6 +- table/block_based/hash_index_reader.cc | 5 +- table/block_based/hash_index_reader.h | 2 +- table/block_based/index_builder.cc | 29 +- table/block_based/partitioned_filter_block.cc | 41 +- table/block_based/partitioned_filter_block.h | 8 +- table/block_based/partitioned_index_iterator.h | 12 +- table/block_based/partitioned_index_reader.cc | 29 +- table/block_based/partitioned_index_reader.h | 4 +- table/block_based/reader_common.cc | 39 +- table/block_based/reader_common.h | 8 +- table/block_based/uncompression_dict_reader.cc | 10 +- table/block_based/uncompression_dict_reader.h | 6 +- table/block_fetcher.cc | 86 +- table/block_fetcher_test.cc | 310 +++--- table/cuckoo/cuckoo_table_builder.cc | 5 +- table/cuckoo/cuckoo_table_builder.h | 17 +- table/cuckoo/cuckoo_table_factory.cc | 5 +- table/cuckoo/cuckoo_table_factory.h | 3 +- table/format.cc | 15 +- table/format.h | 4 +- table/internal_iterator.h | 34 +- table/iterator_wrapper.h | 13 +- table/merger_test.cc | 8 +- table/merging_iterator.cc | 6 +- table/meta_blocks.cc | 57 +- table/meta_blocks.h | 3 +- table/mock_table.cc | 154 ++- table/mock_table.h | 147 +-- table/plain/plain_table_builder.cc | 5 +- table/plain/plain_table_builder.h | 3 +- table/plain/plain_table_factory.cc | 6 +- table/plain/plain_table_factory.h | 10 +- table/plain/plain_table_reader.cc | 2 +- table/sst_file_dumper.cc | 481 +++++++++ .../sst_dump_tool_imp.h => table/sst_file_dumper.h | 8 +- table/sst_file_writer.cc | 14 +- table/table_builder.h | 25 +- table/table_properties.cc | 8 + table/table_reader.h | 6 +- table/table_test.cc | 439 ++++---- test_util/sync_point.cc | 25 +- test_util/sync_point.h | 5 +- test_util/sync_point_impl.cc | 2 +- test_util/testharness.cc | 2 +- test_util/testutil.cc | 72 +- test_util/testutil.h | 13 +- test_util/testutil_test.cc | 3 +- tools/check_format_compatible.sh | 14 +- tools/db_bench_tool.cc | 13 + tools/db_crashtest.py | 83 +- tools/db_repl_stress.cc | 10 +- tools/ldb_cmd.cc | 21 +- tools/ldb_cmd_test.cc | 40 +- tools/ldb_tool.cc | 5 +- tools/reduce_levels_test.cc | 5 +- tools/sst_dump_tool.cc | 458 +------- trace_replay/block_cache_tracer.cc | 4 +- trace_replay/io_tracer.cc | 228 ++++ trace_replay/io_tracer.h | 153 +++ trace_replay/io_tracer_test.cc | 215 ++++ trace_replay/trace_replay.h | 6 + util/bloom_test.cc | 76 +- util/cast_util.h | 3 +- util/file_reader_writer_test.cc | 15 +- util/filelock_test.cc | 4 + util/filter_bench.cc | 28 +- util/random.cc | 18 + util/random.h | 6 + util/status.cc | 2 +- util/thread_local.cc | 2 +- util/threadpool_imp.cc | 42 +- util/threadpool_imp.h | 2 +- util/timer.h | 21 +- util/timer_test.cc | 125 ++- util/user_comparator_wrapper.h | 4 + utilities/backupable/backupable_db.cc | 508 +++++++-- utilities/backupable/backupable_db_test.cc | 576 +++++++++- utilities/blob_db/blob_compaction_filter.cc | 374 ++++--- utilities/blob_db/blob_compaction_filter.h | 111 +- utilities/blob_db/blob_db.h | 4 + utilities/blob_db/blob_db_impl.cc | 108 +- utilities/blob_db/blob_db_impl.h | 24 +- utilities/blob_db/blob_db_impl_filesnapshot.cc | 7 +- utilities/blob_db/blob_db_test.cc | 268 ++++- utilities/blob_db/blob_dump_tool.h | 3 +- utilities/blob_db/blob_file.cc | 13 +- utilities/blob_db/blob_file.h | 19 +- utilities/cassandra/cassandra_functional_test.cc | 4 +- utilities/checkpoint/checkpoint_impl.cc | 48 +- utilities/checkpoint/checkpoint_impl.h | 6 +- utilities/checkpoint/checkpoint_test.cc | 18 +- .../layered_compaction_filter_base.h | 37 + utilities/debug.cc | 5 +- utilities/env_timed_test.cc | 2 +- .../fault_injection_env.cc | 4 +- .../fault_injection_env.h | 6 +- .../fault_injection_fs.cc | 10 +- .../fault_injection_fs.h | 14 +- utilities/memory/memory_test.cc | 17 +- .../option_change_migration_test.cc | 10 +- utilities/options/options_util.cc | 2 +- utilities/options/options_util_test.cc | 4 +- .../persistent_cache/persistent_cache_test.cc | 9 +- utilities/persistent_cache/persistent_cache_test.h | 3 +- .../persistent_cache/persistent_cache_tier.cc | 4 + utilities/persistent_cache/persistent_cache_tier.h | 3 + utilities/transactions/lock/point_lock_tracker.cc | 2 +- utilities/transactions/lock/point_lock_tracker.h | 6 +- utilities/transactions/pessimistic_transaction.cc | 4 +- utilities/transactions/range_locking_test.cc | 2 +- .../transactions/transaction_lock_mgr_test.cc | 4 +- utilities/transactions/transaction_test.cc | 63 +- utilities/transactions/transaction_test.h | 9 +- utilities/transactions/transaction_util.cc | 3 +- .../write_prepared_transaction_test.cc | 32 +- utilities/transactions/write_prepared_txn_db.cc | 6 +- utilities/transactions/write_unprepared_txn.cc | 8 +- utilities/transactions/write_unprepared_txn_db.cc | 3 +- utilities/ttl/db_ttl_impl.h | 34 +- .../write_batch_with_index.cc | 4 +- .../write_batch_with_index_internal.cc | 4 +- 394 files changed, 18415 insertions(+), 6264 deletions(-) diff --cc CMakeLists.txt index 429d5d5dc,2731a60ef..5e51cf80a --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -1171,10 -1165,10 +1196,11 @@@ if(WITH_TESTS utilities/transactions/transaction_lock_mgr_test.cc utilities/transactions/write_prepared_transaction_test.cc utilities/transactions/write_unprepared_transaction_test.cc + utilities/transactions/range_locking_test.cc utilities/ttl/ttl_test.cc utilities/write_batch_with_index/write_batch_with_index_test.cc - ) + ) + endif() if(WITH_LIBRADOS) list(APPEND TESTS utilities/env_librados_test.cc) endif() diff --cc Makefile index bce90ad25,6177c136c..996a8598c --- a/Makefile +++ b/Makefile @@@ -665,6 -542,6 +545,7 @@@ PARALLEL_TEST = table_test \ transaction_test \ transaction_lock_mgr_test \ ++ range_locking_test \ write_prepared_transaction_test \ write_unprepared_transaction_test \ @@@ -1578,314 -1498,317 +1502,320 @@@ env_timed_test: $(OBJ_DIR)/utilities/en $(AM_LINK) ifdef ROCKSDB_USE_LIBRADOS - env_librados_test: utilities/env_librados_test.o $(LIBOBJECTS) $(TESTHARNESS) - $(AM_V_CCLD)$(CXX) $^ $(EXEC_LDFLAGS) -o $@ $(LDFLAGS) $(COVERAGEFLAGS) + env_librados_test: $(OBJ_DIR)/utilities/env_librados_test.o $(TEST_LIBRARY) $(LIBRARY) + $(AM_LINK) endif - object_registry_test: utilities/object_registry_test.o $(LIBOBJECTS) $(TESTHARNESS) + object_registry_test: $(OBJ_DIR)/utilities/object_registry_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - ttl_test: utilities/ttl/ttl_test.o $(LIBOBJECTS) $(TESTHARNESS) + ttl_test: $(OBJ_DIR)/utilities/ttl/ttl_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - write_batch_with_index_test: utilities/write_batch_with_index/write_batch_with_index_test.o $(LIBOBJECTS) $(TESTHARNESS) + write_batch_with_index_test: $(OBJ_DIR)/utilities/write_batch_with_index/write_batch_with_index_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - flush_job_test: db/flush_job_test.o $(LIBOBJECTS) $(TESTHARNESS) + flush_job_test: $(OBJ_DIR)/db/flush_job_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - compaction_iterator_test: db/compaction/compaction_iterator_test.o $(LIBOBJECTS) $(TESTHARNESS) + compaction_iterator_test: $(OBJ_DIR)/db/compaction/compaction_iterator_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - compaction_job_test: db/compaction/compaction_job_test.o $(LIBOBJECTS) $(TESTHARNESS) + compaction_job_test: $(OBJ_DIR)/db/compaction/compaction_job_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - compaction_job_stats_test: db/compaction/compaction_job_stats_test.o $(LIBOBJECTS) $(TESTHARNESS) + compaction_job_stats_test: $(OBJ_DIR)/db/compaction/compaction_job_stats_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - compact_on_deletion_collector_test: utilities/table_properties_collectors/compact_on_deletion_collector_test.o $(LIBOBJECTS) $(TESTHARNESS) + compact_on_deletion_collector_test: $(OBJ_DIR)/utilities/table_properties_collectors/compact_on_deletion_collector_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - wal_manager_test: db/wal_manager_test.o $(LIBOBJECTS) $(TESTHARNESS) + wal_manager_test: $(OBJ_DIR)/db/wal_manager_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - dbformat_test: db/dbformat_test.o $(LIBOBJECTS) $(TESTHARNESS) + wal_edit_test: $(OBJ_DIR)/db/wal_edit_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - env_basic_test: env/env_basic_test.o $(LIBOBJECTS) $(TESTHARNESS) + dbformat_test: $(OBJ_DIR)/db/dbformat_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - env_test: env/env_test.o $(LIBOBJECTS) $(TESTHARNESS) + env_basic_test: $(OBJ_DIR)/env/env_basic_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - io_posix_test: env/io_posix_test.o $(LIBOBJECTS) $(TESTHARNESS) + env_test: $(OBJ_DIR)/env/env_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - fault_injection_test: db/fault_injection_test.o $(LIBOBJECTS) $(TESTHARNESS) + io_posix_test: $(OBJ_DIR)/env/io_posix_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - rate_limiter_test: util/rate_limiter_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) + fault_injection_test: $(OBJ_DIR)/db/fault_injection_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - delete_scheduler_test: file/delete_scheduler_test.o $(LIBOBJECTS) $(TESTHARNESS) + rate_limiter_test: $(OBJ_DIR)/util/rate_limiter_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - filename_test: db/filename_test.o $(LIBOBJECTS) $(TESTHARNESS) + delete_scheduler_test: $(OBJ_DIR)/file/delete_scheduler_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - random_access_file_reader_test: file/random_access_file_reader_test.o $(LIBOBJECTS) $(TESTHARNESS) $(TESTUTIL) + filename_test: $(OBJ_DIR)/db/filename_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - file_reader_writer_test: util/file_reader_writer_test.o $(LIBOBJECTS) $(TESTHARNESS) + random_access_file_reader_test: $(OBJ_DIR)/file/random_access_file_reader_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - block_based_filter_block_test: table/block_based/block_based_filter_block_test.o $(LIBOBJECTS) $(TESTHARNESS) + file_reader_writer_test: $(OBJ_DIR)/util/file_reader_writer_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - block_based_table_reader_test: table/block_based/block_based_table_reader_test.o $(LIBOBJECTS) $(TESTHARNESS) + block_based_filter_block_test: $(OBJ_DIR)/table/block_based/block_based_filter_block_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - full_filter_block_test: table/block_based/full_filter_block_test.o $(LIBOBJECTS) $(TESTHARNESS) + block_based_table_reader_test: table/block_based/block_based_table_reader_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - partitioned_filter_block_test: table/block_based/partitioned_filter_block_test.o $(LIBOBJECTS) $(TESTHARNESS) + full_filter_block_test: $(OBJ_DIR)/table/block_based/full_filter_block_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - log_test: db/log_test.o $(LIBOBJECTS) $(TESTHARNESS) + partitioned_filter_block_test: $(OBJ_DIR)/table/block_based/partitioned_filter_block_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - cleanable_test: table/cleanable_test.o $(LIBOBJECTS) $(TESTHARNESS) + log_test: $(OBJ_DIR)/db/log_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - table_test: table/table_test.o $(LIBOBJECTS) $(TESTHARNESS) + cleanable_test: $(OBJ_DIR)/table/cleanable_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - block_fetcher_test: table/block_fetcher_test.o $(LIBOBJECTS) $(TESTHARNESS) + table_test: $(OBJ_DIR)/table/table_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - block_test: table/block_based/block_test.o $(LIBOBJECTS) $(TESTHARNESS) + block_fetcher_test: table/block_fetcher_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - data_block_hash_index_test: table/block_based/data_block_hash_index_test.o $(LIBOBJECTS) $(TESTHARNESS) + block_test: $(OBJ_DIR)/table/block_based/block_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - inlineskiplist_test: memtable/inlineskiplist_test.o $(LIBOBJECTS) $(TESTHARNESS) + data_block_hash_index_test: $(OBJ_DIR)/table/block_based/data_block_hash_index_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - skiplist_test: memtable/skiplist_test.o $(LIBOBJECTS) $(TESTHARNESS) + inlineskiplist_test: $(OBJ_DIR)/memtable/inlineskiplist_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - write_buffer_manager_test: memtable/write_buffer_manager_test.o $(LIBOBJECTS) $(TESTHARNESS) + skiplist_test: $(OBJ_DIR)/memtable/skiplist_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - version_edit_test: db/version_edit_test.o $(LIBOBJECTS) $(TESTHARNESS) + write_buffer_manager_test: $(OBJ_DIR)/memtable/write_buffer_manager_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - version_set_test: db/version_set_test.o $(LIBOBJECTS) $(TESTHARNESS) + version_edit_test: $(OBJ_DIR)/db/version_edit_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - compaction_picker_test: db/compaction/compaction_picker_test.o $(LIBOBJECTS) $(TESTHARNESS) + version_set_test: $(OBJ_DIR)/db/version_set_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - version_builder_test: db/version_builder_test.o $(LIBOBJECTS) $(TESTHARNESS) + compaction_picker_test: $(OBJ_DIR)/db/compaction/compaction_picker_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - file_indexer_test: db/file_indexer_test.o $(LIBOBJECTS) $(TESTHARNESS) + version_builder_test: $(OBJ_DIR)/db/version_builder_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - reduce_levels_test: tools/reduce_levels_test.o $(LIBOBJECTS) $(TESTHARNESS) + file_indexer_test: $(OBJ_DIR)/db/file_indexer_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - write_batch_test: db/write_batch_test.o $(LIBOBJECTS) $(TESTHARNESS) + reduce_levels_test: $(OBJ_DIR)/tools/reduce_levels_test.o $(TOOLS_LIBRARY) $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - write_controller_test: db/write_controller_test.o $(LIBOBJECTS) $(TESTHARNESS) + write_batch_test: $(OBJ_DIR)/db/write_batch_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - merge_helper_test: db/merge_helper_test.o $(LIBOBJECTS) $(TESTHARNESS) + write_controller_test: $(OBJ_DIR)/db/write_controller_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - memory_test: utilities/memory/memory_test.o $(LIBOBJECTS) $(TESTHARNESS) + merge_helper_test: $(OBJ_DIR)/db/merge_helper_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - merge_test: db/merge_test.o $(LIBOBJECTS) $(TESTHARNESS) + memory_test: $(OBJ_DIR)/utilities/memory/memory_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - merger_test: table/merger_test.o $(LIBOBJECTS) $(TESTHARNESS) + merge_test: $(OBJ_DIR)/db/merge_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - util_merge_operators_test: utilities/util_merge_operators_test.o $(LIBOBJECTS) $(TESTHARNESS) + merger_test: $(OBJ_DIR)/table/merger_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - options_file_test: db/options_file_test.o $(LIBOBJECTS) $(TESTHARNESS) + util_merge_operators_test: $(OBJ_DIR)/utilities/util_merge_operators_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - deletefile_test: db/deletefile_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) + options_file_test: $(OBJ_DIR)/db/options_file_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - obsolete_files_test: db/obsolete_files_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) + deletefile_test: $(OBJ_DIR)/db/deletefile_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - rocksdb_dump: tools/dump/rocksdb_dump.o $(LIBOBJECTS) + obsolete_files_test: $(OBJ_DIR)/db/obsolete_files_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - rocksdb_undump: tools/dump/rocksdb_undump.o $(LIBOBJECTS) + rocksdb_dump: $(OBJ_DIR)/tools/dump/rocksdb_dump.o $(LIBRARY) $(AM_LINK) - cuckoo_table_builder_test: table/cuckoo/cuckoo_table_builder_test.o $(LIBOBJECTS) $(TESTHARNESS) + rocksdb_undump: $(OBJ_DIR)/tools/dump/rocksdb_undump.o $(LIBRARY) $(AM_LINK) - cuckoo_table_reader_test: table/cuckoo/cuckoo_table_reader_test.o $(LIBOBJECTS) $(TESTHARNESS) + cuckoo_table_builder_test: $(OBJ_DIR)/table/cuckoo/cuckoo_table_builder_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - cuckoo_table_db_test: db/cuckoo_table_db_test.o $(LIBOBJECTS) $(TESTHARNESS) + cuckoo_table_reader_test: $(OBJ_DIR)/table/cuckoo/cuckoo_table_reader_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - listener_test: db/listener_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) + cuckoo_table_db_test: $(OBJ_DIR)/db/cuckoo_table_db_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - thread_list_test: util/thread_list_test.o $(LIBOBJECTS) $(TESTHARNESS) + listener_test: $(OBJ_DIR)/db/listener_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - compact_files_test: db/compact_files_test.o $(LIBOBJECTS) $(TESTHARNESS) + thread_list_test: $(OBJ_DIR)/util/thread_list_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - options_test: options/options_test.o $(LIBOBJECTS) $(TESTHARNESS) + compact_files_test: $(OBJ_DIR)/db/compact_files_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - options_settable_test: options/options_settable_test.o $(LIBOBJECTS) $(TESTHARNESS) + options_test: $(OBJ_DIR)/options/options_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - options_util_test: utilities/options/options_util_test.o $(LIBOBJECTS) $(TESTHARNESS) + options_settable_test: $(OBJ_DIR)/options/options_settable_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - db_bench_tool_test: tools/db_bench_tool_test.o $(BENCHTOOLOBJECTS) $(TESTHARNESS) + options_util_test: $(OBJ_DIR)/utilities/options/options_util_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - trace_analyzer_test: tools/trace_analyzer_test.o $(LIBOBJECTS) $(ANALYZETOOLOBJECTS) $(TESTHARNESS) + db_bench_tool_test: $(OBJ_DIR)/tools/db_bench_tool_test.o $(BENCH_OBJECTS) $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - event_logger_test: logging/event_logger_test.o $(LIBOBJECTS) $(TESTHARNESS) + trace_analyzer_test: $(OBJ_DIR)/tools/trace_analyzer_test.o $(ANALYZE_OBJECTS) $(TOOLS_LIBRARY) $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - timer_queue_test: util/timer_queue_test.o $(LIBOBJECTS) $(TESTHARNESS) + event_logger_test: $(OBJ_DIR)/logging/event_logger_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - sst_dump_test: tools/sst_dump_test.o $(LIBOBJECTS) $(TESTHARNESS) + timer_queue_test: $(OBJ_DIR)/util/timer_queue_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - optimistic_transaction_test: utilities/transactions/optimistic_transaction_test.o $(LIBOBJECTS) $(TESTHARNESS) + sst_dump_test: $(OBJ_DIR)/tools/sst_dump_test.o $(TOOLS_LIBRARY) $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - mock_env_test : env/mock_env_test.o $(LIBOBJECTS) $(TESTHARNESS) + optimistic_transaction_test: $(OBJ_DIR)/utilities/transactions/optimistic_transaction_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - manual_compaction_test: db/manual_compaction_test.o $(LIBOBJECTS) $(TESTHARNESS) + mock_env_test : $(OBJ_DIR)/env/mock_env_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - filelock_test: util/filelock_test.o $(LIBOBJECTS) $(TESTHARNESS) + manual_compaction_test: $(OBJ_DIR)/db/manual_compaction_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - auto_roll_logger_test: logging/auto_roll_logger_test.o $(LIBOBJECTS) $(TESTHARNESS) + filelock_test: $(OBJ_DIR)/util/filelock_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - env_logger_test: logging/env_logger_test.o $(LIBOBJECTS) $(TESTHARNESS) + auto_roll_logger_test: $(OBJ_DIR)/logging/auto_roll_logger_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - memtable_list_test: db/memtable_list_test.o $(LIBOBJECTS) $(TESTHARNESS) + env_logger_test: $(OBJ_DIR)/logging/env_logger_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - write_callback_test: db/write_callback_test.o $(LIBOBJECTS) $(TESTHARNESS) + memtable_list_test: $(OBJ_DIR)/db/memtable_list_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - heap_test: util/heap_test.o $(GTEST) + write_callback_test: $(OBJ_DIR)/db/write_callback_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - transaction_lock_mgr_test: utilities/transactions/transaction_lock_mgr_test.o $(LIBOBJECTS) $(TESTHARNESS) + heap_test: $(OBJ_DIR)/util/heap_test.o $(GTEST) $(AM_LINK) - transaction_test: utilities/transactions/transaction_test.o $(LIBOBJECTS) $(TESTHARNESS) + transaction_lock_mgr_test: utilities/transactions/transaction_lock_mgr_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - write_prepared_transaction_test: utilities/transactions/write_prepared_transaction_test.o $(LIBOBJECTS) $(TESTHARNESS) + transaction_test: $(OBJ_DIR)/utilities/transactions/transaction_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - write_unprepared_transaction_test: utilities/transactions/write_unprepared_transaction_test.o $(LIBOBJECTS) $(TESTHARNESS) + write_prepared_transaction_test: $(OBJ_DIR)/utilities/transactions/write_prepared_transaction_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - sst_dump: tools/sst_dump.o $(LIBOBJECTS) + write_unprepared_transaction_test: $(OBJ_DIR)/utilities/transactions/write_unprepared_transaction_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - blob_dump: tools/blob_dump.o $(LIBOBJECTS) + sst_dump: $(OBJ_DIR)/tools/sst_dump.o $(TOOLS_LIBRARY) $(LIBRARY) $(AM_LINK) - repair_test: db/repair_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) + blob_dump: $(OBJ_DIR)/tools/blob_dump.o $(TOOLS_LIBRARY) $(LIBRARY) $(AM_LINK) - ldb_cmd_test: tools/ldb_cmd_test.o $(LIBOBJECTS) $(TESTHARNESS) + repair_test: $(OBJ_DIR)/db/repair_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - ldb: tools/ldb.o $(LIBOBJECTS) + ldb_cmd_test: $(OBJ_DIR)/tools/ldb_cmd_test.o $(TOOLS_LIBRARY) $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - iostats_context_test: monitoring/iostats_context_test.o $(LIBOBJECTS) $(TESTHARNESS) + ldb: $(OBJ_DIR)/tools/ldb.o $(TOOLS_LIBRARY) $(LIBRARY) + $(AM_LINK) + + iostats_context_test: $(OBJ_DIR)/monitoring/iostats_context_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_V_CCLD)$(CXX) $^ $(EXEC_LDFLAGS) -o $@ $(LDFLAGS) - persistent_cache_test: utilities/persistent_cache/persistent_cache_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) + persistent_cache_test: $(OBJ_DIR)/utilities/persistent_cache/persistent_cache_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - statistics_test: monitoring/statistics_test.o $(LIBOBJECTS) $(TESTHARNESS) + statistics_test: $(OBJ_DIR)/monitoring/statistics_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - stats_history_test: monitoring/stats_history_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) + stats_history_test: $(OBJ_DIR)/monitoring/stats_history_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - lru_cache_test: cache/lru_cache_test.o $(LIBOBJECTS) $(TESTHARNESS) + lru_cache_test: $(OBJ_DIR)/cache/lru_cache_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - range_del_aggregator_test: db/range_del_aggregator_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) + range_del_aggregator_test: $(OBJ_DIR)/db/range_del_aggregator_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - range_del_aggregator_bench: db/range_del_aggregator_bench.o $(LIBOBJECTS) $(TESTUTIL) + range_del_aggregator_bench: $(OBJ_DIR)/db/range_del_aggregator_bench.o $(LIBRARY) $(AM_LINK) - blob_db_test: utilities/blob_db/blob_db_test.o $(LIBOBJECTS) $(TESTHARNESS) + blob_db_test: $(OBJ_DIR)/utilities/blob_db/blob_db_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - repeatable_thread_test: util/repeatable_thread_test.o $(LIBOBJECTS) $(TESTHARNESS) + repeatable_thread_test: $(OBJ_DIR)/util/repeatable_thread_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - range_locking_test: utilities/transactions/range_locking_test.o $(LIBOBJECTS) $(TESTHARNESS) ++range_locking_test: utilities/transactions/range_locking_test.o $(TEST_LIBRARY) $(LIBRARY) + $(AM_LINK) + - range_tombstone_fragmenter_test: db/range_tombstone_fragmenter_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) + range_tombstone_fragmenter_test: $(OBJ_DIR)/db/range_tombstone_fragmenter_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - sst_file_reader_test: table/sst_file_reader_test.o $(LIBOBJECTS) $(TESTHARNESS) + sst_file_reader_test: $(OBJ_DIR)/table/sst_file_reader_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - db_secondary_test: db/db_impl/db_secondary_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) + db_secondary_test: $(OBJ_DIR)/db/db_impl/db_secondary_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - block_cache_tracer_test: trace_replay/block_cache_tracer_test.o trace_replay/block_cache_tracer.o $(LIBOBJECTS) $(TESTHARNESS) + block_cache_tracer_test: $(OBJ_DIR)/trace_replay/block_cache_tracer_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - block_cache_trace_analyzer_test: tools/block_cache_analyzer/block_cache_trace_analyzer_test.o tools/block_cache_analyzer/block_cache_trace_analyzer.o $(LIBOBJECTS) $(TESTHARNESS) + block_cache_trace_analyzer_test: $(OBJ_DIR)/tools/block_cache_analyzer/block_cache_trace_analyzer_test.o $(OBJ_DIR)/tools/block_cache_analyzer/block_cache_trace_analyzer.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - defer_test: util/defer_test.o $(LIBOBJECTS) $(TESTHARNESS) + defer_test: $(OBJ_DIR)/util/defer_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - blob_file_addition_test: db/blob/blob_file_addition_test.o $(LIBOBJECTS) $(TESTHARNESS) + blob_file_addition_test: $(OBJ_DIR)/db/blob/blob_file_addition_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - blob_file_garbage_test: db/blob/blob_file_garbage_test.o $(LIBOBJECTS) $(TESTHARNESS) + blob_file_garbage_test: $(OBJ_DIR)/db/blob/blob_file_garbage_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - timer_test: util/timer_test.o $(LIBOBJECTS) $(TESTHARNESS) + timer_test: $(OBJ_DIR)/util/timer_test.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) - testutil_test: test_util/testutil_test.o $(LIBOBJECTS) $(TESTHARNESS) + testutil_test: $(OBJ_DIR)/test_util/testutil_test.o $(TEST_LIBRARY) $(LIBRARY) + $(AM_LINK) + + io_tracer_test: $(OBJ_DIR)/trace_replay/io_tracer_test.o $(OBJ_DIR)/trace_replay/io_tracer.o $(TEST_LIBRARY) $(LIBRARY) $(AM_LINK) #------------------------------------------------- diff --cc utilities/transactions/pessimistic_transaction.cc index a8f6fea62,d92818528..f6fd3a504 --- a/utilities/transactions/pessimistic_transaction.cc +++ b/utilities/transactions/pessimistic_transaction.cc @@@ -558,19 -555,9 +558,19 @@@ Status PessimisticTransaction::TryLock( } uint32_t cfh_id = GetColumnFamilyID(column_family); std::string key_str = key.ToString(); - // - PointLockStatus status = tracked_locks_->GetPointLockStatus(cfh_id, key_str); - bool previously_locked = status.locked; - bool lock_upgrade = previously_locked && exclusive && !status.exclusive; ++ + PointLockStatus status; - bool previously_locked; + bool lock_upgrade; ++ bool previously_locked; + if (tracked_locks_->IsPointLockSupported()) { + status = tracked_locks_->GetPointLockStatus(cfh_id, key_str); + previously_locked = status.locked; + lock_upgrade = previously_locked && exclusive && !status.exclusive; + } else { + previously_locked = false; + status.locked = false; + lock_upgrade = false; + } // Lock this key if this transactions hasn't already locked it or we require // an upgrade. diff --cc utilities/transactions/range_locking_test.cc index 1de512079,000000000..07914df6c mode 100644,000000..100644 --- a/utilities/transactions/range_locking_test.cc +++ b/utilities/transactions/range_locking_test.cc @@@ -1,200 -1,0 +1,200 @@@ +#ifndef ROCKSDB_LITE + +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif + +#include "utilities/transactions/transaction_test.h" + +#include <algorithm> +#include <functional> +#include <string> +#include <thread> + +#include "db/db_impl/db_impl.h" +#include "rocksdb/db.h" +#include "rocksdb/options.h" +#include "rocksdb/perf_context.h" +#include "rocksdb/utilities/transaction.h" +#include "rocksdb/utilities/transaction_db.h" +#include "table/mock_table.h" - #include "test_util/fault_injection_test_env.h" ++// #include "test_util/fault_injection_test_env.h" +#include "util/random.h" +#include "util/string_util.h" +#include "test_util/sync_point.h" +#include "test_util/testharness.h" +#include "test_util/testutil.h" +#include "test_util/transaction_test_util.h" +#include "utilities/merge_operators.h" +#include "utilities/merge_operators/string_append/stringappend.h" +#include "utilities/transactions/pessimistic_transaction_db.h" + +#include "port/port.h" + +using std::string; + +namespace rocksdb { + + +class RangeLockingTest : public ::testing::Test { + public: + TransactionDB* db; + std::string dbname; + Options options; + + std::shared_ptr<RangeLockMgrHandle> range_lock_mgr; + TransactionDBOptions txn_db_options; + + RangeLockingTest() + : db(nullptr) { + options.create_if_missing = true; + dbname = test::PerThreadDBPath("range_locking_testdb"); + + DestroyDB(dbname, options); + Status s; + + range_lock_mgr.reset(rocksdb::NewRangeLockManager(nullptr)); + txn_db_options.lock_mgr_handle = range_lock_mgr; + + s = TransactionDB::Open(options, txn_db_options, dbname, &db); + assert(s.ok()); + + } + + ~RangeLockingTest() { + delete db; + db = nullptr; + // This is to skip the assert statement in FaultInjectionTestEnv. There + // seems to be a bug in btrfs that the makes readdir return recently + // unlink-ed files. By using the default fs we simply ignore errors resulted + // from attempting to delete such files in DestroyDB. + DestroyDB(dbname, options); + } + + PessimisticTransaction* NewTxn( + TransactionOptions txn_opt = TransactionOptions()) { + Transaction* txn = db->BeginTransaction(WriteOptions(), txn_opt); + return reinterpret_cast<PessimisticTransaction*>(txn); + } + +}; + +// TODO: set a smaller lock wait timeout so that the test runs faster. +TEST_F(RangeLockingTest, BasicRangeLocking) { + WriteOptions write_options; + TransactionOptions txn_options; + std::string value; + ReadOptions read_options; + + Transaction* txn0 = db->BeginTransaction(write_options, txn_options); + Transaction* txn1 = db->BeginTransaction(write_options, txn_options); + + // Get a range lock + { + auto s= txn0->GetRangeLock(db->DefaultColumnFamily(), + Endpoint("a"), Endpoint("c")); + ASSERT_EQ(s, Status::OK()); + } + + + // Check that range Lock inhibits an overlapping range lock + { + auto s= txn1->GetRangeLock(db->DefaultColumnFamily(), + Endpoint("b"), Endpoint("z")); + ASSERT_TRUE(s.IsTimedOut()); + } + + // Check that range Lock inhibits an overlapping point lock + { + auto s= txn1->GetForUpdate(read_options, db->DefaultColumnFamily(), + Slice("b"), &value); + ASSERT_TRUE(s.IsTimedOut()); + } + + // Get a point lock, check that it inhibits range locks + { + auto s= txn0->Put(db->DefaultColumnFamily(), + Slice("d"), Slice("value")); + ASSERT_EQ(s, Status::OK()); + + auto s2= txn1->GetRangeLock(db->DefaultColumnFamily(), + Endpoint("c"), Endpoint("e")); + ASSERT_TRUE(s2.IsTimedOut()); + } + + ASSERT_OK(txn0->Commit()); + txn1->Rollback(); + + delete txn0; + delete txn1; +} + +TEST_F(RangeLockingTest, SnapshotValidation) { + Status s; + Slice key_slice= Slice("k"); + ColumnFamilyHandle *cfh= db->DefaultColumnFamily(); + + auto txn0 = NewTxn(); + txn0->Put(key_slice, Slice("initial")); + txn0->Commit(); + + // txn1 + auto txn1 = NewTxn(); + txn1->SetSnapshot(); + std::string val1; + s = txn1->Get(ReadOptions(), cfh, key_slice, &val1); + ASSERT_TRUE(s.ok()); + val1 = val1 + std::string("-txn1"); + + s = txn1->Put(cfh, key_slice, Slice(val1)); + ASSERT_TRUE(s.ok()); + + // txn2 + auto txn2 = NewTxn(); + txn2->SetSnapshot(); + std::string val2; + // This will see the original value as nothing is committed + // This is also Get, so it is doesn't acquire any locks. + s = txn2->Get(ReadOptions(), cfh, key_slice, &val2); + ASSERT_TRUE(s.ok()); + + // txn1 + s = txn1->Commit(); + ASSERT_TRUE(s.ok()); + + // txn2 + val2 = val2 + std::string("-txn2"); + // Now, this call should do Snapshot Validation and fail: + s = txn2->Put(cfh, key_slice, Slice(val2)); + ASSERT_TRUE(s.IsBusy()); + + s = txn2->Commit(); + ASSERT_TRUE(s.ok()); + + /* + // Not meaningful if s.IsBusy() above is true: + // Examine the result + auto txn3= NewTxn(); + std::string val3; + Status s3 = txn3->Get(ReadOptions(), cfh, key_slice, &val3); + fprintf(stderr, "Final: %s\n", val3.c_str()); + */ +} + +} // namespace rocksdb + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} + +#else +#include <stdio.h> + +int main(int /*argc*/, char** /*argv*/) { + fprintf(stderr, + "SKIPPED as Transactions are not supported in ROCKSDB_LITE\n"); + return 0; +} + +#endif // ROCKSDB_LITE
participants (1)
-
Sergei Petrunia