rocksdb-native 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.clang-format +15 -0
- package/.github/workflows/test-node.yml +23 -0
- package/.gitmodules +4 -0
- package/CMakeLists.txt +33 -0
- package/LICENSE +201 -0
- package/NOTICE +13 -0
- package/README.md +15 -0
- package/binding.c +470 -0
- package/binding.js +1 -0
- package/index.js +276 -0
- package/package.json +19 -0
- package/vendor/rocksdb/.circleci/config.yml +892 -0
- package/vendor/rocksdb/.circleci/ubsan_suppression_list.txt +6 -0
- package/vendor/rocksdb/.clang-format +5 -0
- package/vendor/rocksdb/.github/workflows/sanity_check.yml +47 -0
- package/vendor/rocksdb/.lgtm.yml +4 -0
- package/vendor/rocksdb/AUTHORS +12 -0
- package/vendor/rocksdb/CMakeLists.txt +1591 -0
- package/vendor/rocksdb/CODE_OF_CONDUCT.md +77 -0
- package/vendor/rocksdb/CONTRIBUTING.md +17 -0
- package/vendor/rocksdb/COPYING +339 -0
- package/vendor/rocksdb/DEFAULT_OPTIONS_HISTORY.md +24 -0
- package/vendor/rocksdb/DUMP_FORMAT.md +16 -0
- package/vendor/rocksdb/HISTORY.md +2399 -0
- package/vendor/rocksdb/INSTALL.md +220 -0
- package/vendor/rocksdb/LANGUAGE-BINDINGS.md +26 -0
- package/vendor/rocksdb/LICENSE.Apache +202 -0
- package/vendor/rocksdb/LICENSE.leveldb +29 -0
- package/vendor/rocksdb/Makefile +2579 -0
- package/vendor/rocksdb/PLUGINS.md +8 -0
- package/vendor/rocksdb/README.md +29 -0
- package/vendor/rocksdb/TARGETS +5599 -0
- package/vendor/rocksdb/USERS.md +165 -0
- package/vendor/rocksdb/Vagrantfile +39 -0
- package/vendor/rocksdb/WINDOWS_PORT.md +228 -0
- package/vendor/rocksdb/buckifier/bench-slow.json +6163 -0
- package/vendor/rocksdb/buckifier/bench.json +1594 -0
- package/vendor/rocksdb/buckifier/buckify_rocksdb.py +333 -0
- package/vendor/rocksdb/buckifier/check_buck_targets.sh +32 -0
- package/vendor/rocksdb/buckifier/rocks_test_runner.sh +6 -0
- package/vendor/rocksdb/buckifier/targets_builder.py +150 -0
- package/vendor/rocksdb/buckifier/targets_cfg.py +41 -0
- package/vendor/rocksdb/buckifier/util.py +118 -0
- package/vendor/rocksdb/build_tools/amalgamate.py +168 -0
- package/vendor/rocksdb/build_tools/benchmark_log_tool.py +238 -0
- package/vendor/rocksdb/build_tools/build_detect_platform +804 -0
- package/vendor/rocksdb/build_tools/check-sources.sh +48 -0
- package/vendor/rocksdb/build_tools/dependencies_platform010.sh +22 -0
- package/vendor/rocksdb/build_tools/dockerbuild.sh +3 -0
- package/vendor/rocksdb/build_tools/error_filter.py +181 -0
- package/vendor/rocksdb/build_tools/fb_compile_mongo.sh +55 -0
- package/vendor/rocksdb/build_tools/fbcode_config.sh +175 -0
- package/vendor/rocksdb/build_tools/fbcode_config_platform010.sh +175 -0
- package/vendor/rocksdb/build_tools/format-diff.sh +203 -0
- package/vendor/rocksdb/build_tools/gnu_parallel +7971 -0
- package/vendor/rocksdb/build_tools/make_package.sh +129 -0
- package/vendor/rocksdb/build_tools/ps_with_stack +38 -0
- package/vendor/rocksdb/build_tools/regression_build_test.sh +396 -0
- package/vendor/rocksdb/build_tools/run_ci_db_test.ps1 +493 -0
- package/vendor/rocksdb/build_tools/setup_centos7.sh +45 -0
- package/vendor/rocksdb/build_tools/ubuntu20_image/Dockerfile +57 -0
- package/vendor/rocksdb/build_tools/update_dependencies.sh +106 -0
- package/vendor/rocksdb/build_tools/version.sh +23 -0
- package/vendor/rocksdb/cache/cache.cc +158 -0
- package/vendor/rocksdb/cache/cache_bench.cc +20 -0
- package/vendor/rocksdb/cache/cache_bench_tool.cc +969 -0
- package/vendor/rocksdb/cache/cache_entry_roles.cc +104 -0
- package/vendor/rocksdb/cache/cache_entry_roles.h +20 -0
- package/vendor/rocksdb/cache/cache_entry_stats.h +182 -0
- package/vendor/rocksdb/cache/cache_helpers.cc +40 -0
- package/vendor/rocksdb/cache/cache_helpers.h +139 -0
- package/vendor/rocksdb/cache/cache_key.cc +364 -0
- package/vendor/rocksdb/cache/cache_key.h +143 -0
- package/vendor/rocksdb/cache/cache_reservation_manager.cc +184 -0
- package/vendor/rocksdb/cache/cache_reservation_manager.h +317 -0
- package/vendor/rocksdb/cache/cache_reservation_manager_test.cc +469 -0
- package/vendor/rocksdb/cache/cache_test.cc +1061 -0
- package/vendor/rocksdb/cache/charged_cache.cc +109 -0
- package/vendor/rocksdb/cache/charged_cache.h +59 -0
- package/vendor/rocksdb/cache/clock_cache.cc +1482 -0
- package/vendor/rocksdb/cache/clock_cache.h +707 -0
- package/vendor/rocksdb/cache/compressed_secondary_cache.cc +304 -0
- package/vendor/rocksdb/cache/compressed_secondary_cache.h +132 -0
- package/vendor/rocksdb/cache/compressed_secondary_cache_test.cc +983 -0
- package/vendor/rocksdb/cache/lru_cache.cc +723 -0
- package/vendor/rocksdb/cache/lru_cache.h +467 -0
- package/vendor/rocksdb/cache/lru_cache_test.cc +2559 -0
- package/vendor/rocksdb/cache/secondary_cache.cc +44 -0
- package/vendor/rocksdb/cache/secondary_cache_adapter.cc +295 -0
- package/vendor/rocksdb/cache/secondary_cache_adapter.h +52 -0
- package/vendor/rocksdb/cache/sharded_cache.cc +137 -0
- package/vendor/rocksdb/cache/sharded_cache.h +309 -0
- package/vendor/rocksdb/cache/typed_cache.h +375 -0
- package/vendor/rocksdb/cmake/RocksDBConfig.cmake.in +54 -0
- package/vendor/rocksdb/common.mk +30 -0
- package/vendor/rocksdb/crash_test.mk +107 -0
- package/vendor/rocksdb/db/arena_wrapped_db_iter.cc +163 -0
- package/vendor/rocksdb/db/arena_wrapped_db_iter.h +127 -0
- package/vendor/rocksdb/db/blob/blob_constants.h +16 -0
- package/vendor/rocksdb/db/blob/blob_contents.cc +42 -0
- package/vendor/rocksdb/db/blob/blob_contents.h +59 -0
- package/vendor/rocksdb/db/blob/blob_counting_iterator.h +150 -0
- package/vendor/rocksdb/db/blob/blob_counting_iterator_test.cc +327 -0
- package/vendor/rocksdb/db/blob/blob_fetcher.cc +34 -0
- package/vendor/rocksdb/db/blob/blob_fetcher.h +37 -0
- package/vendor/rocksdb/db/blob/blob_file_addition.cc +156 -0
- package/vendor/rocksdb/db/blob/blob_file_addition.h +67 -0
- package/vendor/rocksdb/db/blob/blob_file_addition_test.cc +211 -0
- package/vendor/rocksdb/db/blob/blob_file_builder.cc +426 -0
- package/vendor/rocksdb/db/blob/blob_file_builder.h +112 -0
- package/vendor/rocksdb/db/blob/blob_file_builder_test.cc +680 -0
- package/vendor/rocksdb/db/blob/blob_file_cache.cc +101 -0
- package/vendor/rocksdb/db/blob/blob_file_cache.h +56 -0
- package/vendor/rocksdb/db/blob/blob_file_cache_test.cc +278 -0
- package/vendor/rocksdb/db/blob/blob_file_completion_callback.h +84 -0
- package/vendor/rocksdb/db/blob/blob_file_garbage.cc +134 -0
- package/vendor/rocksdb/db/blob/blob_file_garbage.h +57 -0
- package/vendor/rocksdb/db/blob/blob_file_garbage_test.cc +174 -0
- package/vendor/rocksdb/db/blob/blob_file_meta.cc +62 -0
- package/vendor/rocksdb/db/blob/blob_file_meta.h +170 -0
- package/vendor/rocksdb/db/blob/blob_file_reader.cc +624 -0
- package/vendor/rocksdb/db/blob/blob_file_reader.h +112 -0
- package/vendor/rocksdb/db/blob/blob_file_reader_test.cc +1023 -0
- package/vendor/rocksdb/db/blob/blob_garbage_meter.cc +100 -0
- package/vendor/rocksdb/db/blob/blob_garbage_meter.h +102 -0
- package/vendor/rocksdb/db/blob/blob_garbage_meter_test.cc +197 -0
- package/vendor/rocksdb/db/blob/blob_index.h +187 -0
- package/vendor/rocksdb/db/blob/blob_log_format.cc +143 -0
- package/vendor/rocksdb/db/blob/blob_log_format.h +164 -0
- package/vendor/rocksdb/db/blob/blob_log_sequential_reader.cc +134 -0
- package/vendor/rocksdb/db/blob/blob_log_sequential_reader.h +83 -0
- package/vendor/rocksdb/db/blob/blob_log_writer.cc +178 -0
- package/vendor/rocksdb/db/blob/blob_log_writer.h +83 -0
- package/vendor/rocksdb/db/blob/blob_read_request.h +58 -0
- package/vendor/rocksdb/db/blob/blob_source.cc +459 -0
- package/vendor/rocksdb/db/blob/blob_source.h +161 -0
- package/vendor/rocksdb/db/blob/blob_source_test.cc +1611 -0
- package/vendor/rocksdb/db/blob/db_blob_basic_test.cc +2237 -0
- package/vendor/rocksdb/db/blob/db_blob_compaction_test.cc +899 -0
- package/vendor/rocksdb/db/blob/db_blob_corruption_test.cc +80 -0
- package/vendor/rocksdb/db/blob/db_blob_index_test.cc +596 -0
- package/vendor/rocksdb/db/blob/prefetch_buffer_collection.cc +21 -0
- package/vendor/rocksdb/db/blob/prefetch_buffer_collection.h +38 -0
- package/vendor/rocksdb/db/builder.cc +447 -0
- package/vendor/rocksdb/db/builder.h +78 -0
- package/vendor/rocksdb/db/c.cc +6559 -0
- package/vendor/rocksdb/db/c_test.c +3609 -0
- package/vendor/rocksdb/db/column_family.cc +1708 -0
- package/vendor/rocksdb/db/column_family.h +851 -0
- package/vendor/rocksdb/db/column_family_test.cc +3382 -0
- package/vendor/rocksdb/db/compact_files_test.cc +492 -0
- package/vendor/rocksdb/db/compaction/clipping_iterator.h +281 -0
- package/vendor/rocksdb/db/compaction/clipping_iterator_test.cc +259 -0
- package/vendor/rocksdb/db/compaction/compaction.cc +857 -0
- package/vendor/rocksdb/db/compaction/compaction.h +565 -0
- package/vendor/rocksdb/db/compaction/compaction_iteration_stats.h +49 -0
- package/vendor/rocksdb/db/compaction/compaction_iterator.cc +1445 -0
- package/vendor/rocksdb/db/compaction/compaction_iterator.h +530 -0
- package/vendor/rocksdb/db/compaction/compaction_iterator_test.cc +1618 -0
- package/vendor/rocksdb/db/compaction/compaction_job.cc +2054 -0
- package/vendor/rocksdb/db/compaction/compaction_job.h +504 -0
- package/vendor/rocksdb/db/compaction/compaction_job_stats_test.cc +965 -0
- package/vendor/rocksdb/db/compaction/compaction_job_test.cc +2444 -0
- package/vendor/rocksdb/db/compaction/compaction_outputs.cc +784 -0
- package/vendor/rocksdb/db/compaction/compaction_outputs.h +403 -0
- package/vendor/rocksdb/db/compaction/compaction_picker.cc +1225 -0
- package/vendor/rocksdb/db/compaction/compaction_picker.h +318 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_fifo.cc +471 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_fifo.h +60 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_level.cc +888 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_level.h +33 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_test.cc +4074 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_universal.cc +1452 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_universal.h +30 -0
- package/vendor/rocksdb/db/compaction/compaction_service_job.cc +833 -0
- package/vendor/rocksdb/db/compaction/compaction_service_test.cc +954 -0
- package/vendor/rocksdb/db/compaction/compaction_state.cc +46 -0
- package/vendor/rocksdb/db/compaction/compaction_state.h +42 -0
- package/vendor/rocksdb/db/compaction/file_pri.h +92 -0
- package/vendor/rocksdb/db/compaction/sst_partitioner.cc +83 -0
- package/vendor/rocksdb/db/compaction/subcompaction_state.cc +106 -0
- package/vendor/rocksdb/db/compaction/subcompaction_state.h +220 -0
- package/vendor/rocksdb/db/compaction/tiered_compaction_test.cc +2149 -0
- package/vendor/rocksdb/db/comparator_db_test.cc +678 -0
- package/vendor/rocksdb/db/convenience.cc +81 -0
- package/vendor/rocksdb/db/corruption_test.cc +1670 -0
- package/vendor/rocksdb/db/cuckoo_table_db_test.cc +351 -0
- package/vendor/rocksdb/db/db_basic_test.cc +4777 -0
- package/vendor/rocksdb/db/db_block_cache_test.cc +1972 -0
- package/vendor/rocksdb/db/db_bloom_filter_test.cc +3513 -0
- package/vendor/rocksdb/db/db_clip_test.cc +142 -0
- package/vendor/rocksdb/db/db_compaction_filter_test.cc +1030 -0
- package/vendor/rocksdb/db/db_compaction_test.cc +9424 -0
- package/vendor/rocksdb/db/db_dynamic_level_test.cc +499 -0
- package/vendor/rocksdb/db/db_encryption_test.cc +126 -0
- package/vendor/rocksdb/db/db_filesnapshot.cc +436 -0
- package/vendor/rocksdb/db/db_flush_test.cc +3202 -0
- package/vendor/rocksdb/db/db_impl/compacted_db_impl.cc +260 -0
- package/vendor/rocksdb/db/db_impl/compacted_db_impl.h +157 -0
- package/vendor/rocksdb/db/db_impl/db_impl.cc +6132 -0
- package/vendor/rocksdb/db/db_impl/db_impl.h +2841 -0
- package/vendor/rocksdb/db/db_impl/db_impl_compaction_flush.cc +3980 -0
- package/vendor/rocksdb/db/db_impl/db_impl_debug.cc +314 -0
- package/vendor/rocksdb/db/db_impl/db_impl_experimental.cc +159 -0
- package/vendor/rocksdb/db/db_impl/db_impl_files.cc +1014 -0
- package/vendor/rocksdb/db/db_impl/db_impl_open.cc +2202 -0
- package/vendor/rocksdb/db/db_impl/db_impl_readonly.cc +334 -0
- package/vendor/rocksdb/db/db_impl/db_impl_readonly.h +173 -0
- package/vendor/rocksdb/db/db_impl/db_impl_secondary.cc +964 -0
- package/vendor/rocksdb/db/db_impl/db_impl_secondary.h +406 -0
- package/vendor/rocksdb/db/db_impl/db_impl_write.cc +2487 -0
- package/vendor/rocksdb/db/db_info_dumper.cc +147 -0
- package/vendor/rocksdb/db/db_info_dumper.h +15 -0
- package/vendor/rocksdb/db/db_inplace_update_test.cc +262 -0
- package/vendor/rocksdb/db/db_io_failure_test.cc +589 -0
- package/vendor/rocksdb/db/db_iter.cc +1708 -0
- package/vendor/rocksdb/db/db_iter.h +411 -0
- package/vendor/rocksdb/db/db_iter_stress_test.cc +658 -0
- package/vendor/rocksdb/db/db_iter_test.cc +3195 -0
- package/vendor/rocksdb/db/db_iterator_test.cc +3304 -0
- package/vendor/rocksdb/db/db_kv_checksum_test.cc +885 -0
- package/vendor/rocksdb/db/db_log_iter_test.cc +297 -0
- package/vendor/rocksdb/db/db_logical_block_size_cache_test.cc +505 -0
- package/vendor/rocksdb/db/db_memtable_test.cc +344 -0
- package/vendor/rocksdb/db/db_merge_operand_test.cc +488 -0
- package/vendor/rocksdb/db/db_merge_operator_test.cc +866 -0
- package/vendor/rocksdb/db/db_options_test.cc +1330 -0
- package/vendor/rocksdb/db/db_properties_test.cc +2377 -0
- package/vendor/rocksdb/db/db_range_del_test.cc +3414 -0
- package/vendor/rocksdb/db/db_rate_limiter_test.cc +437 -0
- package/vendor/rocksdb/db/db_readonly_with_timestamp_test.cc +956 -0
- package/vendor/rocksdb/db/db_secondary_test.cc +1691 -0
- package/vendor/rocksdb/db/db_sst_test.cc +1865 -0
- package/vendor/rocksdb/db/db_statistics_test.cc +292 -0
- package/vendor/rocksdb/db/db_table_properties_test.cc +623 -0
- package/vendor/rocksdb/db/db_tailing_iter_test.cc +595 -0
- package/vendor/rocksdb/db/db_test.cc +7359 -0
- package/vendor/rocksdb/db/db_test2.cc +7679 -0
- package/vendor/rocksdb/db/db_test_util.cc +1759 -0
- package/vendor/rocksdb/db/db_test_util.h +1340 -0
- package/vendor/rocksdb/db/db_universal_compaction_test.cc +2227 -0
- package/vendor/rocksdb/db/db_wal_test.cc +2433 -0
- package/vendor/rocksdb/db/db_with_timestamp_basic_test.cc +4016 -0
- package/vendor/rocksdb/db/db_with_timestamp_compaction_test.cc +353 -0
- package/vendor/rocksdb/db/db_with_timestamp_test_util.cc +96 -0
- package/vendor/rocksdb/db/db_with_timestamp_test_util.h +126 -0
- package/vendor/rocksdb/db/db_write_buffer_manager_test.cc +927 -0
- package/vendor/rocksdb/db/db_write_test.cc +795 -0
- package/vendor/rocksdb/db/dbformat.cc +213 -0
- package/vendor/rocksdb/db/dbformat.h +869 -0
- package/vendor/rocksdb/db/dbformat_test.cc +214 -0
- package/vendor/rocksdb/db/deletefile_test.cc +603 -0
- package/vendor/rocksdb/db/error_handler.cc +792 -0
- package/vendor/rocksdb/db/error_handler.h +124 -0
- package/vendor/rocksdb/db/error_handler_fs_test.cc +2862 -0
- package/vendor/rocksdb/db/event_helpers.cc +323 -0
- package/vendor/rocksdb/db/event_helpers.h +78 -0
- package/vendor/rocksdb/db/experimental.cc +144 -0
- package/vendor/rocksdb/db/external_sst_file_basic_test.cc +2084 -0
- package/vendor/rocksdb/db/external_sst_file_ingestion_job.cc +1104 -0
- package/vendor/rocksdb/db/external_sst_file_ingestion_job.h +238 -0
- package/vendor/rocksdb/db/external_sst_file_test.cc +2859 -0
- package/vendor/rocksdb/db/fault_injection_test.cc +637 -0
- package/vendor/rocksdb/db/file_indexer.cc +218 -0
- package/vendor/rocksdb/db/file_indexer.h +140 -0
- package/vendor/rocksdb/db/file_indexer_test.cc +352 -0
- package/vendor/rocksdb/db/filename_test.cc +241 -0
- package/vendor/rocksdb/db/flush_job.cc +1097 -0
- package/vendor/rocksdb/db/flush_job.h +200 -0
- package/vendor/rocksdb/db/flush_job_test.cc +743 -0
- package/vendor/rocksdb/db/flush_scheduler.cc +86 -0
- package/vendor/rocksdb/db/flush_scheduler.h +55 -0
- package/vendor/rocksdb/db/forward_iterator.cc +1070 -0
- package/vendor/rocksdb/db/forward_iterator.h +166 -0
- package/vendor/rocksdb/db/forward_iterator_bench.cc +378 -0
- package/vendor/rocksdb/db/history_trimming_iterator.h +95 -0
- package/vendor/rocksdb/db/import_column_family_job.cc +364 -0
- package/vendor/rocksdb/db/import_column_family_job.h +82 -0
- package/vendor/rocksdb/db/import_column_family_test.cc +748 -0
- package/vendor/rocksdb/db/internal_stats.cc +2121 -0
- package/vendor/rocksdb/db/internal_stats.h +875 -0
- package/vendor/rocksdb/db/job_context.h +237 -0
- package/vendor/rocksdb/db/kv_checksum.h +484 -0
- package/vendor/rocksdb/db/listener_test.cc +1598 -0
- package/vendor/rocksdb/db/log_format.h +55 -0
- package/vendor/rocksdb/db/log_reader.cc +934 -0
- package/vendor/rocksdb/db/log_reader.h +241 -0
- package/vendor/rocksdb/db/log_test.cc +1216 -0
- package/vendor/rocksdb/db/log_writer.cc +279 -0
- package/vendor/rocksdb/db/log_writer.h +144 -0
- package/vendor/rocksdb/db/logs_with_prep_tracker.cc +67 -0
- package/vendor/rocksdb/db/logs_with_prep_tracker.h +62 -0
- package/vendor/rocksdb/db/lookup_key.h +68 -0
- package/vendor/rocksdb/db/malloc_stats.cc +53 -0
- package/vendor/rocksdb/db/malloc_stats.h +22 -0
- package/vendor/rocksdb/db/manual_compaction_test.cc +308 -0
- package/vendor/rocksdb/db/memtable.cc +1675 -0
- package/vendor/rocksdb/db/memtable.h +660 -0
- package/vendor/rocksdb/db/memtable_list.cc +987 -0
- package/vendor/rocksdb/db/memtable_list.h +471 -0
- package/vendor/rocksdb/db/memtable_list_test.cc +1037 -0
- package/vendor/rocksdb/db/merge_context.h +147 -0
- package/vendor/rocksdb/db/merge_helper.cc +606 -0
- package/vendor/rocksdb/db/merge_helper.h +224 -0
- package/vendor/rocksdb/db/merge_helper_test.cc +298 -0
- package/vendor/rocksdb/db/merge_operator.cc +85 -0
- package/vendor/rocksdb/db/merge_test.cc +621 -0
- package/vendor/rocksdb/db/obsolete_files_test.cc +317 -0
- package/vendor/rocksdb/db/options_file_test.cc +110 -0
- package/vendor/rocksdb/db/output_validator.cc +33 -0
- package/vendor/rocksdb/db/output_validator.h +48 -0
- package/vendor/rocksdb/db/perf_context_test.cc +1158 -0
- package/vendor/rocksdb/db/periodic_task_scheduler.cc +111 -0
- package/vendor/rocksdb/db/periodic_task_scheduler.h +108 -0
- package/vendor/rocksdb/db/periodic_task_scheduler_test.cc +229 -0
- package/vendor/rocksdb/db/pinned_iterators_manager.h +92 -0
- package/vendor/rocksdb/db/plain_table_db_test.cc +1348 -0
- package/vendor/rocksdb/db/post_memtable_callback.h +25 -0
- package/vendor/rocksdb/db/pre_release_callback.h +37 -0
- package/vendor/rocksdb/db/prefix_test.cc +894 -0
- package/vendor/rocksdb/db/range_del_aggregator.cc +555 -0
- package/vendor/rocksdb/db/range_del_aggregator.h +478 -0
- package/vendor/rocksdb/db/range_del_aggregator_bench.cc +280 -0
- package/vendor/rocksdb/db/range_del_aggregator_test.cc +713 -0
- package/vendor/rocksdb/db/range_tombstone_fragmenter.cc +502 -0
- package/vendor/rocksdb/db/range_tombstone_fragmenter.h +356 -0
- package/vendor/rocksdb/db/range_tombstone_fragmenter_test.cc +555 -0
- package/vendor/rocksdb/db/read_callback.h +54 -0
- package/vendor/rocksdb/db/repair.cc +839 -0
- package/vendor/rocksdb/db/repair_test.cc +484 -0
- package/vendor/rocksdb/db/seqno_time_test.cc +994 -0
- package/vendor/rocksdb/db/seqno_to_time_mapping.cc +341 -0
- package/vendor/rocksdb/db/seqno_to_time_mapping.h +189 -0
- package/vendor/rocksdb/db/snapshot_checker.h +58 -0
- package/vendor/rocksdb/db/snapshot_impl.cc +25 -0
- package/vendor/rocksdb/db/snapshot_impl.h +239 -0
- package/vendor/rocksdb/db/table_cache.cc +710 -0
- package/vendor/rocksdb/db/table_cache.h +283 -0
- package/vendor/rocksdb/db/table_cache_sync_and_async.h +130 -0
- package/vendor/rocksdb/db/table_properties_collector.cc +74 -0
- package/vendor/rocksdb/db/table_properties_collector.h +177 -0
- package/vendor/rocksdb/db/table_properties_collector_test.cc +512 -0
- package/vendor/rocksdb/db/transaction_log_impl.cc +296 -0
- package/vendor/rocksdb/db/transaction_log_impl.h +128 -0
- package/vendor/rocksdb/db/trim_history_scheduler.cc +54 -0
- package/vendor/rocksdb/db/trim_history_scheduler.h +46 -0
- package/vendor/rocksdb/db/version_builder.cc +1426 -0
- package/vendor/rocksdb/db/version_builder.h +93 -0
- package/vendor/rocksdb/db/version_builder_test.cc +1840 -0
- package/vendor/rocksdb/db/version_edit.cc +1059 -0
- package/vendor/rocksdb/db/version_edit.h +702 -0
- package/vendor/rocksdb/db/version_edit_handler.cc +1017 -0
- package/vendor/rocksdb/db/version_edit_handler.h +334 -0
- package/vendor/rocksdb/db/version_edit_test.cc +732 -0
- package/vendor/rocksdb/db/version_set.cc +7286 -0
- package/vendor/rocksdb/db/version_set.h +1714 -0
- package/vendor/rocksdb/db/version_set_sync_and_async.h +172 -0
- package/vendor/rocksdb/db/version_set_test.cc +3659 -0
- package/vendor/rocksdb/db/version_util.h +72 -0
- package/vendor/rocksdb/db/wal_edit.cc +211 -0
- package/vendor/rocksdb/db/wal_edit.h +177 -0
- package/vendor/rocksdb/db/wal_edit_test.cc +213 -0
- package/vendor/rocksdb/db/wal_manager.cc +527 -0
- package/vendor/rocksdb/db/wal_manager.h +136 -0
- package/vendor/rocksdb/db/wal_manager_test.cc +336 -0
- package/vendor/rocksdb/db/wide/db_wide_basic_test.cc +1042 -0
- package/vendor/rocksdb/db/wide/wide_column_serialization.cc +182 -0
- package/vendor/rocksdb/db/wide/wide_column_serialization.h +77 -0
- package/vendor/rocksdb/db/wide/wide_column_serialization_test.cc +338 -0
- package/vendor/rocksdb/db/wide/wide_columns.cc +22 -0
- package/vendor/rocksdb/db/write_batch.cc +3142 -0
- package/vendor/rocksdb/db/write_batch_base.cc +94 -0
- package/vendor/rocksdb/db/write_batch_internal.h +401 -0
- package/vendor/rocksdb/db/write_batch_test.cc +1112 -0
- package/vendor/rocksdb/db/write_callback.h +27 -0
- package/vendor/rocksdb/db/write_callback_test.cc +454 -0
- package/vendor/rocksdb/db/write_controller.cc +121 -0
- package/vendor/rocksdb/db/write_controller.h +148 -0
- package/vendor/rocksdb/db/write_controller_test.cc +248 -0
- package/vendor/rocksdb/db/write_stall_stats.cc +179 -0
- package/vendor/rocksdb/db/write_stall_stats.h +47 -0
- package/vendor/rocksdb/db/write_thread.cc +844 -0
- package/vendor/rocksdb/db/write_thread.h +464 -0
- package/vendor/rocksdb/db_stress_tool/CMakeLists.txt +18 -0
- package/vendor/rocksdb/db_stress_tool/batched_ops_stress.cc +593 -0
- package/vendor/rocksdb/db_stress_tool/cf_consistency_stress.cc +892 -0
- package/vendor/rocksdb/db_stress_tool/db_stress.cc +25 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_common.cc +491 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_common.h +674 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_compaction_filter.h +96 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_driver.cc +216 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_driver.h +18 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_env_wrapper.h +78 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_gflags.cc +1094 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_listener.cc +189 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_listener.h +269 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_shared_state.cc +17 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_shared_state.h +437 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_stat.cc +17 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_stat.h +219 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_table_properties_collector.h +65 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_test_base.cc +3294 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_test_base.h +327 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_tool.cc +371 -0
- package/vendor/rocksdb/db_stress_tool/expected_state.cc +780 -0
- package/vendor/rocksdb/db_stress_tool/expected_state.h +329 -0
- package/vendor/rocksdb/db_stress_tool/expected_value.cc +122 -0
- package/vendor/rocksdb/db_stress_tool/expected_value.h +206 -0
- package/vendor/rocksdb/db_stress_tool/multi_ops_txns_stress.cc +1761 -0
- package/vendor/rocksdb/db_stress_tool/multi_ops_txns_stress.h +446 -0
- package/vendor/rocksdb/db_stress_tool/no_batched_ops_stress.cc +1906 -0
- package/vendor/rocksdb/docs/CNAME +1 -0
- package/vendor/rocksdb/docs/CONTRIBUTING.md +115 -0
- package/vendor/rocksdb/docs/Gemfile +4 -0
- package/vendor/rocksdb/docs/LICENSE-DOCUMENTATION +385 -0
- package/vendor/rocksdb/docs/README.md +80 -0
- package/vendor/rocksdb/docs/TEMPLATE-INFORMATION.md +17 -0
- package/vendor/rocksdb/docs/_config.yml +85 -0
- package/vendor/rocksdb/docs/_data/authors.yml +81 -0
- package/vendor/rocksdb/docs/_data/features.yml +19 -0
- package/vendor/rocksdb/docs/_data/nav.yml +30 -0
- package/vendor/rocksdb/docs/_data/nav_docs.yml +3 -0
- package/vendor/rocksdb/docs/_data/powered_by.yml +1 -0
- package/vendor/rocksdb/docs/_data/powered_by_highlight.yml +1 -0
- package/vendor/rocksdb/docs/_data/promo.yml +6 -0
- package/vendor/rocksdb/docs/_docs/faq.md +48 -0
- package/vendor/rocksdb/docs/_docs/getting-started.md +78 -0
- package/vendor/rocksdb/docs/_includes/blog_pagination.html +28 -0
- package/vendor/rocksdb/docs/_includes/content/gridblocks.html +5 -0
- package/vendor/rocksdb/docs/_includes/content/items/gridblock.html +37 -0
- package/vendor/rocksdb/docs/_includes/doc.html +25 -0
- package/vendor/rocksdb/docs/_includes/doc_paging.html +0 -0
- package/vendor/rocksdb/docs/_includes/footer.html +34 -0
- package/vendor/rocksdb/docs/_includes/head.html +23 -0
- package/vendor/rocksdb/docs/_includes/header.html +19 -0
- package/vendor/rocksdb/docs/_includes/hero.html +0 -0
- package/vendor/rocksdb/docs/_includes/home_header.html +22 -0
- package/vendor/rocksdb/docs/_includes/katex_import.html +3 -0
- package/vendor/rocksdb/docs/_includes/katex_render.html +210 -0
- package/vendor/rocksdb/docs/_includes/nav/collection_nav.html +64 -0
- package/vendor/rocksdb/docs/_includes/nav/collection_nav_group.html +19 -0
- package/vendor/rocksdb/docs/_includes/nav/collection_nav_group_item.html +1 -0
- package/vendor/rocksdb/docs/_includes/nav/header_nav.html +30 -0
- package/vendor/rocksdb/docs/_includes/nav.html +37 -0
- package/vendor/rocksdb/docs/_includes/nav_search.html +15 -0
- package/vendor/rocksdb/docs/_includes/plugins/all_share.html +3 -0
- package/vendor/rocksdb/docs/_includes/plugins/ascii_cinema.html +2 -0
- package/vendor/rocksdb/docs/_includes/plugins/button.html +6 -0
- package/vendor/rocksdb/docs/_includes/plugins/github_star.html +4 -0
- package/vendor/rocksdb/docs/_includes/plugins/github_watch.html +4 -0
- package/vendor/rocksdb/docs/_includes/plugins/google_share.html +5 -0
- package/vendor/rocksdb/docs/_includes/plugins/iframe.html +6 -0
- package/vendor/rocksdb/docs/_includes/plugins/like_button.html +18 -0
- package/vendor/rocksdb/docs/_includes/plugins/plugin_row.html +5 -0
- package/vendor/rocksdb/docs/_includes/plugins/post_social_plugins.html +41 -0
- package/vendor/rocksdb/docs/_includes/plugins/slideshow.html +88 -0
- package/vendor/rocksdb/docs/_includes/plugins/twitter_follow.html +12 -0
- package/vendor/rocksdb/docs/_includes/plugins/twitter_share.html +11 -0
- package/vendor/rocksdb/docs/_includes/post.html +40 -0
- package/vendor/rocksdb/docs/_includes/powered_by.html +28 -0
- package/vendor/rocksdb/docs/_includes/social_plugins.html +31 -0
- package/vendor/rocksdb/docs/_includes/ui/button.html +1 -0
- package/vendor/rocksdb/docs/_layouts/basic.html +12 -0
- package/vendor/rocksdb/docs/_layouts/blog.html +11 -0
- package/vendor/rocksdb/docs/_layouts/blog_default.html +14 -0
- package/vendor/rocksdb/docs/_layouts/default.html +12 -0
- package/vendor/rocksdb/docs/_layouts/doc_default.html +14 -0
- package/vendor/rocksdb/docs/_layouts/doc_page.html +10 -0
- package/vendor/rocksdb/docs/_layouts/docs.html +5 -0
- package/vendor/rocksdb/docs/_layouts/home.html +26 -0
- package/vendor/rocksdb/docs/_layouts/page.html +3 -0
- package/vendor/rocksdb/docs/_layouts/plain.html +10 -0
- package/vendor/rocksdb/docs/_layouts/post.html +8 -0
- package/vendor/rocksdb/docs/_layouts/redirect.html +6 -0
- package/vendor/rocksdb/docs/_layouts/top-level.html +10 -0
- package/vendor/rocksdb/docs/_posts/2014-03-27-how-to-backup-rocksdb.markdown +135 -0
- package/vendor/rocksdb/docs/_posts/2014-03-27-how-to-persist-in-memory-rocksdb-database.markdown +54 -0
- package/vendor/rocksdb/docs/_posts/2014-04-02-the-1st-rocksdb-local-meetup-held-on-march-27-2014.markdown +53 -0
- package/vendor/rocksdb/docs/_posts/2014-04-07-rocksdb-2-8-release.markdown +40 -0
- package/vendor/rocksdb/docs/_posts/2014-04-21-indexing-sst-files-for-better-lookup-performance.markdown +28 -0
- package/vendor/rocksdb/docs/_posts/2014-05-14-lock.markdown +88 -0
- package/vendor/rocksdb/docs/_posts/2014-05-19-rocksdb-3-0-release.markdown +24 -0
- package/vendor/rocksdb/docs/_posts/2014-05-22-rocksdb-3-1-release.markdown +20 -0
- package/vendor/rocksdb/docs/_posts/2014-06-23-plaintable-a-new-file-format.markdown +47 -0
- package/vendor/rocksdb/docs/_posts/2014-06-27-avoid-expensive-locks-in-get.markdown +89 -0
- package/vendor/rocksdb/docs/_posts/2014-06-27-rocksdb-3-2-release.markdown +30 -0
- package/vendor/rocksdb/docs/_posts/2014-07-29-rocksdb-3-3-release.markdown +34 -0
- package/vendor/rocksdb/docs/_posts/2014-09-12-cuckoo.markdown +74 -0
- package/vendor/rocksdb/docs/_posts/2014-09-12-new-bloom-filter-format.markdown +52 -0
- package/vendor/rocksdb/docs/_posts/2014-09-15-rocksdb-3-5-release.markdown +38 -0
- package/vendor/rocksdb/docs/_posts/2015-01-16-migrating-from-leveldb-to-rocksdb-2.markdown +112 -0
- package/vendor/rocksdb/docs/_posts/2015-02-24-reading-rocksdb-options-from-a-file.markdown +41 -0
- package/vendor/rocksdb/docs/_posts/2015-02-27-write-batch-with-index.markdown +20 -0
- package/vendor/rocksdb/docs/_posts/2015-04-22-integrating-rocksdb-with-mongodb-2.markdown +16 -0
- package/vendor/rocksdb/docs/_posts/2015-06-12-rocksdb-in-osquery.markdown +10 -0
- package/vendor/rocksdb/docs/_posts/2015-07-15-rocksdb-2015-h2-roadmap.markdown +92 -0
- package/vendor/rocksdb/docs/_posts/2015-07-17-spatial-indexing-in-rocksdb.markdown +78 -0
- package/vendor/rocksdb/docs/_posts/2015-07-22-rocksdb-is-now-available-in-windows-platform.markdown +30 -0
- package/vendor/rocksdb/docs/_posts/2015-07-23-dynamic-level.markdown +29 -0
- package/vendor/rocksdb/docs/_posts/2015-10-27-getthreadlist.markdown +193 -0
- package/vendor/rocksdb/docs/_posts/2015-11-10-use-checkpoints-for-efficient-snapshots.markdown +45 -0
- package/vendor/rocksdb/docs/_posts/2015-11-16-analysis-file-read-latency-by-level.markdown +244 -0
- package/vendor/rocksdb/docs/_posts/2016-01-29-compaction_pri.markdown +51 -0
- package/vendor/rocksdb/docs/_posts/2016-02-24-rocksdb-4-2-release.markdown +41 -0
- package/vendor/rocksdb/docs/_posts/2016-02-25-rocksdb-ama.markdown +20 -0
- package/vendor/rocksdb/docs/_posts/2016-03-07-rocksdb-options-file.markdown +24 -0
- package/vendor/rocksdb/docs/_posts/2016-04-26-rocksdb-4-5-1-released.markdown +60 -0
- package/vendor/rocksdb/docs/_posts/2016-07-26-rocksdb-4-8-released.markdown +48 -0
- package/vendor/rocksdb/docs/_posts/2016-09-28-rocksdb-4-11-2-released.markdown +49 -0
- package/vendor/rocksdb/docs/_posts/2017-01-06-rocksdb-5-0-1-released.markdown +26 -0
- package/vendor/rocksdb/docs/_posts/2017-02-07-rocksdb-5-1-2-released.markdown +15 -0
- package/vendor/rocksdb/docs/_posts/2017-02-17-bulkoad-ingest-sst-file.markdown +50 -0
- package/vendor/rocksdb/docs/_posts/2017-03-02-rocksdb-5-2-1-released.markdown +22 -0
- package/vendor/rocksdb/docs/_posts/2017-05-12-partitioned-index-filter.markdown +34 -0
- package/vendor/rocksdb/docs/_posts/2017-05-14-core-local-stats.markdown +106 -0
- package/vendor/rocksdb/docs/_posts/2017-05-26-rocksdb-5-4-5-released.markdown +39 -0
- package/vendor/rocksdb/docs/_posts/2017-06-26-17-level-based-changes.markdown +60 -0
- package/vendor/rocksdb/docs/_posts/2017-06-29-rocksdb-5-5-1-released.markdown +22 -0
- package/vendor/rocksdb/docs/_posts/2017-07-25-rocksdb-5-6-1-released.markdown +22 -0
- package/vendor/rocksdb/docs/_posts/2017-08-24-pinnableslice.markdown +37 -0
- package/vendor/rocksdb/docs/_posts/2017-08-25-flushwal.markdown +26 -0
- package/vendor/rocksdb/docs/_posts/2017-09-28-rocksdb-5-8-released.markdown +25 -0
- package/vendor/rocksdb/docs/_posts/2017-12-18-17-auto-tuned-rate-limiter.markdown +28 -0
- package/vendor/rocksdb/docs/_posts/2017-12-19-write-prepared-txn.markdown +41 -0
- package/vendor/rocksdb/docs/_posts/2018-02-05-rocksdb-5-10-2-released.markdown +22 -0
- package/vendor/rocksdb/docs/_posts/2018-08-01-rocksdb-tuning-advisor.markdown +58 -0
- package/vendor/rocksdb/docs/_posts/2018-08-23-data-block-hash-index.markdown +118 -0
- package/vendor/rocksdb/docs/_posts/2018-11-21-delete-range.markdown +292 -0
- package/vendor/rocksdb/docs/_posts/2019-03-08-format-version-4.markdown +36 -0
- package/vendor/rocksdb/docs/_posts/2019-08-15-unordered-write.markdown +56 -0
- package/vendor/rocksdb/docs/_posts/2021-04-12-universal-improvements.markdown +46 -0
- package/vendor/rocksdb/docs/_posts/2021-05-26-integrated-blob-db.markdown +101 -0
- package/vendor/rocksdb/docs/_posts/2021-05-26-online-validation.markdown +17 -0
- package/vendor/rocksdb/docs/_posts/2021-05-27-rocksdb-secondary-cache.markdown +195 -0
- package/vendor/rocksdb/docs/_posts/2021-05-31-dictionary-compression.markdown +157 -0
- package/vendor/rocksdb/docs/_posts/2021-12-29-ribbon-filter.markdown +281 -0
- package/vendor/rocksdb/docs/_posts/2022-07-18-per-key-value-checksum.markdown +142 -0
- package/vendor/rocksdb/docs/_posts/2022-10-05-lost-buffered-write-recovery.markdown +123 -0
- package/vendor/rocksdb/docs/_posts/2022-10-07-asynchronous-io-in-rocksdb.markdown +133 -0
- package/vendor/rocksdb/docs/_posts/2022-10-31-align-compaction-output-file.markdown +107 -0
- package/vendor/rocksdb/docs/_posts/2022-11-09-time-aware-tiered-storage.markdown +121 -0
- package/vendor/rocksdb/docs/_sass/_base.scss +492 -0
- package/vendor/rocksdb/docs/_sass/_blog.scss +47 -0
- package/vendor/rocksdb/docs/_sass/_buttons.scss +47 -0
- package/vendor/rocksdb/docs/_sass/_footer.scss +82 -0
- package/vendor/rocksdb/docs/_sass/_gridBlock.scss +115 -0
- package/vendor/rocksdb/docs/_sass/_header.scss +139 -0
- package/vendor/rocksdb/docs/_sass/_poweredby.scss +69 -0
- package/vendor/rocksdb/docs/_sass/_promo.scss +55 -0
- package/vendor/rocksdb/docs/_sass/_react_docs_nav.scss +332 -0
- package/vendor/rocksdb/docs/_sass/_react_header_nav.scss +141 -0
- package/vendor/rocksdb/docs/_sass/_reset.scss +43 -0
- package/vendor/rocksdb/docs/_sass/_search.scss +142 -0
- package/vendor/rocksdb/docs/_sass/_slideshow.scss +48 -0
- package/vendor/rocksdb/docs/_sass/_syntax-highlighting.scss +129 -0
- package/vendor/rocksdb/docs/_sass/_tables.scss +47 -0
- package/vendor/rocksdb/docs/_top-level/support.md +22 -0
- package/vendor/rocksdb/docs/blog/all.html +20 -0
- package/vendor/rocksdb/docs/blog/index.html +12 -0
- package/vendor/rocksdb/docs/css/main.scss +159 -0
- package/vendor/rocksdb/docs/doc-type-examples/2016-04-07-blog-post-example.md +21 -0
- package/vendor/rocksdb/docs/doc-type-examples/docs-hello-world.md +12 -0
- package/vendor/rocksdb/docs/doc-type-examples/top-level-example.md +8 -0
- package/vendor/rocksdb/docs/docs/index.html +6 -0
- package/vendor/rocksdb/docs/feed.xml +30 -0
- package/vendor/rocksdb/docs/index.md +9 -0
- package/vendor/rocksdb/docs/static/favicon.png +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Black.woff +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Black.woff2 +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-BlackItalic.woff +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-BlackItalic.woff2 +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Italic.woff +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Italic.woff2 +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Light.woff +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Light.woff2 +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Regular.woff +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Regular.woff2 +0 -0
- package/vendor/rocksdb/docs/static/images/Resize-of-20140327_200754-300x225.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/compaction_output_file_size_compare.png +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/file_cut_align.png +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/file_cut_normal.png +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/file_cut_trival_move.png +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/file_size_compare.png +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/write_amp_compare.png +0 -0
- package/vendor/rocksdb/docs/static/images/asynchronous-io/mget_async.png +0 -0
- package/vendor/rocksdb/docs/static/images/asynchronous-io/scan_async.png +0 -0
- package/vendor/rocksdb/docs/static/images/binaryseek.png +0 -0
- package/vendor/rocksdb/docs/static/images/bloom_fp_vs_bpk.png +0 -0
- package/vendor/rocksdb/docs/static/images/compaction/full-range.png +0 -0
- package/vendor/rocksdb/docs/static/images/compaction/l0-l1-contend.png +0 -0
- package/vendor/rocksdb/docs/static/images/compaction/l1-l2-contend.png +0 -0
- package/vendor/rocksdb/docs/static/images/compaction/part-range-old.png +0 -0
- package/vendor/rocksdb/docs/static/images/data-block-hash-index/block-format-binary-seek.png +0 -0
- package/vendor/rocksdb/docs/static/images/data-block-hash-index/block-format-hash-index.png +0 -0
- package/vendor/rocksdb/docs/static/images/data-block-hash-index/hash-index-data-structure.png +0 -0
- package/vendor/rocksdb/docs/static/images/data-block-hash-index/perf-cache-miss.png +0 -0
- package/vendor/rocksdb/docs/static/images/data-block-hash-index/perf-throughput.png +0 -0
- package/vendor/rocksdb/docs/static/images/delrange/delrange_collapsed.png +0 -0
- package/vendor/rocksdb/docs/static/images/delrange/delrange_key_schema.png +0 -0
- package/vendor/rocksdb/docs/static/images/delrange/delrange_sst_blocks.png +0 -0
- package/vendor/rocksdb/docs/static/images/delrange/delrange_uncollapsed.png +0 -0
- package/vendor/rocksdb/docs/static/images/delrange/delrange_write_path.png +0 -0
- package/vendor/rocksdb/docs/static/images/dictcmp/dictcmp_raw_sampled.png +0 -0
- package/vendor/rocksdb/docs/static/images/dictcmp/dictcmp_sst_blocks.png +0 -0
- package/vendor/rocksdb/docs/static/images/dictcmp/dictcmp_zstd_trained.png +0 -0
- package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Legacy_Vs_Integrated.png +0 -0
- package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_RW_RO_Perf.png +0 -0
- package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Write_Amp.png +0 -0
- package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Write_Perf.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/Memtable-entry.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/Memtable-write.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/ProtInfo-Memtable.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/ProtInfo-Writebatch-to-Memtable.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/ProtInfo-Writebatch.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/WAL-fragment.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/WAL-read.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/WAL-write.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/Write-batch.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/Writebatch-write.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/angry-cat.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/basic-setup.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/happy-cat.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/replay-extension.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/test-fs-writable-file.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/trace-extension.png +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-blockindex.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-fileindex.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-filelayout.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-readiopath.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-tieredstorage.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-writeiopath.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/promo-adapt.svg +8 -0
- package/vendor/rocksdb/docs/static/images/promo-flash.svg +28 -0
- package/vendor/rocksdb/docs/static/images/promo-operations.svg +6 -0
- package/vendor/rocksdb/docs/static/images/promo-performance.svg +134 -0
- package/vendor/rocksdb/docs/static/images/rate-limiter/auto-tuned-write-KBps-series.png +0 -0
- package/vendor/rocksdb/docs/static/images/rate-limiter/write-KBps-cdf.png +0 -0
- package/vendor/rocksdb/docs/static/images/rate-limiter/write-KBps-series.png +0 -0
- package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/Mixgraph_hit_rate.png +0 -0
- package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/Mixgraph_throughput.png +0 -0
- package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/arch_diagram.png +0 -0
- package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/insert_flow.png +0 -0
- package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/lookup_flow.png +0 -0
- package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/compaction_moving_up_conflict.png +0 -0
- package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/per_key_placement_compaction.png +0 -0
- package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/tiered_storage_design.png +0 -0
- package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/tiered_storage_overview.png +0 -0
- package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/tiered_storage_problem.png +0 -0
- package/vendor/rocksdb/docs/static/images/tree_example1.png +0 -0
- package/vendor/rocksdb/docs/static/logo.svg +76 -0
- package/vendor/rocksdb/docs/static/og_image.png +0 -0
- package/vendor/rocksdb/env/composite_env.cc +534 -0
- package/vendor/rocksdb/env/composite_env_wrapper.h +378 -0
- package/vendor/rocksdb/env/emulated_clock.h +114 -0
- package/vendor/rocksdb/env/env.cc +1233 -0
- package/vendor/rocksdb/env/env_basic_test.cc +397 -0
- package/vendor/rocksdb/env/env_chroot.cc +148 -0
- package/vendor/rocksdb/env/env_chroot.h +55 -0
- package/vendor/rocksdb/env/env_encryption.cc +1346 -0
- package/vendor/rocksdb/env/env_encryption_ctr.h +114 -0
- package/vendor/rocksdb/env/env_posix.cc +524 -0
- package/vendor/rocksdb/env/env_test.cc +3577 -0
- package/vendor/rocksdb/env/file_system.cc +277 -0
- package/vendor/rocksdb/env/file_system_tracer.cc +564 -0
- package/vendor/rocksdb/env/file_system_tracer.h +461 -0
- package/vendor/rocksdb/env/fs_posix.cc +1284 -0
- package/vendor/rocksdb/env/fs_readonly.h +105 -0
- package/vendor/rocksdb/env/fs_remap.cc +341 -0
- package/vendor/rocksdb/env/fs_remap.h +137 -0
- package/vendor/rocksdb/env/io_posix.cc +1733 -0
- package/vendor/rocksdb/env/io_posix.h +523 -0
- package/vendor/rocksdb/env/io_posix_test.cc +141 -0
- package/vendor/rocksdb/env/mock_env.cc +1058 -0
- package/vendor/rocksdb/env/mock_env.h +144 -0
- package/vendor/rocksdb/env/mock_env_test.cc +84 -0
- package/vendor/rocksdb/env/unique_id_gen.cc +164 -0
- package/vendor/rocksdb/env/unique_id_gen.h +85 -0
- package/vendor/rocksdb/examples/CMakeLists.txt +45 -0
- package/vendor/rocksdb/examples/Makefile +58 -0
- package/vendor/rocksdb/examples/README.md +2 -0
- package/vendor/rocksdb/examples/c_simple_example.c +96 -0
- package/vendor/rocksdb/examples/column_families_example.cc +88 -0
- package/vendor/rocksdb/examples/compact_files_example.cc +177 -0
- package/vendor/rocksdb/examples/compaction_filter_example.cc +96 -0
- package/vendor/rocksdb/examples/multi_processes_example.cc +393 -0
- package/vendor/rocksdb/examples/optimistic_transaction_example.cc +190 -0
- package/vendor/rocksdb/examples/options_file_example.cc +132 -0
- package/vendor/rocksdb/examples/rocksdb_backup_restore_example.cc +99 -0
- package/vendor/rocksdb/examples/rocksdb_option_file_example.ini +142 -0
- package/vendor/rocksdb/examples/simple_example.cc +93 -0
- package/vendor/rocksdb/examples/transaction_example.cc +196 -0
- package/vendor/rocksdb/file/delete_scheduler.cc +409 -0
- package/vendor/rocksdb/file/delete_scheduler.h +147 -0
- package/vendor/rocksdb/file/delete_scheduler_test.cc +717 -0
- package/vendor/rocksdb/file/file_prefetch_buffer.cc +955 -0
- package/vendor/rocksdb/file/file_prefetch_buffer.h +471 -0
- package/vendor/rocksdb/file/file_util.cc +277 -0
- package/vendor/rocksdb/file/file_util.h +91 -0
- package/vendor/rocksdb/file/filename.cc +523 -0
- package/vendor/rocksdb/file/filename.h +188 -0
- package/vendor/rocksdb/file/line_file_reader.cc +73 -0
- package/vendor/rocksdb/file/line_file_reader.h +60 -0
- package/vendor/rocksdb/file/prefetch_test.cc +2374 -0
- package/vendor/rocksdb/file/random_access_file_reader.cc +599 -0
- package/vendor/rocksdb/file/random_access_file_reader.h +210 -0
- package/vendor/rocksdb/file/random_access_file_reader_test.cc +479 -0
- package/vendor/rocksdb/file/read_write_util.cc +33 -0
- package/vendor/rocksdb/file/read_write_util.h +31 -0
- package/vendor/rocksdb/file/readahead_file_info.h +33 -0
- package/vendor/rocksdb/file/readahead_raf.cc +169 -0
- package/vendor/rocksdb/file/readahead_raf.h +29 -0
- package/vendor/rocksdb/file/sequence_file_reader.cc +320 -0
- package/vendor/rocksdb/file/sequence_file_reader.h +119 -0
- package/vendor/rocksdb/file/sst_file_manager_impl.cc +507 -0
- package/vendor/rocksdb/file/sst_file_manager_impl.h +193 -0
- package/vendor/rocksdb/file/writable_file_writer.cc +989 -0
- package/vendor/rocksdb/file/writable_file_writer.h +320 -0
- package/vendor/rocksdb/fuzz/Makefile +67 -0
- package/vendor/rocksdb/fuzz/README.md +165 -0
- package/vendor/rocksdb/fuzz/db_fuzzer.cc +172 -0
- package/vendor/rocksdb/fuzz/db_map_fuzzer.cc +107 -0
- package/vendor/rocksdb/fuzz/proto/db_operation.proto +28 -0
- package/vendor/rocksdb/fuzz/sst_file_writer_fuzzer.cc +210 -0
- package/vendor/rocksdb/fuzz/util.h +29 -0
- package/vendor/rocksdb/include/rocksdb/advanced_cache.h +623 -0
- package/vendor/rocksdb/include/rocksdb/advanced_options.h +1177 -0
- package/vendor/rocksdb/include/rocksdb/block_cache_trace_writer.h +149 -0
- package/vendor/rocksdb/include/rocksdb/c.h +2864 -0
- package/vendor/rocksdb/include/rocksdb/cache.h +442 -0
- package/vendor/rocksdb/include/rocksdb/cache_bench_tool.h +14 -0
- package/vendor/rocksdb/include/rocksdb/cleanable.h +128 -0
- package/vendor/rocksdb/include/rocksdb/compaction_filter.h +363 -0
- package/vendor/rocksdb/include/rocksdb/compaction_job_stats.h +109 -0
- package/vendor/rocksdb/include/rocksdb/comparator.h +164 -0
- package/vendor/rocksdb/include/rocksdb/compression_type.h +40 -0
- package/vendor/rocksdb/include/rocksdb/concurrent_task_limiter.h +51 -0
- package/vendor/rocksdb/include/rocksdb/configurable.h +390 -0
- package/vendor/rocksdb/include/rocksdb/convenience.h +466 -0
- package/vendor/rocksdb/include/rocksdb/customizable.h +229 -0
- package/vendor/rocksdb/include/rocksdb/data_structure.h +186 -0
- package/vendor/rocksdb/include/rocksdb/db.h +1980 -0
- package/vendor/rocksdb/include/rocksdb/db_bench_tool.h +11 -0
- package/vendor/rocksdb/include/rocksdb/db_dump_tool.h +43 -0
- package/vendor/rocksdb/include/rocksdb/db_stress_tool.h +11 -0
- package/vendor/rocksdb/include/rocksdb/env.h +1882 -0
- package/vendor/rocksdb/include/rocksdb/env_encryption.h +463 -0
- package/vendor/rocksdb/include/rocksdb/experimental.h +56 -0
- package/vendor/rocksdb/include/rocksdb/file_checksum.h +146 -0
- package/vendor/rocksdb/include/rocksdb/file_system.h +1849 -0
- package/vendor/rocksdb/include/rocksdb/filter_policy.h +206 -0
- package/vendor/rocksdb/include/rocksdb/flush_block_policy.h +75 -0
- package/vendor/rocksdb/include/rocksdb/functor_wrapper.h +56 -0
- package/vendor/rocksdb/include/rocksdb/io_status.h +244 -0
- package/vendor/rocksdb/include/rocksdb/iostats_context.h +98 -0
- package/vendor/rocksdb/include/rocksdb/iterator.h +144 -0
- package/vendor/rocksdb/include/rocksdb/ldb_tool.h +42 -0
- package/vendor/rocksdb/include/rocksdb/listener.h +840 -0
- package/vendor/rocksdb/include/rocksdb/memory_allocator.h +87 -0
- package/vendor/rocksdb/include/rocksdb/memtablerep.h +421 -0
- package/vendor/rocksdb/include/rocksdb/merge_operator.h +286 -0
- package/vendor/rocksdb/include/rocksdb/metadata.h +258 -0
- package/vendor/rocksdb/include/rocksdb/options.h +2083 -0
- package/vendor/rocksdb/include/rocksdb/perf_context.h +314 -0
- package/vendor/rocksdb/include/rocksdb/perf_level.h +36 -0
- package/vendor/rocksdb/include/rocksdb/persistent_cache.h +74 -0
- package/vendor/rocksdb/include/rocksdb/port_defs.h +22 -0
- package/vendor/rocksdb/include/rocksdb/rate_limiter.h +159 -0
- package/vendor/rocksdb/include/rocksdb/rocksdb_namespace.h +16 -0
- package/vendor/rocksdb/include/rocksdb/secondary_cache.h +139 -0
- package/vendor/rocksdb/include/rocksdb/slice.h +264 -0
- package/vendor/rocksdb/include/rocksdb/slice_transform.h +135 -0
- package/vendor/rocksdb/include/rocksdb/snapshot.h +53 -0
- package/vendor/rocksdb/include/rocksdb/sst_dump_tool.h +17 -0
- package/vendor/rocksdb/include/rocksdb/sst_file_manager.h +136 -0
- package/vendor/rocksdb/include/rocksdb/sst_file_reader.h +45 -0
- package/vendor/rocksdb/include/rocksdb/sst_file_writer.h +189 -0
- package/vendor/rocksdb/include/rocksdb/sst_partitioner.h +142 -0
- package/vendor/rocksdb/include/rocksdb/statistics.h +757 -0
- package/vendor/rocksdb/include/rocksdb/stats_history.h +70 -0
- package/vendor/rocksdb/include/rocksdb/status.h +574 -0
- package/vendor/rocksdb/include/rocksdb/system_clock.h +114 -0
- package/vendor/rocksdb/include/rocksdb/table.h +927 -0
- package/vendor/rocksdb/include/rocksdb/table_properties.h +332 -0
- package/vendor/rocksdb/include/rocksdb/table_reader_caller.h +41 -0
- package/vendor/rocksdb/include/rocksdb/thread_status.h +190 -0
- package/vendor/rocksdb/include/rocksdb/threadpool.h +67 -0
- package/vendor/rocksdb/include/rocksdb/trace_reader_writer.h +52 -0
- package/vendor/rocksdb/include/rocksdb/trace_record.h +248 -0
- package/vendor/rocksdb/include/rocksdb/trace_record_result.h +187 -0
- package/vendor/rocksdb/include/rocksdb/transaction_log.h +122 -0
- package/vendor/rocksdb/include/rocksdb/types.h +94 -0
- package/vendor/rocksdb/include/rocksdb/unique_id.h +55 -0
- package/vendor/rocksdb/include/rocksdb/universal_compaction.h +96 -0
- package/vendor/rocksdb/include/rocksdb/utilities/agg_merge.h +138 -0
- package/vendor/rocksdb/include/rocksdb/utilities/backup_engine.h +689 -0
- package/vendor/rocksdb/include/rocksdb/utilities/cache_dump_load.h +140 -0
- package/vendor/rocksdb/include/rocksdb/utilities/checkpoint.h +63 -0
- package/vendor/rocksdb/include/rocksdb/utilities/convenience.h +10 -0
- package/vendor/rocksdb/include/rocksdb/utilities/customizable_util.h +322 -0
- package/vendor/rocksdb/include/rocksdb/utilities/db_ttl.h +70 -0
- package/vendor/rocksdb/include/rocksdb/utilities/debug.h +46 -0
- package/vendor/rocksdb/include/rocksdb/utilities/env_mirror.h +179 -0
- package/vendor/rocksdb/include/rocksdb/utilities/info_log_finder.h +19 -0
- package/vendor/rocksdb/include/rocksdb/utilities/ldb_cmd.h +316 -0
- package/vendor/rocksdb/include/rocksdb/utilities/ldb_cmd_execute_result.h +75 -0
- package/vendor/rocksdb/include/rocksdb/utilities/leveldb_options.h +145 -0
- package/vendor/rocksdb/include/rocksdb/utilities/lua/rocks_lua_custom_library.h +43 -0
- package/vendor/rocksdb/include/rocksdb/utilities/lua/rocks_lua_util.h +55 -0
- package/vendor/rocksdb/include/rocksdb/utilities/memory_util.h +48 -0
- package/vendor/rocksdb/include/rocksdb/utilities/object_registry.h +583 -0
- package/vendor/rocksdb/include/rocksdb/utilities/optimistic_transaction_db.h +98 -0
- package/vendor/rocksdb/include/rocksdb/utilities/option_change_migration.h +24 -0
- package/vendor/rocksdb/include/rocksdb/utilities/options_type.h +1221 -0
- package/vendor/rocksdb/include/rocksdb/utilities/options_util.h +105 -0
- package/vendor/rocksdb/include/rocksdb/utilities/replayer.h +85 -0
- package/vendor/rocksdb/include/rocksdb/utilities/sim_cache.h +93 -0
- package/vendor/rocksdb/include/rocksdb/utilities/stackable_db.h +587 -0
- package/vendor/rocksdb/include/rocksdb/utilities/table_properties_collectors.h +88 -0
- package/vendor/rocksdb/include/rocksdb/utilities/transaction.h +683 -0
- package/vendor/rocksdb/include/rocksdb/utilities/transaction_db.h +506 -0
- package/vendor/rocksdb/include/rocksdb/utilities/transaction_db_mutex.h +89 -0
- package/vendor/rocksdb/include/rocksdb/utilities/write_batch_with_index.h +307 -0
- package/vendor/rocksdb/include/rocksdb/version.h +43 -0
- package/vendor/rocksdb/include/rocksdb/wal_filter.h +111 -0
- package/vendor/rocksdb/include/rocksdb/wide_columns.h +210 -0
- package/vendor/rocksdb/include/rocksdb/write_batch.h +494 -0
- package/vendor/rocksdb/include/rocksdb/write_batch_base.h +144 -0
- package/vendor/rocksdb/include/rocksdb/write_buffer_manager.h +183 -0
- package/vendor/rocksdb/issue_template.md +7 -0
- package/vendor/rocksdb/java/CMakeLists.txt +549 -0
- package/vendor/rocksdb/java/GetBenchmarks.md +161 -0
- package/vendor/rocksdb/java/HISTORY-JAVA.md +86 -0
- package/vendor/rocksdb/java/Makefile +453 -0
- package/vendor/rocksdb/java/RELEASE.md +59 -0
- package/vendor/rocksdb/java/benchmark/src/main/java/org/rocksdb/benchmark/DbBenchmark.java +1640 -0
- package/vendor/rocksdb/java/crossbuild/Vagrantfile +51 -0
- package/vendor/rocksdb/java/crossbuild/build-linux-alpine.sh +70 -0
- package/vendor/rocksdb/java/crossbuild/build-linux-centos.sh +38 -0
- package/vendor/rocksdb/java/crossbuild/build-linux.sh +15 -0
- package/vendor/rocksdb/java/crossbuild/docker-build-linux-alpine.sh +17 -0
- package/vendor/rocksdb/java/crossbuild/docker-build-linux-centos.sh +38 -0
- package/vendor/rocksdb/java/jdb_bench.sh +13 -0
- package/vendor/rocksdb/java/jmh/LICENSE-HEADER.txt +5 -0
- package/vendor/rocksdb/java/jmh/README.md +24 -0
- package/vendor/rocksdb/java/jmh/pom.xml +138 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/ComparatorBenchmarks.java +139 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/GetBenchmarks.java +215 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/MultiGetBenchmarks.java +214 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/PutBenchmarks.java +112 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/util/FileUtils.java +59 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/util/KVUtils.java +72 -0
- package/vendor/rocksdb/java/pom.xml.template +178 -0
- package/vendor/rocksdb/java/rocksjni/backup_engine_options.cc +365 -0
- package/vendor/rocksdb/java/rocksjni/backupenginejni.cc +279 -0
- package/vendor/rocksdb/java/rocksjni/cache.cc +34 -0
- package/vendor/rocksdb/java/rocksjni/cassandra_compactionfilterjni.cc +25 -0
- package/vendor/rocksdb/java/rocksjni/cassandra_value_operator.cc +50 -0
- package/vendor/rocksdb/java/rocksjni/checkpoint.cc +71 -0
- package/vendor/rocksdb/java/rocksjni/clock_cache.cc +42 -0
- package/vendor/rocksdb/java/rocksjni/columnfamilyhandle.cc +72 -0
- package/vendor/rocksdb/java/rocksjni/compact_range_options.cc +222 -0
- package/vendor/rocksdb/java/rocksjni/compaction_filter.cc +29 -0
- package/vendor/rocksdb/java/rocksjni/compaction_filter_factory.cc +42 -0
- package/vendor/rocksdb/java/rocksjni/compaction_filter_factory_jnicallback.cc +79 -0
- package/vendor/rocksdb/java/rocksjni/compaction_filter_factory_jnicallback.h +37 -0
- package/vendor/rocksdb/java/rocksjni/compaction_job_info.cc +230 -0
- package/vendor/rocksdb/java/rocksjni/compaction_job_stats.cc +345 -0
- package/vendor/rocksdb/java/rocksjni/compaction_options.cc +112 -0
- package/vendor/rocksdb/java/rocksjni/compaction_options_fifo.cc +83 -0
- package/vendor/rocksdb/java/rocksjni/compaction_options_universal.cc +209 -0
- package/vendor/rocksdb/java/rocksjni/comparator.cc +60 -0
- package/vendor/rocksdb/java/rocksjni/comparatorjnicallback.cc +647 -0
- package/vendor/rocksdb/java/rocksjni/comparatorjnicallback.h +137 -0
- package/vendor/rocksdb/java/rocksjni/compression_options.cc +214 -0
- package/vendor/rocksdb/java/rocksjni/concurrent_task_limiter.cc +97 -0
- package/vendor/rocksdb/java/rocksjni/config_options.cc +103 -0
- package/vendor/rocksdb/java/rocksjni/cplusplus_to_java_convert.h +37 -0
- package/vendor/rocksdb/java/rocksjni/env.cc +205 -0
- package/vendor/rocksdb/java/rocksjni/env_options.cc +305 -0
- package/vendor/rocksdb/java/rocksjni/event_listener.cc +44 -0
- package/vendor/rocksdb/java/rocksjni/event_listener_jnicallback.cc +502 -0
- package/vendor/rocksdb/java/rocksjni/event_listener_jnicallback.h +122 -0
- package/vendor/rocksdb/java/rocksjni/filter.cc +46 -0
- package/vendor/rocksdb/java/rocksjni/ingest_external_file_options.cc +199 -0
- package/vendor/rocksdb/java/rocksjni/iterator.cc +340 -0
- package/vendor/rocksdb/java/rocksjni/jnicallback.cc +54 -0
- package/vendor/rocksdb/java/rocksjni/jnicallback.h +32 -0
- package/vendor/rocksdb/java/rocksjni/loggerjnicallback.cc +299 -0
- package/vendor/rocksdb/java/rocksjni/loggerjnicallback.h +51 -0
- package/vendor/rocksdb/java/rocksjni/lru_cache.cc +49 -0
- package/vendor/rocksdb/java/rocksjni/memory_util.cc +100 -0
- package/vendor/rocksdb/java/rocksjni/memtablejni.cc +94 -0
- package/vendor/rocksdb/java/rocksjni/merge_operator.cc +98 -0
- package/vendor/rocksdb/java/rocksjni/native_comparator_wrapper_test.cc +45 -0
- package/vendor/rocksdb/java/rocksjni/optimistic_transaction_db.cc +270 -0
- package/vendor/rocksdb/java/rocksjni/optimistic_transaction_options.cc +78 -0
- package/vendor/rocksdb/java/rocksjni/options.cc +8695 -0
- package/vendor/rocksdb/java/rocksjni/options_util.cc +139 -0
- package/vendor/rocksdb/java/rocksjni/persistent_cache.cc +60 -0
- package/vendor/rocksdb/java/rocksjni/portal.h +8706 -0
- package/vendor/rocksdb/java/rocksjni/ratelimiterjni.cc +128 -0
- package/vendor/rocksdb/java/rocksjni/remove_emptyvalue_compactionfilterjni.cc +24 -0
- package/vendor/rocksdb/java/rocksjni/restorejni.cc +42 -0
- package/vendor/rocksdb/java/rocksjni/rocks_callback_object.cc +30 -0
- package/vendor/rocksdb/java/rocksjni/rocksdb_exception_test.cc +81 -0
- package/vendor/rocksdb/java/rocksjni/rocksjni.cc +3957 -0
- package/vendor/rocksdb/java/rocksjni/slice.cc +374 -0
- package/vendor/rocksdb/java/rocksjni/snapshot.cc +27 -0
- package/vendor/rocksdb/java/rocksjni/sst_file_manager.cc +250 -0
- package/vendor/rocksdb/java/rocksjni/sst_file_reader_iterator.cc +373 -0
- package/vendor/rocksdb/java/rocksjni/sst_file_readerjni.cc +118 -0
- package/vendor/rocksdb/java/rocksjni/sst_file_writerjni.cc +310 -0
- package/vendor/rocksdb/java/rocksjni/sst_partitioner.cc +43 -0
- package/vendor/rocksdb/java/rocksjni/statistics.cc +268 -0
- package/vendor/rocksdb/java/rocksjni/statisticsjni.cc +31 -0
- package/vendor/rocksdb/java/rocksjni/statisticsjni.h +34 -0
- package/vendor/rocksdb/java/rocksjni/table.cc +145 -0
- package/vendor/rocksdb/java/rocksjni/table_filter.cc +27 -0
- package/vendor/rocksdb/java/rocksjni/table_filter_jnicallback.cc +66 -0
- package/vendor/rocksdb/java/rocksjni/table_filter_jnicallback.h +36 -0
- package/vendor/rocksdb/java/rocksjni/testable_event_listener.cc +219 -0
- package/vendor/rocksdb/java/rocksjni/thread_status.cc +125 -0
- package/vendor/rocksdb/java/rocksjni/trace_writer.cc +24 -0
- package/vendor/rocksdb/java/rocksjni/trace_writer_jnicallback.cc +118 -0
- package/vendor/rocksdb/java/rocksjni/trace_writer_jnicallback.h +36 -0
- package/vendor/rocksdb/java/rocksjni/transaction.cc +1655 -0
- package/vendor/rocksdb/java/rocksjni/transaction_db.cc +451 -0
- package/vendor/rocksdb/java/rocksjni/transaction_db_options.cc +169 -0
- package/vendor/rocksdb/java/rocksjni/transaction_log.cc +80 -0
- package/vendor/rocksdb/java/rocksjni/transaction_notifier.cc +44 -0
- package/vendor/rocksdb/java/rocksjni/transaction_notifier_jnicallback.cc +42 -0
- package/vendor/rocksdb/java/rocksjni/transaction_notifier_jnicallback.h +42 -0
- package/vendor/rocksdb/java/rocksjni/transaction_options.cc +191 -0
- package/vendor/rocksdb/java/rocksjni/ttl.cc +212 -0
- package/vendor/rocksdb/java/rocksjni/wal_filter.cc +24 -0
- package/vendor/rocksdb/java/rocksjni/wal_filter_jnicallback.cc +139 -0
- package/vendor/rocksdb/java/rocksjni/wal_filter_jnicallback.h +42 -0
- package/vendor/rocksdb/java/rocksjni/write_batch.cc +676 -0
- package/vendor/rocksdb/java/rocksjni/write_batch_test.cc +199 -0
- package/vendor/rocksdb/java/rocksjni/write_batch_with_index.cc +953 -0
- package/vendor/rocksdb/java/rocksjni/write_buffer_manager.cc +47 -0
- package/vendor/rocksdb/java/rocksjni/writebatchhandlerjnicallback.cc +519 -0
- package/vendor/rocksdb/java/rocksjni/writebatchhandlerjnicallback.h +92 -0
- package/vendor/rocksdb/java/samples/src/main/java/OptimisticTransactionSample.java +184 -0
- package/vendor/rocksdb/java/samples/src/main/java/RocksDBColumnFamilySample.java +78 -0
- package/vendor/rocksdb/java/samples/src/main/java/RocksDBSample.java +295 -0
- package/vendor/rocksdb/java/samples/src/main/java/TransactionSample.java +183 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractCompactionFilter.java +59 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractCompactionFilterFactory.java +77 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractComparator.java +124 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractComparatorJniBridge.java +119 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractEventListener.java +334 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractImmutableNativeReference.java +65 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractMutableOptions.java +368 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractNativeReference.java +49 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractRocksIterator.java +146 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractSlice.java +191 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractTableFilter.java +20 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractTraceWriter.java +70 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractTransactionNotifier.java +54 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractWalFilter.java +49 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractWriteBatch.java +203 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AccessHint.java +53 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AdvancedColumnFamilyOptionsInterface.java +463 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AdvancedMutableColumnFamilyOptionsInterface.java +830 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackgroundErrorReason.java +46 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackupEngine.java +259 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackupEngineOptions.java +458 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackupInfo.java +76 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BlockBasedTableConfig.java +951 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BloomFilter.java +73 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BuiltinComparator.java +20 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ByteBufferGetStatus.java +50 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Cache.java +40 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CassandraCompactionFilter.java +20 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CassandraValueMergeOperator.java +25 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Checkpoint.java +62 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ChecksumType.java +45 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ClockCache.java +59 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyDescriptor.java +84 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyHandle.java +151 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyMetaData.java +70 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyOptions.java +1543 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyOptionsInterface.java +536 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactRangeOptions.java +245 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionJobInfo.java +161 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionJobStats.java +295 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionOptions.java +121 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionOptionsFIFO.java +87 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionOptionsUniversal.java +273 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionPriority.java +81 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionReason.java +141 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionStopStyle.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionStyle.java +81 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ComparatorOptions.java +133 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ComparatorType.java +48 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompressionOptions.java +150 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompressionType.java +121 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ConcurrentTaskLimiter.java +44 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ConcurrentTaskLimiterImpl.java +48 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ConfigOptions.java +53 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/DBOptions.java +1496 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/DBOptionsInterface.java +1756 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/DataBlockIndexType.java +32 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/DbPath.java +47 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/DirectSlice.java +136 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/EncodingType.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Env.java +167 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/EnvOptions.java +366 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/EventListener.java +335 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Experimental.java +23 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ExternalFileIngestionInfo.java +103 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/FileOperationInfo.java +112 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Filter.java +36 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/FlushJobInfo.java +186 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/FlushOptions.java +90 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/FlushReason.java +53 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/HashLinkedListMemTableConfig.java +174 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/HashSkipListMemTableConfig.java +106 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/HistogramData.java +75 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/HistogramType.java +214 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Holder.java +46 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/IndexShorteningMode.java +60 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/IndexType.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/InfoLogLevel.java +49 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/IngestExternalFileOptions.java +227 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/KeyMayExist.java +35 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/LRUCache.java +106 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/LevelMetaData.java +56 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/LiveFileMetaData.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/LogFile.java +75 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Logger.java +121 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemTableConfig.java +29 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemTableInfo.java +103 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemoryUsageType.java +72 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemoryUtil.java +60 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MergeOperator.java +18 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableColumnFamilyOptions.java +621 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableColumnFamilyOptionsInterface.java +156 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableDBOptions.java +292 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableDBOptionsInterface.java +440 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableOptionKey.java +16 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableOptionValue.java +368 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/NativeComparatorWrapper.java +59 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/NativeLibraryLoader.java +172 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OperationStage.java +59 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OperationType.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptimisticTransactionDB.java +224 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptimisticTransactionOptions.java +53 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptionString.java +261 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Options.java +2574 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptionsUtil.java +101 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/PersistentCache.java +26 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/PlainTableConfig.java +251 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/PrepopulateBlobCache.java +117 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Priority.java +49 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Range.java +19 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RateLimiter.java +227 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RateLimiterMode.java +52 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ReadOptions.java +822 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ReadTier.java +49 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RemoveEmptyValueCompactionFilter.java +18 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RestoreOptions.java +32 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ReusedSynchronisationType.java +65 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksCallbackObject.java +73 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksDB.java +4688 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksDBException.java +44 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksEnv.java +31 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksIterator.java +140 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksIteratorInterface.java +127 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksMemEnv.java +31 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksMutableObject.java +87 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksObject.java +45 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SanityLevel.java +47 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SizeApproximationFlag.java +31 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SkipListMemTableConfig.java +51 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Slice.java +135 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Snapshot.java +41 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileManager.java +249 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileMetaData.java +162 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileReader.java +82 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileReaderIterator.java +140 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileWriter.java +237 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstPartitionerFactory.java +15 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstPartitionerFixedPrefixFactory.java +19 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StateType.java +53 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Statistics.java +153 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatisticsCollector.java +102 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatisticsCollectorCallback.java +32 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatsCollectorInput.java +35 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatsLevel.java +65 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Status.java +155 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StringAppendOperator.java +29 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileCreationBriefInfo.java +107 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileCreationInfo.java +86 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileCreationReason.java +46 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileDeletionInfo.java +86 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFilter.java +21 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFormatConfig.java +22 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableProperties.java +426 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ThreadStatus.java +224 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ThreadType.java +65 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TickerType.java +802 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TimedEnv.java +30 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TraceOptions.java +32 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TraceWriter.java +36 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Transaction.java +2162 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionDB.java +401 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionDBOptions.java +216 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionLogIterator.java +112 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionOptions.java +189 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionalDB.java +65 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionalOptions.java +31 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TtlDB.java +242 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TxnDBWritePolicy.java +62 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/UInt64AddOperator.java +19 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/VectorMemTableConfig.java +46 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WALRecoveryMode.java +82 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WBWIRocksIterator.java +203 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WalFileType.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WalFilter.java +86 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WalProcessingOption.java +54 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBatch.java +394 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBatchInterface.java +283 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBatchWithIndex.java +358 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBufferManager.java +50 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteOptions.java +255 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteStallCondition.java +44 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteStallInfo.java +75 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/ByteUtil.java +52 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/BytewiseComparator.java +121 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/Environment.java +245 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/IntComparator.java +67 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/ReverseBytewiseComparator.java +88 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/SizeUnit.java +16 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/AbstractTransactionTest.java +979 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BackupEngineOptionsTest.java +297 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BackupEngineTest.java +261 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BlobOptionsTest.java +353 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BlockBasedTableConfigTest.java +415 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BuiltinComparatorTest.java +145 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ByteBufferUnsupportedOperationTest.java +132 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BytewiseComparatorRegressionTest.java +132 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CheckPointTest.java +82 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ClockCacheTest.java +25 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ColumnFamilyOptionsTest.java +712 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ColumnFamilyTest.java +562 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactRangeOptionsTest.java +102 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionFilterFactoryTest.java +61 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionJobInfoTest.java +114 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionJobStatsTest.java +196 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionOptionsFIFOTest.java +35 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionOptionsTest.java +52 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionOptionsUniversalTest.java +80 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionPriorityTest.java +31 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionStopStyleTest.java +31 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ComparatorOptionsTest.java +58 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompressionOptionsTest.java +71 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompressionTypesTest.java +25 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ConcurrentTaskLimiterTest.java +56 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/DBOptionsTest.java +902 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/DefaultEnvTest.java +113 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/DirectSliceTest.java +93 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/EnvOptionsTest.java +145 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/EventListenerTest.java +725 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/FilterTest.java +39 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/FlushOptionsTest.java +31 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/FlushTest.java +49 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/InfoLogLevelTest.java +109 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/IngestExternalFileOptionsTest.java +107 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/KeyMayExistTest.java +528 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/LRUCacheTest.java +32 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/LoggerTest.java +235 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MemTableTest.java +108 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MemoryUtilTest.java +136 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MergeTest.java +465 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MixedOptionsTest.java +85 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MultiColumnRegressionTest.java +145 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MultiGetManyKeysTest.java +241 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MultiGetTest.java +530 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MutableColumnFamilyOptionsTest.java +167 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MutableDBOptionsTest.java +85 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MutableOptionsGetSetTest.java +429 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/NativeComparatorWrapperTest.java +90 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/NativeLibraryLoaderTest.java +41 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptimisticTransactionDBTest.java +131 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptimisticTransactionOptionsTest.java +38 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptimisticTransactionTest.java +446 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptionsTest.java +1488 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptionsUtilTest.java +129 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/PlainTableConfigTest.java +89 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/PlatformRandomHelper.java +58 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/PutMultiplePartsTest.java +164 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RateLimiterTest.java +65 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ReadOnlyTest.java +222 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ReadOptionsTest.java +374 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksDBExceptionTest.java +115 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksDBTest.java +1692 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksIteratorTest.java +289 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksMemEnvTest.java +137 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksNativeLibraryResource.java +18 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SecondaryDBTest.java +135 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SliceTest.java +80 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SnapshotTest.java +169 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstFileManagerTest.java +66 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstFileReaderTest.java +222 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstFileWriterTest.java +239 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstPartitionerTest.java +72 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/StatisticsCollectorTest.java +55 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/StatisticsTest.java +168 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/StatsCallbackMock.java +19 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TableFilterTest.java +106 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TimedEnvTest.java +40 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionDBOptionsTest.java +64 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionDBTest.java +177 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionLogIteratorTest.java +139 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionOptionsTest.java +72 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionTest.java +488 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TtlDBTest.java +112 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/Types.java +43 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/VerifyChecksumsTest.java +213 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WALRecoveryModeTest.java +22 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WalFilterTest.java +165 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchHandlerTest.java +76 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchTest.java +528 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchThreadedTest.java +101 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchWithIndexTest.java +1068 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteOptionsTest.java +75 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/test/RemoveEmptyValueCompactionFilterFactory.java +21 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/test/RocksJunitRunner.java +174 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/test/TestableEventListener.java +23 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/ByteBufferAllocator.java +16 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/BytewiseComparatorIntTest.java +267 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/BytewiseComparatorTest.java +531 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/CapturingWriteBatchHandler.java +190 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/DirectByteBufferAllocator.java +18 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/EnvironmentTest.java +304 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/HeapByteBufferAllocator.java +18 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/IntComparatorTest.java +266 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/JNIComparatorTest.java +180 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/ReverseBytewiseComparatorIntTest.java +270 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/SizeUnitTest.java +27 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/TestUtil.java +72 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/WriteBatchGetter.java +139 -0
- package/vendor/rocksdb/java/understanding_options.md +79 -0
- package/vendor/rocksdb/logging/auto_roll_logger.cc +368 -0
- package/vendor/rocksdb/logging/auto_roll_logger.h +166 -0
- package/vendor/rocksdb/logging/auto_roll_logger_test.cc +731 -0
- package/vendor/rocksdb/logging/env_logger.h +195 -0
- package/vendor/rocksdb/logging/env_logger_test.cc +163 -0
- package/vendor/rocksdb/logging/event_logger.cc +68 -0
- package/vendor/rocksdb/logging/event_logger.h +202 -0
- package/vendor/rocksdb/logging/event_logger_test.cc +45 -0
- package/vendor/rocksdb/logging/log_buffer.cc +91 -0
- package/vendor/rocksdb/logging/log_buffer.h +57 -0
- package/vendor/rocksdb/logging/logging.h +62 -0
- package/vendor/rocksdb/memory/allocator.h +58 -0
- package/vendor/rocksdb/memory/arena.cc +170 -0
- package/vendor/rocksdb/memory/arena.h +135 -0
- package/vendor/rocksdb/memory/arena_test.cc +295 -0
- package/vendor/rocksdb/memory/concurrent_arena.cc +45 -0
- package/vendor/rocksdb/memory/concurrent_arena.h +215 -0
- package/vendor/rocksdb/memory/jemalloc_nodump_allocator.cc +303 -0
- package/vendor/rocksdb/memory/jemalloc_nodump_allocator.h +99 -0
- package/vendor/rocksdb/memory/memkind_kmem_allocator.cc +44 -0
- package/vendor/rocksdb/memory/memkind_kmem_allocator.h +43 -0
- package/vendor/rocksdb/memory/memory_allocator.cc +80 -0
- package/vendor/rocksdb/memory/memory_allocator_impl.h +47 -0
- package/vendor/rocksdb/memory/memory_allocator_test.cc +236 -0
- package/vendor/rocksdb/memory/memory_usage.h +38 -0
- package/vendor/rocksdb/memtable/alloc_tracker.cc +63 -0
- package/vendor/rocksdb/memtable/hash_linklist_rep.cc +924 -0
- package/vendor/rocksdb/memtable/hash_skiplist_rep.cc +391 -0
- package/vendor/rocksdb/memtable/inlineskiplist.h +1051 -0
- package/vendor/rocksdb/memtable/inlineskiplist_test.cc +665 -0
- package/vendor/rocksdb/memtable/memtablerep_bench.cc +687 -0
- package/vendor/rocksdb/memtable/skiplist.h +498 -0
- package/vendor/rocksdb/memtable/skiplist_test.cc +388 -0
- package/vendor/rocksdb/memtable/skiplistrep.cc +368 -0
- package/vendor/rocksdb/memtable/stl_wrappers.h +33 -0
- package/vendor/rocksdb/memtable/vectorrep.cc +307 -0
- package/vendor/rocksdb/memtable/write_buffer_manager.cc +185 -0
- package/vendor/rocksdb/memtable/write_buffer_manager_test.cc +304 -0
- package/vendor/rocksdb/microbench/CMakeLists.txt +17 -0
- package/vendor/rocksdb/microbench/README.md +60 -0
- package/vendor/rocksdb/microbench/db_basic_bench.cc +1583 -0
- package/vendor/rocksdb/microbench/ribbon_bench.cc +155 -0
- package/vendor/rocksdb/monitoring/file_read_sample.h +23 -0
- package/vendor/rocksdb/monitoring/histogram.cc +270 -0
- package/vendor/rocksdb/monitoring/histogram.h +143 -0
- package/vendor/rocksdb/monitoring/histogram_test.cc +254 -0
- package/vendor/rocksdb/monitoring/histogram_windowing.cc +194 -0
- package/vendor/rocksdb/monitoring/histogram_windowing.h +84 -0
- package/vendor/rocksdb/monitoring/in_memory_stats_history.cc +50 -0
- package/vendor/rocksdb/monitoring/in_memory_stats_history.h +74 -0
- package/vendor/rocksdb/monitoring/instrumented_mutex.cc +90 -0
- package/vendor/rocksdb/monitoring/instrumented_mutex.h +126 -0
- package/vendor/rocksdb/monitoring/iostats_context.cc +78 -0
- package/vendor/rocksdb/monitoring/iostats_context_imp.h +62 -0
- package/vendor/rocksdb/monitoring/iostats_context_test.cc +31 -0
- package/vendor/rocksdb/monitoring/perf_context.cc +313 -0
- package/vendor/rocksdb/monitoring/perf_context_imp.h +96 -0
- package/vendor/rocksdb/monitoring/perf_level.cc +23 -0
- package/vendor/rocksdb/monitoring/perf_level_imp.h +14 -0
- package/vendor/rocksdb/monitoring/perf_step_timer.h +77 -0
- package/vendor/rocksdb/monitoring/persistent_stats_history.cc +170 -0
- package/vendor/rocksdb/monitoring/persistent_stats_history.h +83 -0
- package/vendor/rocksdb/monitoring/statistics.cc +534 -0
- package/vendor/rocksdb/monitoring/statistics_impl.h +144 -0
- package/vendor/rocksdb/monitoring/statistics_test.cc +88 -0
- package/vendor/rocksdb/monitoring/stats_history_test.cc +662 -0
- package/vendor/rocksdb/monitoring/thread_status_impl.cc +163 -0
- package/vendor/rocksdb/monitoring/thread_status_updater.cc +328 -0
- package/vendor/rocksdb/monitoring/thread_status_updater.h +226 -0
- package/vendor/rocksdb/monitoring/thread_status_updater_debug.cc +43 -0
- package/vendor/rocksdb/monitoring/thread_status_util.cc +208 -0
- package/vendor/rocksdb/monitoring/thread_status_util.h +139 -0
- package/vendor/rocksdb/monitoring/thread_status_util_debug.cc +46 -0
- package/vendor/rocksdb/options/cf_options.cc +1196 -0
- package/vendor/rocksdb/options/cf_options.h +347 -0
- package/vendor/rocksdb/options/configurable.cc +712 -0
- package/vendor/rocksdb/options/configurable_helper.h +185 -0
- package/vendor/rocksdb/options/configurable_test.cc +861 -0
- package/vendor/rocksdb/options/configurable_test.h +116 -0
- package/vendor/rocksdb/options/customizable.cc +133 -0
- package/vendor/rocksdb/options/customizable_test.cc +2116 -0
- package/vendor/rocksdb/options/db_options.cc +1079 -0
- package/vendor/rocksdb/options/db_options.h +152 -0
- package/vendor/rocksdb/options/options.cc +692 -0
- package/vendor/rocksdb/options/options_helper.cc +1424 -0
- package/vendor/rocksdb/options/options_helper.h +116 -0
- package/vendor/rocksdb/options/options_parser.cc +736 -0
- package/vendor/rocksdb/options/options_parser.h +149 -0
- package/vendor/rocksdb/options/options_settable_test.cc +655 -0
- package/vendor/rocksdb/options/options_test.cc +5060 -0
- package/vendor/rocksdb/plugin/README.md +43 -0
- package/vendor/rocksdb/port/README +10 -0
- package/vendor/rocksdb/port/jemalloc_helper.h +107 -0
- package/vendor/rocksdb/port/lang.h +97 -0
- package/vendor/rocksdb/port/likely.h +18 -0
- package/vendor/rocksdb/port/malloc.h +17 -0
- package/vendor/rocksdb/port/mmap.cc +98 -0
- package/vendor/rocksdb/port/mmap.h +70 -0
- package/vendor/rocksdb/port/port.h +21 -0
- package/vendor/rocksdb/port/port_dirent.h +44 -0
- package/vendor/rocksdb/port/port_example.h +101 -0
- package/vendor/rocksdb/port/port_posix.cc +300 -0
- package/vendor/rocksdb/port/port_posix.h +243 -0
- package/vendor/rocksdb/port/stack_trace.cc +336 -0
- package/vendor/rocksdb/port/stack_trace.h +31 -0
- package/vendor/rocksdb/port/sys_time.h +63 -0
- package/vendor/rocksdb/port/util_logger.h +18 -0
- package/vendor/rocksdb/port/win/env_default.cc +45 -0
- package/vendor/rocksdb/port/win/env_win.cc +1437 -0
- package/vendor/rocksdb/port/win/env_win.h +305 -0
- package/vendor/rocksdb/port/win/io_win.cc +1101 -0
- package/vendor/rocksdb/port/win/io_win.h +508 -0
- package/vendor/rocksdb/port/win/port_win.cc +303 -0
- package/vendor/rocksdb/port/win/port_win.h +379 -0
- package/vendor/rocksdb/port/win/win_jemalloc.cc +80 -0
- package/vendor/rocksdb/port/win/win_logger.cc +192 -0
- package/vendor/rocksdb/port/win/win_logger.h +64 -0
- package/vendor/rocksdb/port/win/win_thread.cc +170 -0
- package/vendor/rocksdb/port/win/win_thread.h +117 -0
- package/vendor/rocksdb/port/win/xpress_win.cc +210 -0
- package/vendor/rocksdb/port/win/xpress_win.h +26 -0
- package/vendor/rocksdb/port/xpress.h +17 -0
- package/vendor/rocksdb/rocksdb.pc.in +10 -0
- package/vendor/rocksdb/src.mk +713 -0
- package/vendor/rocksdb/table/adaptive/adaptive_table_factory.cc +125 -0
- package/vendor/rocksdb/table/adaptive/adaptive_table_factory.h +56 -0
- package/vendor/rocksdb/table/block_based/binary_search_index_reader.cc +73 -0
- package/vendor/rocksdb/table/block_based/binary_search_index_reader.h +48 -0
- package/vendor/rocksdb/table/block_based/block.cc +1291 -0
- package/vendor/rocksdb/table/block_based/block.h +921 -0
- package/vendor/rocksdb/table/block_based/block_based_table_builder.cc +2027 -0
- package/vendor/rocksdb/table/block_based/block_based_table_builder.h +209 -0
- package/vendor/rocksdb/table/block_based/block_based_table_factory.cc +962 -0
- package/vendor/rocksdb/table/block_based/block_based_table_factory.h +102 -0
- package/vendor/rocksdb/table/block_based/block_based_table_iterator.cc +500 -0
- package/vendor/rocksdb/table/block_based/block_based_table_iterator.h +310 -0
- package/vendor/rocksdb/table/block_based/block_based_table_reader.cc +3043 -0
- package/vendor/rocksdb/table/block_based/block_based_table_reader.h +745 -0
- package/vendor/rocksdb/table/block_based/block_based_table_reader_impl.h +203 -0
- package/vendor/rocksdb/table/block_based/block_based_table_reader_sync_and_async.h +758 -0
- package/vendor/rocksdb/table/block_based/block_based_table_reader_test.cc +567 -0
- package/vendor/rocksdb/table/block_based/block_builder.cc +234 -0
- package/vendor/rocksdb/table/block_based/block_builder.h +104 -0
- package/vendor/rocksdb/table/block_based/block_cache.cc +106 -0
- package/vendor/rocksdb/table/block_based/block_cache.h +140 -0
- package/vendor/rocksdb/table/block_based/block_prefetcher.cc +120 -0
- package/vendor/rocksdb/table/block_based/block_prefetcher.h +72 -0
- package/vendor/rocksdb/table/block_based/block_prefix_index.cc +226 -0
- package/vendor/rocksdb/table/block_based/block_prefix_index.h +70 -0
- package/vendor/rocksdb/table/block_based/block_test.cc +1543 -0
- package/vendor/rocksdb/table/block_based/block_type.h +34 -0
- package/vendor/rocksdb/table/block_based/cachable_entry.h +244 -0
- package/vendor/rocksdb/table/block_based/data_block_footer.cc +59 -0
- package/vendor/rocksdb/table/block_based/data_block_footer.h +25 -0
- package/vendor/rocksdb/table/block_based/data_block_hash_index.cc +94 -0
- package/vendor/rocksdb/table/block_based/data_block_hash_index.h +137 -0
- package/vendor/rocksdb/table/block_based/data_block_hash_index_test.cc +718 -0
- package/vendor/rocksdb/table/block_based/filter_block.h +183 -0
- package/vendor/rocksdb/table/block_based/filter_block_reader_common.cc +163 -0
- package/vendor/rocksdb/table/block_based/filter_block_reader_common.h +76 -0
- package/vendor/rocksdb/table/block_based/filter_policy.cc +1966 -0
- package/vendor/rocksdb/table/block_based/filter_policy_internal.h +340 -0
- package/vendor/rocksdb/table/block_based/flush_block_policy.cc +132 -0
- package/vendor/rocksdb/table/block_based/flush_block_policy_impl.h +40 -0
- package/vendor/rocksdb/table/block_based/full_filter_block.cc +290 -0
- package/vendor/rocksdb/table/block_based/full_filter_block.h +147 -0
- package/vendor/rocksdb/table/block_based/full_filter_block_test.cc +323 -0
- package/vendor/rocksdb/table/block_based/hash_index_reader.cc +147 -0
- package/vendor/rocksdb/table/block_based/hash_index_reader.h +49 -0
- package/vendor/rocksdb/table/block_based/index_builder.cc +282 -0
- package/vendor/rocksdb/table/block_based/index_builder.h +455 -0
- package/vendor/rocksdb/table/block_based/index_reader_common.cc +57 -0
- package/vendor/rocksdb/table/block_based/index_reader_common.h +85 -0
- package/vendor/rocksdb/table/block_based/mock_block_based_table.h +62 -0
- package/vendor/rocksdb/table/block_based/parsed_full_filter_block.cc +23 -0
- package/vendor/rocksdb/table/block_based/parsed_full_filter_block.h +47 -0
- package/vendor/rocksdb/table/block_based/partitioned_filter_block.cc +554 -0
- package/vendor/rocksdb/table/block_based/partitioned_filter_block.h +182 -0
- package/vendor/rocksdb/table/block_based/partitioned_filter_block_test.cc +436 -0
- package/vendor/rocksdb/table/block_based/partitioned_index_iterator.cc +163 -0
- package/vendor/rocksdb/table/block_based/partitioned_index_iterator.h +160 -0
- package/vendor/rocksdb/table/block_based/partitioned_index_reader.cc +224 -0
- package/vendor/rocksdb/table/block_based/partitioned_index_reader.h +56 -0
- package/vendor/rocksdb/table/block_based/reader_common.cc +52 -0
- package/vendor/rocksdb/table/block_based/reader_common.h +34 -0
- package/vendor/rocksdb/table/block_based/uncompression_dict_reader.cc +126 -0
- package/vendor/rocksdb/table/block_based/uncompression_dict_reader.h +61 -0
- package/vendor/rocksdb/table/block_fetcher.cc +405 -0
- package/vendor/rocksdb/table/block_fetcher.h +142 -0
- package/vendor/rocksdb/table/block_fetcher_test.cc +520 -0
- package/vendor/rocksdb/table/cleanable_test.cc +390 -0
- package/vendor/rocksdb/table/compaction_merging_iterator.cc +370 -0
- package/vendor/rocksdb/table/compaction_merging_iterator.h +44 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_builder.cc +551 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_builder.h +136 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_builder_test.cc +631 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_factory.cc +100 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_factory.h +80 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_reader.cc +412 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_reader.h +100 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_reader_test.cc +574 -0
- package/vendor/rocksdb/table/format.cc +573 -0
- package/vendor/rocksdb/table/format.h +378 -0
- package/vendor/rocksdb/table/get_context.cc +616 -0
- package/vendor/rocksdb/table/get_context.h +245 -0
- package/vendor/rocksdb/table/internal_iterator.h +224 -0
- package/vendor/rocksdb/table/iter_heap.h +44 -0
- package/vendor/rocksdb/table/iterator.cc +130 -0
- package/vendor/rocksdb/table/iterator_wrapper.h +190 -0
- package/vendor/rocksdb/table/merger_test.cc +182 -0
- package/vendor/rocksdb/table/merging_iterator.cc +1725 -0
- package/vendor/rocksdb/table/merging_iterator.h +97 -0
- package/vendor/rocksdb/table/meta_blocks.cc +564 -0
- package/vendor/rocksdb/table/meta_blocks.h +172 -0
- package/vendor/rocksdb/table/mock_table.cc +346 -0
- package/vendor/rocksdb/table/mock_table.h +94 -0
- package/vendor/rocksdb/table/multiget_context.h +405 -0
- package/vendor/rocksdb/table/persistent_cache_helper.cc +111 -0
- package/vendor/rocksdb/table/persistent_cache_helper.h +46 -0
- package/vendor/rocksdb/table/persistent_cache_options.h +34 -0
- package/vendor/rocksdb/table/plain/plain_table_bloom.cc +78 -0
- package/vendor/rocksdb/table/plain/plain_table_bloom.h +132 -0
- package/vendor/rocksdb/table/plain/plain_table_builder.cc +335 -0
- package/vendor/rocksdb/table/plain/plain_table_builder.h +152 -0
- package/vendor/rocksdb/table/plain/plain_table_factory.cc +296 -0
- package/vendor/rocksdb/table/plain/plain_table_factory.h +180 -0
- package/vendor/rocksdb/table/plain/plain_table_index.cc +211 -0
- package/vendor/rocksdb/table/plain/plain_table_index.h +246 -0
- package/vendor/rocksdb/table/plain/plain_table_key_coding.cc +507 -0
- package/vendor/rocksdb/table/plain/plain_table_key_coding.h +199 -0
- package/vendor/rocksdb/table/plain/plain_table_reader.cc +771 -0
- package/vendor/rocksdb/table/plain/plain_table_reader.h +243 -0
- package/vendor/rocksdb/table/scoped_arena_iterator.h +57 -0
- package/vendor/rocksdb/table/sst_file_dumper.cc +520 -0
- package/vendor/rocksdb/table/sst_file_dumper.h +99 -0
- package/vendor/rocksdb/table/sst_file_reader.cc +101 -0
- package/vendor/rocksdb/table/sst_file_reader_test.cc +423 -0
- package/vendor/rocksdb/table/sst_file_writer.cc +436 -0
- package/vendor/rocksdb/table/sst_file_writer_collectors.h +95 -0
- package/vendor/rocksdb/table/table_builder.h +228 -0
- package/vendor/rocksdb/table/table_factory.cc +52 -0
- package/vendor/rocksdb/table/table_properties.cc +351 -0
- package/vendor/rocksdb/table/table_properties_internal.h +14 -0
- package/vendor/rocksdb/table/table_reader.h +187 -0
- package/vendor/rocksdb/table/table_reader_bench.cc +339 -0
- package/vendor/rocksdb/table/table_test.cc +5882 -0
- package/vendor/rocksdb/table/two_level_iterator.cc +220 -0
- package/vendor/rocksdb/table/two_level_iterator.h +43 -0
- package/vendor/rocksdb/table/unique_id.cc +223 -0
- package/vendor/rocksdb/table/unique_id_impl.h +93 -0
- package/vendor/rocksdb/test_util/mock_time_env.cc +38 -0
- package/vendor/rocksdb/test_util/mock_time_env.h +78 -0
- package/vendor/rocksdb/test_util/secondary_cache_test_util.cc +96 -0
- package/vendor/rocksdb/test_util/secondary_cache_test_util.h +119 -0
- package/vendor/rocksdb/test_util/sync_point.cc +82 -0
- package/vendor/rocksdb/test_util/sync_point.h +180 -0
- package/vendor/rocksdb/test_util/sync_point_impl.cc +152 -0
- package/vendor/rocksdb/test_util/sync_point_impl.h +96 -0
- package/vendor/rocksdb/test_util/testharness.cc +107 -0
- package/vendor/rocksdb/test_util/testharness.h +124 -0
- package/vendor/rocksdb/test_util/testutil.cc +722 -0
- package/vendor/rocksdb/test_util/testutil.h +860 -0
- package/vendor/rocksdb/test_util/testutil_test.cc +43 -0
- package/vendor/rocksdb/test_util/transaction_test_util.cc +400 -0
- package/vendor/rocksdb/test_util/transaction_test_util.h +147 -0
- package/vendor/rocksdb/third-party/gcc/ppc-asm.h +390 -0
- package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/CMakeLists.txt +4 -0
- package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/gtest-all.cc +11394 -0
- package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/gtest.h +22115 -0
- package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/gtest_main.cc +37 -0
- package/vendor/rocksdb/thirdparty.inc +268 -0
- package/vendor/rocksdb/tools/CMakeLists.txt +30 -0
- package/vendor/rocksdb/tools/Dockerfile +5 -0
- package/vendor/rocksdb/tools/advisor/README.md +96 -0
- package/vendor/rocksdb/tools/advisor/advisor/__init__.py +0 -0
- package/vendor/rocksdb/tools/advisor/advisor/bench_runner.py +39 -0
- package/vendor/rocksdb/tools/advisor/advisor/config_optimizer_example.py +140 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_bench_runner.py +237 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_config_optimizer.py +293 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_log_parser.py +134 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_options_parser.py +348 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_stats_fetcher.py +346 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_timeseries_parser.py +203 -0
- package/vendor/rocksdb/tools/advisor/advisor/ini_parser.py +76 -0
- package/vendor/rocksdb/tools/advisor/advisor/rule_parser.py +510 -0
- package/vendor/rocksdb/tools/advisor/advisor/rule_parser_example.py +98 -0
- package/vendor/rocksdb/tools/advisor/advisor/rules.ini +214 -0
- package/vendor/rocksdb/tools/advisor/test/__init__.py +0 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/LOG-0 +30 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/LOG-1 +25 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/OPTIONS-000005 +49 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/log_stats_parser_keys_ts +3 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/rules_err1.ini +56 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/rules_err2.ini +15 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/rules_err3.ini +15 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/rules_err4.ini +15 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/test_rules.ini +47 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/triggered_rules.ini +83 -0
- package/vendor/rocksdb/tools/advisor/test/test_db_bench_runner.py +141 -0
- package/vendor/rocksdb/tools/advisor/test/test_db_log_parser.py +96 -0
- package/vendor/rocksdb/tools/advisor/test/test_db_options_parser.py +214 -0
- package/vendor/rocksdb/tools/advisor/test/test_db_stats_fetcher.py +121 -0
- package/vendor/rocksdb/tools/advisor/test/test_rule_parser.py +226 -0
- package/vendor/rocksdb/tools/analyze_txn_stress_test.sh +77 -0
- package/vendor/rocksdb/tools/auto_sanity_test.sh +93 -0
- package/vendor/rocksdb/tools/backup_db.sh +15 -0
- package/vendor/rocksdb/tools/benchmark.sh +1173 -0
- package/vendor/rocksdb/tools/benchmark_ci.py +182 -0
- package/vendor/rocksdb/tools/benchmark_compare.sh +342 -0
- package/vendor/rocksdb/tools/benchmark_leveldb.sh +187 -0
- package/vendor/rocksdb/tools/blob_dump.cc +103 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/__init__.py +2 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_pysim.py +2000 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_pysim.sh +156 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_pysim_test.py +734 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer.cc +2314 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer.h +397 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_plot.py +729 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc +791 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc +17 -0
- package/vendor/rocksdb/tools/check_all_python.py +22 -0
- package/vendor/rocksdb/tools/check_format_compatible.sh +379 -0
- package/vendor/rocksdb/tools/db_bench.cc +21 -0
- package/vendor/rocksdb/tools/db_bench_tool.cc +8604 -0
- package/vendor/rocksdb/tools/db_bench_tool_test.cc +342 -0
- package/vendor/rocksdb/tools/db_crashtest.py +1018 -0
- package/vendor/rocksdb/tools/db_repl_stress.cc +132 -0
- package/vendor/rocksdb/tools/db_sanity_test.cc +296 -0
- package/vendor/rocksdb/tools/dbench_monitor +102 -0
- package/vendor/rocksdb/tools/dump/db_dump_tool.cc +258 -0
- package/vendor/rocksdb/tools/dump/rocksdb_dump.cc +60 -0
- package/vendor/rocksdb/tools/dump/rocksdb_undump.cc +59 -0
- package/vendor/rocksdb/tools/generate_random_db.sh +31 -0
- package/vendor/rocksdb/tools/ingest_external_sst.sh +18 -0
- package/vendor/rocksdb/tools/io_tracer_parser.cc +17 -0
- package/vendor/rocksdb/tools/io_tracer_parser_test.cc +182 -0
- package/vendor/rocksdb/tools/io_tracer_parser_tool.cc +142 -0
- package/vendor/rocksdb/tools/io_tracer_parser_tool.h +38 -0
- package/vendor/rocksdb/tools/ldb.cc +13 -0
- package/vendor/rocksdb/tools/ldb_cmd.cc +4263 -0
- package/vendor/rocksdb/tools/ldb_cmd_impl.h +744 -0
- package/vendor/rocksdb/tools/ldb_cmd_test.cc +1216 -0
- package/vendor/rocksdb/tools/ldb_test.py +955 -0
- package/vendor/rocksdb/tools/ldb_tool.cc +182 -0
- package/vendor/rocksdb/tools/pflag +217 -0
- package/vendor/rocksdb/tools/reduce_levels_test.cc +212 -0
- package/vendor/rocksdb/tools/regression_test.sh +525 -0
- package/vendor/rocksdb/tools/restore_db.sh +15 -0
- package/vendor/rocksdb/tools/rocksdb_dump_test.sh +9 -0
- package/vendor/rocksdb/tools/run_blob_bench.sh +223 -0
- package/vendor/rocksdb/tools/run_flash_bench.sh +359 -0
- package/vendor/rocksdb/tools/run_leveldb.sh +175 -0
- package/vendor/rocksdb/tools/sample-dump.dmp +0 -0
- package/vendor/rocksdb/tools/simulated_hybrid_file_system.cc +243 -0
- package/vendor/rocksdb/tools/simulated_hybrid_file_system.h +124 -0
- package/vendor/rocksdb/tools/sst_dump.cc +12 -0
- package/vendor/rocksdb/tools/sst_dump_test.cc +471 -0
- package/vendor/rocksdb/tools/sst_dump_tool.cc +582 -0
- package/vendor/rocksdb/tools/trace_analyzer.cc +17 -0
- package/vendor/rocksdb/tools/trace_analyzer_test.cc +880 -0
- package/vendor/rocksdb/tools/trace_analyzer_tool.cc +1929 -0
- package/vendor/rocksdb/tools/trace_analyzer_tool.h +329 -0
- package/vendor/rocksdb/tools/verify_random_db.sh +41 -0
- package/vendor/rocksdb/tools/write_external_sst.sh +26 -0
- package/vendor/rocksdb/tools/write_stress.cc +305 -0
- package/vendor/rocksdb/tools/write_stress_runner.py +83 -0
- package/vendor/rocksdb/trace_replay/block_cache_tracer.cc +509 -0
- package/vendor/rocksdb/trace_replay/block_cache_tracer.h +239 -0
- package/vendor/rocksdb/trace_replay/block_cache_tracer_test.cc +421 -0
- package/vendor/rocksdb/trace_replay/io_tracer.cc +303 -0
- package/vendor/rocksdb/trace_replay/io_tracer.h +185 -0
- package/vendor/rocksdb/trace_replay/io_tracer_test.cc +353 -0
- package/vendor/rocksdb/trace_replay/trace_record.cc +206 -0
- package/vendor/rocksdb/trace_replay/trace_record_handler.cc +190 -0
- package/vendor/rocksdb/trace_replay/trace_record_handler.h +46 -0
- package/vendor/rocksdb/trace_replay/trace_record_result.cc +146 -0
- package/vendor/rocksdb/trace_replay/trace_replay.cc +622 -0
- package/vendor/rocksdb/trace_replay/trace_replay.h +183 -0
- package/vendor/rocksdb/util/aligned_buffer.h +235 -0
- package/vendor/rocksdb/util/async_file_reader.cc +81 -0
- package/vendor/rocksdb/util/async_file_reader.h +144 -0
- package/vendor/rocksdb/util/autovector.h +393 -0
- package/vendor/rocksdb/util/autovector_test.cc +324 -0
- package/vendor/rocksdb/util/bloom_impl.h +489 -0
- package/vendor/rocksdb/util/bloom_test.cc +1175 -0
- package/vendor/rocksdb/util/build_version.cc.in +79 -0
- package/vendor/rocksdb/util/cast_util.h +42 -0
- package/vendor/rocksdb/util/channel.h +69 -0
- package/vendor/rocksdb/util/cleanable.cc +181 -0
- package/vendor/rocksdb/util/coding.cc +90 -0
- package/vendor/rocksdb/util/coding.h +389 -0
- package/vendor/rocksdb/util/coding_lean.h +101 -0
- package/vendor/rocksdb/util/coding_test.cc +217 -0
- package/vendor/rocksdb/util/compaction_job_stats_impl.cc +92 -0
- package/vendor/rocksdb/util/comparator.cc +383 -0
- package/vendor/rocksdb/util/compression.cc +122 -0
- package/vendor/rocksdb/util/compression.h +1795 -0
- package/vendor/rocksdb/util/compression_context_cache.cc +106 -0
- package/vendor/rocksdb/util/compression_context_cache.h +47 -0
- package/vendor/rocksdb/util/concurrent_task_limiter_impl.cc +64 -0
- package/vendor/rocksdb/util/concurrent_task_limiter_impl.h +67 -0
- package/vendor/rocksdb/util/core_local.h +84 -0
- package/vendor/rocksdb/util/coro_utils.h +112 -0
- package/vendor/rocksdb/util/crc32c.cc +1292 -0
- package/vendor/rocksdb/util/crc32c.h +56 -0
- package/vendor/rocksdb/util/crc32c_arm64.cc +213 -0
- package/vendor/rocksdb/util/crc32c_arm64.h +52 -0
- package/vendor/rocksdb/util/crc32c_ppc.c +94 -0
- package/vendor/rocksdb/util/crc32c_ppc.h +22 -0
- package/vendor/rocksdb/util/crc32c_ppc_asm.S +756 -0
- package/vendor/rocksdb/util/crc32c_ppc_constants.h +900 -0
- package/vendor/rocksdb/util/crc32c_test.cc +213 -0
- package/vendor/rocksdb/util/data_structure.cc +18 -0
- package/vendor/rocksdb/util/defer.h +82 -0
- package/vendor/rocksdb/util/defer_test.cc +51 -0
- package/vendor/rocksdb/util/distributed_mutex.h +50 -0
- package/vendor/rocksdb/util/duplicate_detector.h +69 -0
- package/vendor/rocksdb/util/dynamic_bloom.cc +70 -0
- package/vendor/rocksdb/util/dynamic_bloom.h +214 -0
- package/vendor/rocksdb/util/dynamic_bloom_test.cc +325 -0
- package/vendor/rocksdb/util/fastrange.h +114 -0
- package/vendor/rocksdb/util/file_checksum_helper.cc +170 -0
- package/vendor/rocksdb/util/file_checksum_helper.h +101 -0
- package/vendor/rocksdb/util/file_reader_writer_test.cc +1058 -0
- package/vendor/rocksdb/util/filelock_test.cc +148 -0
- package/vendor/rocksdb/util/filter_bench.cc +840 -0
- package/vendor/rocksdb/util/gflags_compat.h +29 -0
- package/vendor/rocksdb/util/hash.cc +201 -0
- package/vendor/rocksdb/util/hash.h +137 -0
- package/vendor/rocksdb/util/hash128.h +26 -0
- package/vendor/rocksdb/util/hash_containers.h +51 -0
- package/vendor/rocksdb/util/hash_map.h +67 -0
- package/vendor/rocksdb/util/hash_test.cc +853 -0
- package/vendor/rocksdb/util/heap.h +174 -0
- package/vendor/rocksdb/util/heap_test.cc +131 -0
- package/vendor/rocksdb/util/kv_map.h +33 -0
- package/vendor/rocksdb/util/log_write_bench.cc +88 -0
- package/vendor/rocksdb/util/math.h +299 -0
- package/vendor/rocksdb/util/math128.h +316 -0
- package/vendor/rocksdb/util/murmurhash.cc +196 -0
- package/vendor/rocksdb/util/murmurhash.h +43 -0
- package/vendor/rocksdb/util/mutexlock.h +181 -0
- package/vendor/rocksdb/util/ppc-opcode.h +27 -0
- package/vendor/rocksdb/util/random.cc +63 -0
- package/vendor/rocksdb/util/random.h +190 -0
- package/vendor/rocksdb/util/random_test.cc +107 -0
- package/vendor/rocksdb/util/rate_limiter.cc +376 -0
- package/vendor/rocksdb/util/rate_limiter_impl.h +146 -0
- package/vendor/rocksdb/util/rate_limiter_test.cc +520 -0
- package/vendor/rocksdb/util/repeatable_thread.h +149 -0
- package/vendor/rocksdb/util/repeatable_thread_test.cc +111 -0
- package/vendor/rocksdb/util/ribbon_alg.h +1225 -0
- package/vendor/rocksdb/util/ribbon_config.cc +506 -0
- package/vendor/rocksdb/util/ribbon_config.h +182 -0
- package/vendor/rocksdb/util/ribbon_impl.h +1137 -0
- package/vendor/rocksdb/util/ribbon_test.cc +1308 -0
- package/vendor/rocksdb/util/set_comparator.h +24 -0
- package/vendor/rocksdb/util/single_thread_executor.h +56 -0
- package/vendor/rocksdb/util/slice.cc +367 -0
- package/vendor/rocksdb/util/slice_test.cc +252 -0
- package/vendor/rocksdb/util/slice_transform_test.cc +159 -0
- package/vendor/rocksdb/util/status.cc +162 -0
- package/vendor/rocksdb/util/stderr_logger.cc +30 -0
- package/vendor/rocksdb/util/stderr_logger.h +31 -0
- package/vendor/rocksdb/util/stop_watch.h +136 -0
- package/vendor/rocksdb/util/string_util.cc +502 -0
- package/vendor/rocksdb/util/string_util.h +175 -0
- package/vendor/rocksdb/util/thread_guard.h +41 -0
- package/vendor/rocksdb/util/thread_list_test.cc +362 -0
- package/vendor/rocksdb/util/thread_local.cc +521 -0
- package/vendor/rocksdb/util/thread_local.h +100 -0
- package/vendor/rocksdb/util/thread_local_test.cc +578 -0
- package/vendor/rocksdb/util/thread_operation.h +113 -0
- package/vendor/rocksdb/util/threadpool_imp.cc +551 -0
- package/vendor/rocksdb/util/threadpool_imp.h +120 -0
- package/vendor/rocksdb/util/timer.h +340 -0
- package/vendor/rocksdb/util/timer_queue.h +231 -0
- package/vendor/rocksdb/util/timer_queue_test.cc +73 -0
- package/vendor/rocksdb/util/timer_test.cc +402 -0
- package/vendor/rocksdb/util/udt_util.h +77 -0
- package/vendor/rocksdb/util/user_comparator_wrapper.h +64 -0
- package/vendor/rocksdb/util/vector_iterator.h +118 -0
- package/vendor/rocksdb/util/work_queue.h +150 -0
- package/vendor/rocksdb/util/work_queue_test.cc +272 -0
- package/vendor/rocksdb/util/xxhash.cc +48 -0
- package/vendor/rocksdb/util/xxhash.h +6360 -0
- package/vendor/rocksdb/util/xxph3.h +1764 -0
- package/vendor/rocksdb/utilities/agg_merge/agg_merge.cc +238 -0
- package/vendor/rocksdb/utilities/agg_merge/agg_merge_impl.h +49 -0
- package/vendor/rocksdb/utilities/agg_merge/agg_merge_test.cc +135 -0
- package/vendor/rocksdb/utilities/agg_merge/test_agg_merge.cc +104 -0
- package/vendor/rocksdb/utilities/agg_merge/test_agg_merge.h +47 -0
- package/vendor/rocksdb/utilities/backup/backup_engine.cc +3355 -0
- package/vendor/rocksdb/utilities/backup/backup_engine_impl.h +34 -0
- package/vendor/rocksdb/utilities/backup/backup_engine_test.cc +4414 -0
- package/vendor/rocksdb/utilities/blob_db/blob_compaction_filter.cc +488 -0
- package/vendor/rocksdb/utilities/blob_db/blob_compaction_filter.h +202 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db.cc +112 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db.h +264 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_gc_stats.h +54 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_impl.cc +2185 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_impl.h +501 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_impl_filesnapshot.cc +111 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_iterator.h +148 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_listener.h +69 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_test.cc +2430 -0
- package/vendor/rocksdb/utilities/blob_db/blob_dump_tool.cc +280 -0
- package/vendor/rocksdb/utilities/blob_db/blob_dump_tool.h +56 -0
- package/vendor/rocksdb/utilities/blob_db/blob_file.cc +316 -0
- package/vendor/rocksdb/utilities/blob_db/blob_file.h +244 -0
- package/vendor/rocksdb/utilities/cache_dump_load.cc +67 -0
- package/vendor/rocksdb/utilities/cache_dump_load_impl.cc +369 -0
- package/vendor/rocksdb/utilities/cache_dump_load_impl.h +356 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_compaction_filter.cc +106 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_compaction_filter.h +57 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_format_test.cc +377 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_functional_test.cc +444 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_options.h +41 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_row_merge_test.cc +98 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_serialize_test.cc +164 -0
- package/vendor/rocksdb/utilities/cassandra/format.cc +367 -0
- package/vendor/rocksdb/utilities/cassandra/format.h +183 -0
- package/vendor/rocksdb/utilities/cassandra/merge_operator.cc +80 -0
- package/vendor/rocksdb/utilities/cassandra/merge_operator.h +44 -0
- package/vendor/rocksdb/utilities/cassandra/serialize.h +81 -0
- package/vendor/rocksdb/utilities/cassandra/test_utils.cc +69 -0
- package/vendor/rocksdb/utilities/cassandra/test_utils.h +42 -0
- package/vendor/rocksdb/utilities/checkpoint/checkpoint_impl.cc +470 -0
- package/vendor/rocksdb/utilities/checkpoint/checkpoint_impl.h +64 -0
- package/vendor/rocksdb/utilities/checkpoint/checkpoint_test.cc +988 -0
- package/vendor/rocksdb/utilities/compaction_filters/layered_compaction_filter_base.h +41 -0
- package/vendor/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc +24 -0
- package/vendor/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.h +26 -0
- package/vendor/rocksdb/utilities/compaction_filters.cc +52 -0
- package/vendor/rocksdb/utilities/convenience/info_log_finder.cc +26 -0
- package/vendor/rocksdb/utilities/counted_fs.cc +379 -0
- package/vendor/rocksdb/utilities/counted_fs.h +158 -0
- package/vendor/rocksdb/utilities/debug.cc +118 -0
- package/vendor/rocksdb/utilities/env_mirror.cc +273 -0
- package/vendor/rocksdb/utilities/env_mirror_test.cc +216 -0
- package/vendor/rocksdb/utilities/env_timed.cc +181 -0
- package/vendor/rocksdb/utilities/env_timed.h +95 -0
- package/vendor/rocksdb/utilities/env_timed_test.cc +34 -0
- package/vendor/rocksdb/utilities/fault_injection_env.cc +555 -0
- package/vendor/rocksdb/utilities/fault_injection_env.h +258 -0
- package/vendor/rocksdb/utilities/fault_injection_fs.cc +1071 -0
- package/vendor/rocksdb/utilities/fault_injection_fs.h +593 -0
- package/vendor/rocksdb/utilities/fault_injection_secondary_cache.cc +136 -0
- package/vendor/rocksdb/utilities/fault_injection_secondary_cache.h +109 -0
- package/vendor/rocksdb/utilities/leveldb_options/leveldb_options.cc +57 -0
- package/vendor/rocksdb/utilities/memory/memory_test.cc +269 -0
- package/vendor/rocksdb/utilities/memory/memory_util.cc +50 -0
- package/vendor/rocksdb/utilities/memory_allocators.h +103 -0
- package/vendor/rocksdb/utilities/merge_operators/bytesxor.cc +57 -0
- package/vendor/rocksdb/utilities/merge_operators/bytesxor.h +40 -0
- package/vendor/rocksdb/utilities/merge_operators/max.cc +64 -0
- package/vendor/rocksdb/utilities/merge_operators/max_operator.h +35 -0
- package/vendor/rocksdb/utilities/merge_operators/put.cc +74 -0
- package/vendor/rocksdb/utilities/merge_operators/put_operator.h +56 -0
- package/vendor/rocksdb/utilities/merge_operators/sortlist.cc +95 -0
- package/vendor/rocksdb/utilities/merge_operators/sortlist.h +42 -0
- package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend.cc +76 -0
- package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend.h +32 -0
- package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend2.cc +130 -0
- package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend2.h +52 -0
- package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend_test.cc +636 -0
- package/vendor/rocksdb/utilities/merge_operators/uint64add.cc +56 -0
- package/vendor/rocksdb/utilities/merge_operators/uint64add.h +35 -0
- package/vendor/rocksdb/utilities/merge_operators.cc +115 -0
- package/vendor/rocksdb/utilities/merge_operators.h +36 -0
- package/vendor/rocksdb/utilities/object_registry.cc +381 -0
- package/vendor/rocksdb/utilities/object_registry_test.cc +862 -0
- package/vendor/rocksdb/utilities/option_change_migration/option_change_migration.cc +176 -0
- package/vendor/rocksdb/utilities/option_change_migration/option_change_migration_test.cc +548 -0
- package/vendor/rocksdb/utilities/options/options_util.cc +117 -0
- package/vendor/rocksdb/utilities/options/options_util_test.cc +782 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier.cc +420 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier.h +154 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file.cc +608 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file.h +291 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file_buffer.h +127 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_metadata.cc +84 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_metadata.h +122 -0
- package/vendor/rocksdb/utilities/persistent_cache/hash_table.h +237 -0
- package/vendor/rocksdb/utilities/persistent_cache/hash_table_bench.cc +310 -0
- package/vendor/rocksdb/utilities/persistent_cache/hash_table_evictable.h +166 -0
- package/vendor/rocksdb/utilities/persistent_cache/hash_table_test.cc +161 -0
- package/vendor/rocksdb/utilities/persistent_cache/lrulist.h +172 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_bench.cc +355 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_test.cc +413 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_test.h +284 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_tier.cc +165 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_tier.h +340 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_util.h +67 -0
- package/vendor/rocksdb/utilities/persistent_cache/volatile_tier_impl.cc +138 -0
- package/vendor/rocksdb/utilities/persistent_cache/volatile_tier_impl.h +139 -0
- package/vendor/rocksdb/utilities/simulator_cache/cache_simulator.cc +287 -0
- package/vendor/rocksdb/utilities/simulator_cache/cache_simulator.h +231 -0
- package/vendor/rocksdb/utilities/simulator_cache/cache_simulator_test.cc +497 -0
- package/vendor/rocksdb/utilities/simulator_cache/sim_cache.cc +372 -0
- package/vendor/rocksdb/utilities/simulator_cache/sim_cache_test.cc +226 -0
- package/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.cc +221 -0
- package/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.h +68 -0
- package/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector_test.cc +238 -0
- package/vendor/rocksdb/utilities/trace/file_trace_reader_writer.cc +133 -0
- package/vendor/rocksdb/utilities/trace/file_trace_reader_writer.h +48 -0
- package/vendor/rocksdb/utilities/trace/replayer_impl.cc +314 -0
- package/vendor/rocksdb/utilities/trace/replayer_impl.h +84 -0
- package/vendor/rocksdb/utilities/transactions/lock/lock_manager.cc +27 -0
- package/vendor/rocksdb/utilities/transactions/lock/lock_manager.h +80 -0
- package/vendor/rocksdb/utilities/transactions/lock/lock_tracker.h +207 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager.cc +719 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager.h +222 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager_test.cc +170 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager_test.h +324 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_tracker.cc +255 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_tracker.h +97 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_lock_manager.h +34 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_locking_test.cc +448 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.AGPLv3 +661 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.APACHEv2 +174 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.GPLv2 +339 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/README +13 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/db.h +76 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/ft/comparator.h +138 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/ft/ft-status.h +102 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.cc +137 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.h +174 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.cc +220 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.h +141 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc +525 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.h +255 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.cc +1021 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.h +580 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/manager.cc +525 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.cc +263 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.h +178 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.cc +518 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.h +302 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.cc +118 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.h +92 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.cc +211 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.h +124 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/memory.h +215 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_assert_subst.h +39 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_atomic.h +130 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_external_pthread.h +83 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_instrumentation.h +286 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_portability.h +87 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_pthread.h +520 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_race_tools.h +179 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h +197 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/txn_subst.h +27 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/standalone_port.cc +130 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/dbt.cc +151 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/dbt.h +98 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/growable_array.h +144 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/memarena.cc +199 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/memarena.h +141 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/omt.h +794 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/omt_impl.h +1295 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/partitioned_counter.h +165 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/status.h +76 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.cc +501 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.h +135 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.cc +154 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.h +146 -0
- package/vendor/rocksdb/utilities/transactions/optimistic_transaction.cc +194 -0
- package/vendor/rocksdb/utilities/transactions/optimistic_transaction.h +99 -0
- package/vendor/rocksdb/utilities/transactions/optimistic_transaction_db_impl.cc +109 -0
- package/vendor/rocksdb/utilities/transactions/optimistic_transaction_db_impl.h +86 -0
- package/vendor/rocksdb/utilities/transactions/optimistic_transaction_test.cc +1479 -0
- package/vendor/rocksdb/utilities/transactions/pessimistic_transaction.cc +1177 -0
- package/vendor/rocksdb/utilities/transactions/pessimistic_transaction.h +311 -0
- package/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.cc +780 -0
- package/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.h +316 -0
- package/vendor/rocksdb/utilities/transactions/snapshot_checker.cc +37 -0
- package/vendor/rocksdb/utilities/transactions/timestamped_snapshot_test.cc +457 -0
- package/vendor/rocksdb/utilities/transactions/transaction_base.cc +757 -0
- package/vendor/rocksdb/utilities/transactions/transaction_base.h +382 -0
- package/vendor/rocksdb/utilities/transactions/transaction_db_mutex_impl.cc +133 -0
- package/vendor/rocksdb/utilities/transactions/transaction_db_mutex_impl.h +24 -0
- package/vendor/rocksdb/utilities/transactions/transaction_test.cc +6751 -0
- package/vendor/rocksdb/utilities/transactions/transaction_test.h +578 -0
- package/vendor/rocksdb/utilities/transactions/transaction_util.cc +204 -0
- package/vendor/rocksdb/utilities/transactions/transaction_util.h +83 -0
- package/vendor/rocksdb/utilities/transactions/write_committed_transaction_ts_test.cc +578 -0
- package/vendor/rocksdb/utilities/transactions/write_prepared_transaction_test.cc +4066 -0
- package/vendor/rocksdb/utilities/transactions/write_prepared_txn.cc +515 -0
- package/vendor/rocksdb/utilities/transactions/write_prepared_txn.h +117 -0
- package/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.cc +1038 -0
- package/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.h +1123 -0
- package/vendor/rocksdb/utilities/transactions/write_unprepared_transaction_test.cc +779 -0
- package/vendor/rocksdb/utilities/transactions/write_unprepared_txn.cc +1056 -0
- package/vendor/rocksdb/utilities/transactions/write_unprepared_txn.h +339 -0
- package/vendor/rocksdb/utilities/transactions/write_unprepared_txn_db.cc +476 -0
- package/vendor/rocksdb/utilities/transactions/write_unprepared_txn_db.h +106 -0
- package/vendor/rocksdb/utilities/ttl/db_ttl_impl.cc +617 -0
- package/vendor/rocksdb/utilities/ttl/db_ttl_impl.h +243 -0
- package/vendor/rocksdb/utilities/ttl/ttl_test.cc +913 -0
- package/vendor/rocksdb/utilities/util_merge_operators_test.cc +100 -0
- package/vendor/rocksdb/utilities/wal_filter.cc +22 -0
- package/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc +694 -0
- package/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc +742 -0
- package/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.h +342 -0
- package/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_test.cc +2409 -0
|
@@ -0,0 +1,3414 @@
|
|
|
1
|
+
// Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
|
|
2
|
+
// This source code is licensed under both the GPLv2 (found in the
|
|
3
|
+
// COPYING file in the root directory) and Apache 2.0 License
|
|
4
|
+
// (found in the LICENSE.Apache file in the root directory).
|
|
5
|
+
|
|
6
|
+
#include "db/db_test_util.h"
|
|
7
|
+
#include "db/version_set.h"
|
|
8
|
+
#include "port/stack_trace.h"
|
|
9
|
+
#include "rocksdb/utilities/write_batch_with_index.h"
|
|
10
|
+
#include "test_util/testutil.h"
|
|
11
|
+
#include "util/random.h"
|
|
12
|
+
#include "utilities/merge_operators.h"
|
|
13
|
+
|
|
14
|
+
namespace ROCKSDB_NAMESPACE {
|
|
15
|
+
|
|
16
|
+
// TODO(cbi): parameterize the test to cover user-defined timestamp cases
|
|
17
|
+
class DBRangeDelTest : public DBTestBase {
|
|
18
|
+
public:
|
|
19
|
+
DBRangeDelTest() : DBTestBase("db_range_del_test", /*env_do_fsync=*/false) {}
|
|
20
|
+
|
|
21
|
+
std::string GetNumericStr(int key) {
|
|
22
|
+
uint64_t uint64_key = static_cast<uint64_t>(key);
|
|
23
|
+
std::string str;
|
|
24
|
+
str.resize(8);
|
|
25
|
+
memcpy(&str[0], static_cast<void*>(&uint64_key), 8);
|
|
26
|
+
return str;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
TEST_F(DBRangeDelTest, NonBlockBasedTableNotSupported) {
|
|
31
|
+
// TODO: figure out why MmapReads trips the iterator pinning assertion in
|
|
32
|
+
// RangeDelAggregator. Ideally it would be supported; otherwise it should at
|
|
33
|
+
// least be explicitly unsupported.
|
|
34
|
+
for (auto config : {kPlainTableAllBytesPrefix, /* kWalDirAndMmapReads */}) {
|
|
35
|
+
option_config_ = config;
|
|
36
|
+
DestroyAndReopen(CurrentOptions());
|
|
37
|
+
ASSERT_TRUE(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
38
|
+
"dr1", "dr1")
|
|
39
|
+
.IsNotSupported());
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
TEST_F(DBRangeDelTest, WriteBatchWithIndexNotSupported) {
|
|
44
|
+
WriteBatchWithIndex indexedBatch{};
|
|
45
|
+
ASSERT_TRUE(indexedBatch.DeleteRange(db_->DefaultColumnFamily(), "dr1", "dr1")
|
|
46
|
+
.IsNotSupported());
|
|
47
|
+
ASSERT_TRUE(indexedBatch.DeleteRange("dr1", "dr1").IsNotSupported());
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
TEST_F(DBRangeDelTest, EndSameAsStartCoversNothing) {
|
|
51
|
+
ASSERT_OK(db_->Put(WriteOptions(), "b", "val"));
|
|
52
|
+
ASSERT_OK(
|
|
53
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "b", "b"));
|
|
54
|
+
ASSERT_EQ("val", Get("b"));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
TEST_F(DBRangeDelTest, EndComesBeforeStartInvalidArgument) {
|
|
58
|
+
ASSERT_OK(db_->Put(WriteOptions(), "b", "val"));
|
|
59
|
+
ASSERT_TRUE(
|
|
60
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "b", "a")
|
|
61
|
+
.IsInvalidArgument());
|
|
62
|
+
ASSERT_EQ("val", Get("b"));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
TEST_F(DBRangeDelTest, FlushOutputHasOnlyRangeTombstones) {
|
|
66
|
+
do {
|
|
67
|
+
DestroyAndReopen(CurrentOptions());
|
|
68
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
69
|
+
"dr1", "dr2"));
|
|
70
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
71
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
72
|
+
} while (ChangeOptions(kRangeDelSkipConfigs));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
TEST_F(DBRangeDelTest, DictionaryCompressionWithOnlyRangeTombstones) {
|
|
76
|
+
Options opts = CurrentOptions();
|
|
77
|
+
opts.compression_opts.max_dict_bytes = 16384;
|
|
78
|
+
Reopen(opts);
|
|
79
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "dr1",
|
|
80
|
+
"dr2"));
|
|
81
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
TEST_F(DBRangeDelTest, CompactionOutputHasOnlyRangeTombstone) {
|
|
85
|
+
do {
|
|
86
|
+
Options opts = CurrentOptions();
|
|
87
|
+
opts.disable_auto_compactions = true;
|
|
88
|
+
opts.statistics = CreateDBStatistics();
|
|
89
|
+
DestroyAndReopen(opts);
|
|
90
|
+
|
|
91
|
+
// snapshot protects range tombstone from dropping due to becoming obsolete.
|
|
92
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
93
|
+
ASSERT_OK(
|
|
94
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
95
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
96
|
+
|
|
97
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
98
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(1));
|
|
99
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr, nullptr,
|
|
100
|
+
true /* disallow_trivial_move */));
|
|
101
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
102
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
103
|
+
ASSERT_EQ(0, TestGetTickerCount(opts, COMPACTION_RANGE_DEL_DROP_OBSOLETE));
|
|
104
|
+
db_->ReleaseSnapshot(snapshot);
|
|
105
|
+
// Skip cuckoo memtables, which do not support snapshots. Skip non-leveled
|
|
106
|
+
// compactions as the above assertions about the number of files in a level
|
|
107
|
+
// do not hold true.
|
|
108
|
+
} while (ChangeOptions(kRangeDelSkipConfigs | kSkipUniversalCompaction |
|
|
109
|
+
kSkipFIFOCompaction));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
TEST_F(DBRangeDelTest, CompactionOutputFilesExactlyFilled) {
|
|
113
|
+
// regression test for exactly filled compaction output files. Previously
|
|
114
|
+
// another file would be generated containing all range deletions, which
|
|
115
|
+
// could invalidate the non-overlapping file boundary invariant.
|
|
116
|
+
const int kNumPerFile = 4, kNumFiles = 2, kFileBytes = 9 << 10;
|
|
117
|
+
Options options = CurrentOptions();
|
|
118
|
+
options.disable_auto_compactions = true;
|
|
119
|
+
options.level0_file_num_compaction_trigger = kNumFiles;
|
|
120
|
+
options.memtable_factory.reset(test::NewSpecialSkipListFactory(kNumPerFile));
|
|
121
|
+
options.num_levels = 2;
|
|
122
|
+
options.target_file_size_base = kFileBytes;
|
|
123
|
+
BlockBasedTableOptions table_options;
|
|
124
|
+
table_options.block_size_deviation = 50; // each block holds two keys
|
|
125
|
+
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
|
126
|
+
Reopen(options);
|
|
127
|
+
|
|
128
|
+
// snapshot protects range tombstone from dropping due to becoming obsolete.
|
|
129
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
130
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(0),
|
|
131
|
+
Key(1)));
|
|
132
|
+
|
|
133
|
+
Random rnd(301);
|
|
134
|
+
for (int i = 0; i < kNumFiles; ++i) {
|
|
135
|
+
std::vector<std::string> values;
|
|
136
|
+
// Write 12K (4 values, each 3K)
|
|
137
|
+
for (int j = 0; j < kNumPerFile; j++) {
|
|
138
|
+
values.push_back(rnd.RandomString(3 << 10));
|
|
139
|
+
ASSERT_OK(Put(Key(i * kNumPerFile + j), values[j]));
|
|
140
|
+
if (j == 0 && i > 0) {
|
|
141
|
+
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable());
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// put extra key to trigger final flush
|
|
146
|
+
ASSERT_OK(Put("", ""));
|
|
147
|
+
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable());
|
|
148
|
+
ASSERT_EQ(kNumFiles, NumTableFilesAtLevel(0));
|
|
149
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(1));
|
|
150
|
+
|
|
151
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr, nullptr,
|
|
152
|
+
true /* disallow_trivial_move */));
|
|
153
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
154
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
155
|
+
db_->ReleaseSnapshot(snapshot);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
TEST_F(DBRangeDelTest, MaxCompactionBytesCutsOutputFiles) {
|
|
159
|
+
// Ensures range deletion spanning multiple compaction output files that are
|
|
160
|
+
// cut by max_compaction_bytes will have non-overlapping key-ranges.
|
|
161
|
+
// https://github.com/facebook/rocksdb/issues/1778
|
|
162
|
+
const int kNumFiles = 2, kNumPerFile = 1 << 8, kBytesPerVal = 1 << 12;
|
|
163
|
+
Options opts = CurrentOptions();
|
|
164
|
+
opts.comparator = test::Uint64Comparator();
|
|
165
|
+
opts.disable_auto_compactions = true;
|
|
166
|
+
opts.level0_file_num_compaction_trigger = kNumFiles;
|
|
167
|
+
opts.max_compaction_bytes = kNumPerFile * kBytesPerVal;
|
|
168
|
+
opts.memtable_factory.reset(test::NewSpecialSkipListFactory(kNumPerFile));
|
|
169
|
+
// Want max_compaction_bytes to trigger the end of compaction output file, not
|
|
170
|
+
// target_file_size_base, so make the latter much bigger
|
|
171
|
+
// opts.target_file_size_base = 100 * opts.max_compaction_bytes;
|
|
172
|
+
opts.target_file_size_base = 1;
|
|
173
|
+
DestroyAndReopen(opts);
|
|
174
|
+
|
|
175
|
+
// snapshot protects range tombstone from dropping due to becoming obsolete.
|
|
176
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
177
|
+
|
|
178
|
+
Random rnd(301);
|
|
179
|
+
|
|
180
|
+
ASSERT_OK(Put(GetNumericStr(0), rnd.RandomString(kBytesPerVal)));
|
|
181
|
+
ASSERT_OK(
|
|
182
|
+
Put(GetNumericStr(kNumPerFile - 1), rnd.RandomString(kBytesPerVal)));
|
|
183
|
+
ASSERT_OK(Flush());
|
|
184
|
+
ASSERT_OK(Put(GetNumericStr(kNumPerFile), rnd.RandomString(kBytesPerVal)));
|
|
185
|
+
ASSERT_OK(
|
|
186
|
+
Put(GetNumericStr(kNumPerFile * 2 - 1), rnd.RandomString(kBytesPerVal)));
|
|
187
|
+
ASSERT_OK(Flush());
|
|
188
|
+
MoveFilesToLevel(2);
|
|
189
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
190
|
+
ASSERT_EQ(NumTableFilesAtLevel(2), 2);
|
|
191
|
+
|
|
192
|
+
ASSERT_OK(
|
|
193
|
+
db_->SetOptions(db_->DefaultColumnFamily(),
|
|
194
|
+
{{"target_file_size_base",
|
|
195
|
+
std::to_string(100 * opts.max_compaction_bytes)}}));
|
|
196
|
+
|
|
197
|
+
// It spans the whole key-range, thus will be included in all output files
|
|
198
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
199
|
+
GetNumericStr(0),
|
|
200
|
+
GetNumericStr(kNumFiles * kNumPerFile - 1)));
|
|
201
|
+
|
|
202
|
+
for (int i = 0; i < kNumFiles; ++i) {
|
|
203
|
+
std::vector<std::string> values;
|
|
204
|
+
// Write 1MB (256 values, each 4K)
|
|
205
|
+
for (int j = 0; j < kNumPerFile; j++) {
|
|
206
|
+
values.push_back(rnd.RandomString(kBytesPerVal));
|
|
207
|
+
ASSERT_OK(Put(GetNumericStr(kNumPerFile * i + j), values[j]));
|
|
208
|
+
}
|
|
209
|
+
// extra entry to trigger SpecialSkipListFactory's flush
|
|
210
|
+
ASSERT_OK(Put(GetNumericStr(kNumPerFile), ""));
|
|
211
|
+
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable());
|
|
212
|
+
ASSERT_EQ(i + 1, NumTableFilesAtLevel(0));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr,
|
|
216
|
+
/*column_family=*/nullptr,
|
|
217
|
+
/*disallow_trivial_move=*/true));
|
|
218
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
219
|
+
ASSERT_GE(NumTableFilesAtLevel(1), 2);
|
|
220
|
+
std::vector<std::vector<FileMetaData>> files;
|
|
221
|
+
dbfull()->TEST_GetFilesMetaData(db_->DefaultColumnFamily(), &files);
|
|
222
|
+
|
|
223
|
+
for (size_t i = 0; i + 1 < files[1].size(); ++i) {
|
|
224
|
+
ASSERT_TRUE(InternalKeyComparator(opts.comparator)
|
|
225
|
+
.Compare(files[1][i].largest, files[1][i + 1].smallest) <
|
|
226
|
+
0);
|
|
227
|
+
}
|
|
228
|
+
db_->ReleaseSnapshot(snapshot);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
TEST_F(DBRangeDelTest, SentinelsOmittedFromOutputFile) {
|
|
232
|
+
// Regression test for bug where sentinel range deletions (i.e., ones with
|
|
233
|
+
// sequence number of zero) were included in output files.
|
|
234
|
+
// snapshot protects range tombstone from dropping due to becoming obsolete.
|
|
235
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
236
|
+
|
|
237
|
+
// gaps between ranges creates sentinels in our internal representation
|
|
238
|
+
std::vector<std::pair<std::string, std::string>> range_dels = {
|
|
239
|
+
{"a", "b"}, {"c", "d"}, {"e", "f"}};
|
|
240
|
+
for (const auto& range_del : range_dels) {
|
|
241
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
242
|
+
range_del.first, range_del.second));
|
|
243
|
+
}
|
|
244
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
245
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
246
|
+
|
|
247
|
+
std::vector<std::vector<FileMetaData>> files;
|
|
248
|
+
dbfull()->TEST_GetFilesMetaData(db_->DefaultColumnFamily(), &files);
|
|
249
|
+
ASSERT_GT(files[0][0].fd.smallest_seqno, 0);
|
|
250
|
+
|
|
251
|
+
db_->ReleaseSnapshot(snapshot);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
TEST_F(DBRangeDelTest, FlushRangeDelsSameStartKey) {
|
|
255
|
+
ASSERT_OK(db_->Put(WriteOptions(), "b1", "val"));
|
|
256
|
+
ASSERT_OK(
|
|
257
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "c"));
|
|
258
|
+
ASSERT_OK(db_->Put(WriteOptions(), "b2", "val"));
|
|
259
|
+
ASSERT_OK(
|
|
260
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "b"));
|
|
261
|
+
// first iteration verifies query correctness in memtable, second verifies
|
|
262
|
+
// query correctness for a single SST file
|
|
263
|
+
for (int i = 0; i < 2; ++i) {
|
|
264
|
+
if (i > 0) {
|
|
265
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
266
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
267
|
+
}
|
|
268
|
+
std::string value;
|
|
269
|
+
ASSERT_TRUE(db_->Get(ReadOptions(), "b1", &value).IsNotFound());
|
|
270
|
+
ASSERT_OK(db_->Get(ReadOptions(), "b2", &value));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
TEST_F(DBRangeDelTest, CompactRangeDelsSameStartKey) {
|
|
275
|
+
ASSERT_OK(db_->Put(WriteOptions(), "unused",
|
|
276
|
+
"val")); // prevents empty after compaction
|
|
277
|
+
ASSERT_OK(db_->Put(WriteOptions(), "b1", "val"));
|
|
278
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
279
|
+
ASSERT_OK(
|
|
280
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "c"));
|
|
281
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
282
|
+
ASSERT_OK(
|
|
283
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "b"));
|
|
284
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
285
|
+
ASSERT_EQ(3, NumTableFilesAtLevel(0));
|
|
286
|
+
|
|
287
|
+
for (int i = 0; i < 2; ++i) {
|
|
288
|
+
if (i > 0) {
|
|
289
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr, nullptr,
|
|
290
|
+
true /* disallow_trivial_move */));
|
|
291
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
292
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
293
|
+
}
|
|
294
|
+
std::string value;
|
|
295
|
+
ASSERT_TRUE(db_->Get(ReadOptions(), "b1", &value).IsNotFound());
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
TEST_F(DBRangeDelTest, FlushRemovesCoveredKeys) {
|
|
300
|
+
const int kNum = 300, kRangeBegin = 50, kRangeEnd = 250;
|
|
301
|
+
Options opts = CurrentOptions();
|
|
302
|
+
opts.comparator = test::Uint64Comparator();
|
|
303
|
+
DestroyAndReopen(opts);
|
|
304
|
+
|
|
305
|
+
// Write a third before snapshot, a third between snapshot and tombstone, and
|
|
306
|
+
// a third after the tombstone. Keys older than snapshot or newer than the
|
|
307
|
+
// tombstone should be preserved.
|
|
308
|
+
const Snapshot* snapshot = nullptr;
|
|
309
|
+
for (int i = 0; i < kNum; ++i) {
|
|
310
|
+
if (i == kNum / 3) {
|
|
311
|
+
snapshot = db_->GetSnapshot();
|
|
312
|
+
} else if (i == 2 * kNum / 3) {
|
|
313
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
314
|
+
GetNumericStr(kRangeBegin),
|
|
315
|
+
GetNumericStr(kRangeEnd)));
|
|
316
|
+
}
|
|
317
|
+
ASSERT_OK(db_->Put(WriteOptions(), GetNumericStr(i), "val"));
|
|
318
|
+
}
|
|
319
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
320
|
+
|
|
321
|
+
for (int i = 0; i < kNum; ++i) {
|
|
322
|
+
ReadOptions read_opts;
|
|
323
|
+
read_opts.ignore_range_deletions = true;
|
|
324
|
+
std::string value;
|
|
325
|
+
if (i < kRangeBegin || i > kRangeEnd || i < kNum / 3 || i >= 2 * kNum / 3) {
|
|
326
|
+
ASSERT_OK(db_->Get(read_opts, GetNumericStr(i), &value));
|
|
327
|
+
} else {
|
|
328
|
+
ASSERT_TRUE(db_->Get(read_opts, GetNumericStr(i), &value).IsNotFound());
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
db_->ReleaseSnapshot(snapshot);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
TEST_F(DBRangeDelTest, CompactionRemovesCoveredKeys) {
|
|
335
|
+
const int kNumPerFile = 100, kNumFiles = 4;
|
|
336
|
+
Options opts = CurrentOptions();
|
|
337
|
+
opts.comparator = test::Uint64Comparator();
|
|
338
|
+
opts.disable_auto_compactions = true;
|
|
339
|
+
opts.memtable_factory.reset(test::NewSpecialSkipListFactory(kNumPerFile));
|
|
340
|
+
opts.num_levels = 2;
|
|
341
|
+
opts.statistics = CreateDBStatistics();
|
|
342
|
+
DestroyAndReopen(opts);
|
|
343
|
+
|
|
344
|
+
for (int i = 0; i < kNumFiles; ++i) {
|
|
345
|
+
if (i > 0) {
|
|
346
|
+
// range tombstone covers first half of the previous file
|
|
347
|
+
ASSERT_OK(db_->DeleteRange(
|
|
348
|
+
WriteOptions(), db_->DefaultColumnFamily(),
|
|
349
|
+
GetNumericStr((i - 1) * kNumPerFile),
|
|
350
|
+
GetNumericStr((i - 1) * kNumPerFile + kNumPerFile / 2)));
|
|
351
|
+
}
|
|
352
|
+
// Make sure a given key appears in each file so compaction won't be able to
|
|
353
|
+
// use trivial move, which would happen if the ranges were non-overlapping.
|
|
354
|
+
// Also, we need an extra element since flush is only triggered when the
|
|
355
|
+
// number of keys is one greater than SpecialSkipListFactory's limit.
|
|
356
|
+
// We choose a key outside the key-range used by the test to avoid conflict.
|
|
357
|
+
ASSERT_OK(db_->Put(WriteOptions(), GetNumericStr(kNumPerFile * kNumFiles),
|
|
358
|
+
"val"));
|
|
359
|
+
|
|
360
|
+
for (int j = 0; j < kNumPerFile; ++j) {
|
|
361
|
+
ASSERT_OK(
|
|
362
|
+
db_->Put(WriteOptions(), GetNumericStr(i * kNumPerFile + j), "val"));
|
|
363
|
+
}
|
|
364
|
+
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable());
|
|
365
|
+
ASSERT_EQ(i + 1, NumTableFilesAtLevel(0));
|
|
366
|
+
}
|
|
367
|
+
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), nullptr, nullptr));
|
|
368
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
369
|
+
ASSERT_GT(NumTableFilesAtLevel(1), 0);
|
|
370
|
+
ASSERT_EQ((kNumFiles - 1) * kNumPerFile / 2,
|
|
371
|
+
TestGetTickerCount(opts, COMPACTION_KEY_DROP_RANGE_DEL));
|
|
372
|
+
|
|
373
|
+
for (int i = 0; i < kNumFiles; ++i) {
|
|
374
|
+
for (int j = 0; j < kNumPerFile; ++j) {
|
|
375
|
+
ReadOptions read_opts;
|
|
376
|
+
read_opts.ignore_range_deletions = true;
|
|
377
|
+
std::string value;
|
|
378
|
+
if (i == kNumFiles - 1 || j >= kNumPerFile / 2) {
|
|
379
|
+
ASSERT_OK(
|
|
380
|
+
db_->Get(read_opts, GetNumericStr(i * kNumPerFile + j), &value));
|
|
381
|
+
} else {
|
|
382
|
+
ASSERT_TRUE(
|
|
383
|
+
db_->Get(read_opts, GetNumericStr(i * kNumPerFile + j), &value)
|
|
384
|
+
.IsNotFound());
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
TEST_F(DBRangeDelTest, ValidLevelSubcompactionBoundaries) {
|
|
391
|
+
const int kNumPerFile = 100, kNumFiles = 4, kFileBytes = 100 << 10;
|
|
392
|
+
Options options = CurrentOptions();
|
|
393
|
+
options.disable_auto_compactions = true;
|
|
394
|
+
options.level0_file_num_compaction_trigger = kNumFiles;
|
|
395
|
+
options.max_bytes_for_level_base = 2 * kFileBytes;
|
|
396
|
+
options.max_subcompactions = 4;
|
|
397
|
+
options.memtable_factory.reset(test::NewSpecialSkipListFactory(kNumPerFile));
|
|
398
|
+
options.num_levels = 3;
|
|
399
|
+
options.target_file_size_base = kFileBytes;
|
|
400
|
+
options.target_file_size_multiplier = 1;
|
|
401
|
+
options.max_compaction_bytes = 1500;
|
|
402
|
+
Reopen(options);
|
|
403
|
+
|
|
404
|
+
Random rnd(301);
|
|
405
|
+
for (int i = 0; i < 2; ++i) {
|
|
406
|
+
for (int j = 0; j < kNumFiles; ++j) {
|
|
407
|
+
if (i > 0) {
|
|
408
|
+
// delete [95,105) in two files, [295,305) in next two
|
|
409
|
+
int mid = (j + (1 - j % 2)) * kNumPerFile;
|
|
410
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
411
|
+
Key(mid - 5), Key(mid + 5)));
|
|
412
|
+
}
|
|
413
|
+
std::vector<std::string> values;
|
|
414
|
+
// Write 100KB (100 values, each 1K)
|
|
415
|
+
for (int k = 0; k < kNumPerFile; k++) {
|
|
416
|
+
values.push_back(rnd.RandomString(990));
|
|
417
|
+
ASSERT_OK(Put(Key(j * kNumPerFile + k), values[k]));
|
|
418
|
+
}
|
|
419
|
+
// put extra key to trigger flush
|
|
420
|
+
ASSERT_OK(Put("", ""));
|
|
421
|
+
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable());
|
|
422
|
+
if (j < kNumFiles - 1) {
|
|
423
|
+
// background compaction may happen early for kNumFiles'th file
|
|
424
|
+
ASSERT_EQ(NumTableFilesAtLevel(0), j + 1);
|
|
425
|
+
}
|
|
426
|
+
if (j == options.level0_file_num_compaction_trigger - 1) {
|
|
427
|
+
// When i == 1, compaction will output some files to L1, at which point
|
|
428
|
+
// L1 is not bottommost so range deletions cannot be compacted away. The
|
|
429
|
+
// new L1 files must be generated with non-overlapping key ranges even
|
|
430
|
+
// though multiple subcompactions see the same ranges deleted, else an
|
|
431
|
+
// assertion will fail.
|
|
432
|
+
//
|
|
433
|
+
// Only enable auto-compactions when we're ready; otherwise, the
|
|
434
|
+
// oversized L0 (relative to base_level) causes the compaction to run
|
|
435
|
+
// earlier.
|
|
436
|
+
ASSERT_OK(db_->EnableAutoCompaction({db_->DefaultColumnFamily()}));
|
|
437
|
+
ASSERT_OK(dbfull()->TEST_WaitForCompact());
|
|
438
|
+
ASSERT_OK(db_->SetOptions(db_->DefaultColumnFamily(),
|
|
439
|
+
{{"disable_auto_compactions", "true"}}));
|
|
440
|
+
ASSERT_EQ(NumTableFilesAtLevel(0), 0);
|
|
441
|
+
ASSERT_GT(NumTableFilesAtLevel(1), 0);
|
|
442
|
+
ASSERT_GT(NumTableFilesAtLevel(2), 0);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
TEST_F(DBRangeDelTest, ValidUniversalSubcompactionBoundaries) {
|
|
449
|
+
const int kNumPerFile = 100, kFilesPerLevel = 4, kNumLevels = 4;
|
|
450
|
+
Options options = CurrentOptions();
|
|
451
|
+
options.compaction_options_universal.min_merge_width = kFilesPerLevel;
|
|
452
|
+
options.compaction_options_universal.max_merge_width = kFilesPerLevel;
|
|
453
|
+
options.compaction_options_universal.size_ratio = 10;
|
|
454
|
+
options.compaction_style = kCompactionStyleUniversal;
|
|
455
|
+
options.level0_file_num_compaction_trigger = kFilesPerLevel;
|
|
456
|
+
options.max_subcompactions = 4;
|
|
457
|
+
options.memtable_factory.reset(test::NewSpecialSkipListFactory(kNumPerFile));
|
|
458
|
+
options.num_levels = kNumLevels;
|
|
459
|
+
options.target_file_size_base = kNumPerFile << 10;
|
|
460
|
+
options.target_file_size_multiplier = 1;
|
|
461
|
+
Reopen(options);
|
|
462
|
+
|
|
463
|
+
Random rnd(301);
|
|
464
|
+
for (int i = 0; i < kNumLevels - 1; ++i) {
|
|
465
|
+
for (int j = 0; j < kFilesPerLevel; ++j) {
|
|
466
|
+
if (i == kNumLevels - 2) {
|
|
467
|
+
// insert range deletions [95,105) in two files, [295,305) in next two
|
|
468
|
+
// to prepare L1 for later manual compaction.
|
|
469
|
+
int mid = (j + (1 - j % 2)) * kNumPerFile;
|
|
470
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
471
|
+
Key(mid - 5), Key(mid + 5)));
|
|
472
|
+
}
|
|
473
|
+
std::vector<std::string> values;
|
|
474
|
+
// Write 100KB (100 values, each 1K)
|
|
475
|
+
for (int k = 0; k < kNumPerFile; k++) {
|
|
476
|
+
// For the highest level, use smaller value size such that it does not
|
|
477
|
+
// prematurely cause auto compaction due to range tombstone adding
|
|
478
|
+
// additional compensated file size
|
|
479
|
+
values.push_back(rnd.RandomString((i == kNumLevels - 2) ? 600 : 990));
|
|
480
|
+
ASSERT_OK(Put(Key(j * kNumPerFile + k), values[k]));
|
|
481
|
+
}
|
|
482
|
+
// put extra key to trigger flush
|
|
483
|
+
ASSERT_OK(Put("", ""));
|
|
484
|
+
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable());
|
|
485
|
+
if (j < kFilesPerLevel - 1) {
|
|
486
|
+
// background compaction may happen early for kFilesPerLevel'th file
|
|
487
|
+
ASSERT_EQ(NumTableFilesAtLevel(0), j + 1);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
ASSERT_OK(dbfull()->TEST_WaitForCompact());
|
|
491
|
+
ASSERT_EQ(NumTableFilesAtLevel(0), 0);
|
|
492
|
+
if (i == kNumLevels - 2) {
|
|
493
|
+
// For the highest level, value size is smaller (see Put() above),
|
|
494
|
+
// so output file number is smaller.
|
|
495
|
+
ASSERT_GT(NumTableFilesAtLevel(kNumLevels - 1 - i), kFilesPerLevel - 2);
|
|
496
|
+
} else {
|
|
497
|
+
ASSERT_GT(NumTableFilesAtLevel(kNumLevels - 1 - i), kFilesPerLevel - 1);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
// Now L1-L3 are full, when we compact L1->L2 we should see (1) subcompactions
|
|
501
|
+
// happen since input level > 0; (2) range deletions are not dropped since
|
|
502
|
+
// output level is not bottommost. If no file boundary assertion fails, that
|
|
503
|
+
// probably means universal compaction + subcompaction + range deletion are
|
|
504
|
+
// compatible.
|
|
505
|
+
ASSERT_OK(dbfull()->RunManualCompaction(
|
|
506
|
+
static_cast_with_check<ColumnFamilyHandleImpl>(db_->DefaultColumnFamily())
|
|
507
|
+
->cfd(),
|
|
508
|
+
1 /* input_level */, 2 /* output_level */, CompactRangeOptions(),
|
|
509
|
+
nullptr /* begin */, nullptr /* end */, true /* exclusive */,
|
|
510
|
+
true /* disallow_trivial_move */,
|
|
511
|
+
std::numeric_limits<uint64_t>::max() /* max_file_num_to_ignore */,
|
|
512
|
+
"" /*trim_ts*/));
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
TEST_F(DBRangeDelTest, CompactionRemovesCoveredMergeOperands) {
|
|
516
|
+
const int kNumPerFile = 3, kNumFiles = 3;
|
|
517
|
+
Options opts = CurrentOptions();
|
|
518
|
+
opts.disable_auto_compactions = true;
|
|
519
|
+
opts.memtable_factory.reset(test::NewSpecialSkipListFactory(2 * kNumPerFile));
|
|
520
|
+
opts.merge_operator = MergeOperators::CreateUInt64AddOperator();
|
|
521
|
+
opts.num_levels = 2;
|
|
522
|
+
Reopen(opts);
|
|
523
|
+
|
|
524
|
+
// Iterates kNumFiles * kNumPerFile + 1 times since flushing the last file
|
|
525
|
+
// requires an extra entry.
|
|
526
|
+
for (int i = 0; i <= kNumFiles * kNumPerFile; ++i) {
|
|
527
|
+
if (i % kNumPerFile == 0 && i / kNumPerFile == kNumFiles - 1) {
|
|
528
|
+
// Delete merge operands from all but the last file
|
|
529
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
530
|
+
"key", "key_"));
|
|
531
|
+
}
|
|
532
|
+
std::string val;
|
|
533
|
+
PutFixed64(&val, i);
|
|
534
|
+
ASSERT_OK(db_->Merge(WriteOptions(), "key", val));
|
|
535
|
+
// we need to prevent trivial move using Puts so compaction will actually
|
|
536
|
+
// process the merge operands.
|
|
537
|
+
ASSERT_OK(db_->Put(WriteOptions(), "prevent_trivial_move", ""));
|
|
538
|
+
if (i > 0 && i % kNumPerFile == 0) {
|
|
539
|
+
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable());
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
ReadOptions read_opts;
|
|
544
|
+
read_opts.ignore_range_deletions = true;
|
|
545
|
+
std::string expected, actual;
|
|
546
|
+
ASSERT_OK(db_->Get(read_opts, "key", &actual));
|
|
547
|
+
PutFixed64(&expected, 45); // 1+2+...+9
|
|
548
|
+
ASSERT_EQ(expected, actual);
|
|
549
|
+
|
|
550
|
+
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), nullptr, nullptr));
|
|
551
|
+
|
|
552
|
+
expected.clear();
|
|
553
|
+
ASSERT_OK(db_->Get(read_opts, "key", &actual));
|
|
554
|
+
uint64_t tmp;
|
|
555
|
+
Slice tmp2(actual);
|
|
556
|
+
GetFixed64(&tmp2, &tmp);
|
|
557
|
+
PutFixed64(&expected, 30); // 6+7+8+9 (earlier operands covered by tombstone)
|
|
558
|
+
ASSERT_EQ(expected, actual);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
TEST_F(DBRangeDelTest, PutDeleteRangeMergeFlush) {
|
|
562
|
+
// Test the sequence of operations: (1) Put, (2) DeleteRange, (3) Merge, (4)
|
|
563
|
+
// Flush. The `CompactionIterator` previously had a bug where we forgot to
|
|
564
|
+
// check for covering range tombstones when processing the (1) Put, causing
|
|
565
|
+
// it to reappear after the flush.
|
|
566
|
+
Options opts = CurrentOptions();
|
|
567
|
+
opts.merge_operator = MergeOperators::CreateUInt64AddOperator();
|
|
568
|
+
Reopen(opts);
|
|
569
|
+
|
|
570
|
+
std::string val;
|
|
571
|
+
PutFixed64(&val, 1);
|
|
572
|
+
ASSERT_OK(db_->Put(WriteOptions(), "key", val));
|
|
573
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "key",
|
|
574
|
+
"key_"));
|
|
575
|
+
ASSERT_OK(db_->Merge(WriteOptions(), "key", val));
|
|
576
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
577
|
+
|
|
578
|
+
ReadOptions read_opts;
|
|
579
|
+
std::string expected, actual;
|
|
580
|
+
ASSERT_OK(db_->Get(read_opts, "key", &actual));
|
|
581
|
+
PutFixed64(&expected, 1);
|
|
582
|
+
ASSERT_EQ(expected, actual);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
TEST_F(DBRangeDelTest, ObsoleteTombstoneCleanup) {
|
|
586
|
+
// During compaction to bottommost level, verify range tombstones older than
|
|
587
|
+
// the oldest snapshot are removed, while others are preserved.
|
|
588
|
+
Options opts = CurrentOptions();
|
|
589
|
+
opts.disable_auto_compactions = true;
|
|
590
|
+
opts.num_levels = 2;
|
|
591
|
+
opts.statistics = CreateDBStatistics();
|
|
592
|
+
Reopen(opts);
|
|
593
|
+
|
|
594
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "dr1",
|
|
595
|
+
"dr10")); // obsolete after compaction
|
|
596
|
+
ASSERT_OK(db_->Put(WriteOptions(), "key", "val"));
|
|
597
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
598
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
599
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "dr2",
|
|
600
|
+
"dr20")); // protected by snapshot
|
|
601
|
+
ASSERT_OK(db_->Put(WriteOptions(), "key", "val"));
|
|
602
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
603
|
+
|
|
604
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(0));
|
|
605
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(1));
|
|
606
|
+
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), nullptr, nullptr));
|
|
607
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
608
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
609
|
+
ASSERT_EQ(1, TestGetTickerCount(opts, COMPACTION_RANGE_DEL_DROP_OBSOLETE));
|
|
610
|
+
|
|
611
|
+
db_->ReleaseSnapshot(snapshot);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
TEST_F(DBRangeDelTest, TableEvictedDuringScan) {
|
|
615
|
+
// The RangeDelAggregator holds pointers into range deletion blocks created by
|
|
616
|
+
// table readers. This test ensures the aggregator can still access those
|
|
617
|
+
// blocks even if it outlives the table readers that created them.
|
|
618
|
+
//
|
|
619
|
+
// DBIter always keeps readers open for L0 files. So, in order to test
|
|
620
|
+
// aggregator outliving reader, we need to have deletions in L1 files, which
|
|
621
|
+
// are opened/closed on-demand during the scan. This is accomplished by
|
|
622
|
+
// setting kNumRanges > level0_stop_writes_trigger, which prevents deletions
|
|
623
|
+
// from all lingering in L0 (there is at most one range deletion per L0 file).
|
|
624
|
+
//
|
|
625
|
+
// The first L1 file will contain a range deletion since its begin key is 0.
|
|
626
|
+
// SeekToFirst() references that table's reader and adds its range tombstone
|
|
627
|
+
// to the aggregator. Upon advancing beyond that table's key-range via Next(),
|
|
628
|
+
// the table reader will be unreferenced by the iterator. Since we manually
|
|
629
|
+
// call Evict() on all readers before the full scan, this unreference causes
|
|
630
|
+
// the reader's refcount to drop to zero and thus be destroyed.
|
|
631
|
+
//
|
|
632
|
+
// When it is destroyed, we do not remove its range deletions from the
|
|
633
|
+
// aggregator. So, subsequent calls to Next() must be able to use these
|
|
634
|
+
// deletions to decide whether a key is covered. This will work as long as
|
|
635
|
+
// the aggregator properly references the range deletion block.
|
|
636
|
+
const int kNum = 25, kRangeBegin = 0, kRangeEnd = 7, kNumRanges = 5;
|
|
637
|
+
Options opts = CurrentOptions();
|
|
638
|
+
opts.comparator = test::Uint64Comparator();
|
|
639
|
+
opts.level0_file_num_compaction_trigger = 4;
|
|
640
|
+
opts.level0_stop_writes_trigger = 4;
|
|
641
|
+
opts.memtable_factory.reset(test::NewSpecialSkipListFactory(1));
|
|
642
|
+
opts.num_levels = 2;
|
|
643
|
+
BlockBasedTableOptions bbto;
|
|
644
|
+
bbto.cache_index_and_filter_blocks = true;
|
|
645
|
+
bbto.block_cache = NewLRUCache(8 << 20);
|
|
646
|
+
opts.table_factory.reset(NewBlockBasedTableFactory(bbto));
|
|
647
|
+
DestroyAndReopen(opts);
|
|
648
|
+
|
|
649
|
+
// Hold a snapshot so range deletions can't become obsolete during compaction
|
|
650
|
+
// to bottommost level (i.e., L1).
|
|
651
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
652
|
+
for (int i = 0; i < kNum; ++i) {
|
|
653
|
+
ASSERT_OK(db_->Put(WriteOptions(), GetNumericStr(i), "val"));
|
|
654
|
+
if (i > 0) {
|
|
655
|
+
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable());
|
|
656
|
+
}
|
|
657
|
+
if (i >= kNum / 2 && i < kNum / 2 + kNumRanges) {
|
|
658
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
659
|
+
GetNumericStr(kRangeBegin),
|
|
660
|
+
GetNumericStr(kRangeEnd)));
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
// Must be > 1 so the first L1 file can be closed before scan finishes
|
|
664
|
+
ASSERT_OK(dbfull()->TEST_WaitForCompact());
|
|
665
|
+
ASSERT_GT(NumTableFilesAtLevel(1), 1);
|
|
666
|
+
std::vector<uint64_t> file_numbers = ListTableFiles(env_, dbname_);
|
|
667
|
+
|
|
668
|
+
ReadOptions read_opts;
|
|
669
|
+
auto* iter = db_->NewIterator(read_opts);
|
|
670
|
+
ASSERT_OK(iter->status());
|
|
671
|
+
int expected = kRangeEnd;
|
|
672
|
+
iter->SeekToFirst();
|
|
673
|
+
for (auto file_number : file_numbers) {
|
|
674
|
+
// This puts table caches in the state of being externally referenced only
|
|
675
|
+
// so they are destroyed immediately upon iterator unreferencing.
|
|
676
|
+
TableCache::Evict(dbfull()->TEST_table_cache(), file_number);
|
|
677
|
+
}
|
|
678
|
+
for (; iter->Valid(); iter->Next()) {
|
|
679
|
+
ASSERT_EQ(GetNumericStr(expected), iter->key());
|
|
680
|
+
++expected;
|
|
681
|
+
// Keep clearing block cache's LRU so range deletion block can be freed as
|
|
682
|
+
// soon as its refcount drops to zero.
|
|
683
|
+
bbto.block_cache->EraseUnRefEntries();
|
|
684
|
+
}
|
|
685
|
+
ASSERT_EQ(kNum, expected);
|
|
686
|
+
delete iter;
|
|
687
|
+
db_->ReleaseSnapshot(snapshot);
|
|
688
|
+
|
|
689
|
+
// Also test proper cache handling in GetRangeTombstoneIterator,
|
|
690
|
+
// via TablesRangeTombstoneSummary. (This once triggered memory leak
|
|
691
|
+
// report with ASAN.)
|
|
692
|
+
opts.max_open_files = 1;
|
|
693
|
+
Reopen(opts);
|
|
694
|
+
|
|
695
|
+
std::string str;
|
|
696
|
+
ASSERT_OK(dbfull()->TablesRangeTombstoneSummary(db_->DefaultColumnFamily(),
|
|
697
|
+
100, &str));
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
TEST_F(DBRangeDelTest, GetCoveredKeyFromMutableMemtable) {
|
|
701
|
+
do {
|
|
702
|
+
DestroyAndReopen(CurrentOptions());
|
|
703
|
+
ASSERT_OK(db_->Put(WriteOptions(), "key", "val"));
|
|
704
|
+
ASSERT_OK(
|
|
705
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
706
|
+
|
|
707
|
+
ReadOptions read_opts;
|
|
708
|
+
std::string value;
|
|
709
|
+
ASSERT_TRUE(db_->Get(read_opts, "key", &value).IsNotFound());
|
|
710
|
+
} while (ChangeOptions(kRangeDelSkipConfigs));
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
TEST_F(DBRangeDelTest, GetCoveredKeyFromImmutableMemtable) {
|
|
714
|
+
do {
|
|
715
|
+
Options opts = CurrentOptions();
|
|
716
|
+
opts.max_write_buffer_number = 3;
|
|
717
|
+
opts.min_write_buffer_number_to_merge = 2;
|
|
718
|
+
// SpecialSkipListFactory lets us specify maximum number of elements the
|
|
719
|
+
// memtable can hold. It switches the active memtable to immutable (flush is
|
|
720
|
+
// prevented by the above options) upon inserting an element that would
|
|
721
|
+
// overflow the memtable.
|
|
722
|
+
opts.memtable_factory.reset(test::NewSpecialSkipListFactory(1));
|
|
723
|
+
DestroyAndReopen(opts);
|
|
724
|
+
|
|
725
|
+
ASSERT_OK(db_->Put(WriteOptions(), "key", "val"));
|
|
726
|
+
ASSERT_OK(
|
|
727
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
728
|
+
ASSERT_OK(db_->Put(WriteOptions(), "blah", "val"));
|
|
729
|
+
|
|
730
|
+
ReadOptions read_opts;
|
|
731
|
+
std::string value;
|
|
732
|
+
ASSERT_TRUE(db_->Get(read_opts, "key", &value).IsNotFound());
|
|
733
|
+
} while (ChangeOptions(kRangeDelSkipConfigs));
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
TEST_F(DBRangeDelTest, GetCoveredKeyFromSst) {
|
|
737
|
+
do {
|
|
738
|
+
DestroyAndReopen(CurrentOptions());
|
|
739
|
+
ASSERT_OK(db_->Put(WriteOptions(), "key", "val"));
|
|
740
|
+
// snapshot prevents key from being deleted during flush
|
|
741
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
742
|
+
ASSERT_OK(
|
|
743
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
744
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
745
|
+
|
|
746
|
+
ReadOptions read_opts;
|
|
747
|
+
std::string value;
|
|
748
|
+
ASSERT_TRUE(db_->Get(read_opts, "key", &value).IsNotFound());
|
|
749
|
+
db_->ReleaseSnapshot(snapshot);
|
|
750
|
+
} while (ChangeOptions(kRangeDelSkipConfigs));
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
TEST_F(DBRangeDelTest, GetCoveredMergeOperandFromMemtable) {
|
|
754
|
+
const int kNumMergeOps = 10;
|
|
755
|
+
Options opts = CurrentOptions();
|
|
756
|
+
opts.merge_operator = MergeOperators::CreateUInt64AddOperator();
|
|
757
|
+
Reopen(opts);
|
|
758
|
+
|
|
759
|
+
for (int i = 0; i < kNumMergeOps; ++i) {
|
|
760
|
+
std::string val;
|
|
761
|
+
PutFixed64(&val, i);
|
|
762
|
+
ASSERT_OK(db_->Merge(WriteOptions(), "key", val));
|
|
763
|
+
if (i == kNumMergeOps / 2) {
|
|
764
|
+
// deletes [0, 5]
|
|
765
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
766
|
+
"key", "key_"));
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
ReadOptions read_opts;
|
|
771
|
+
std::string expected, actual;
|
|
772
|
+
ASSERT_OK(db_->Get(read_opts, "key", &actual));
|
|
773
|
+
PutFixed64(&expected, 30); // 6+7+8+9
|
|
774
|
+
ASSERT_EQ(expected, actual);
|
|
775
|
+
|
|
776
|
+
expected.clear();
|
|
777
|
+
read_opts.ignore_range_deletions = true;
|
|
778
|
+
ASSERT_OK(db_->Get(read_opts, "key", &actual));
|
|
779
|
+
PutFixed64(&expected, 45); // 0+1+2+...+9
|
|
780
|
+
ASSERT_EQ(expected, actual);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
TEST_F(DBRangeDelTest, GetIgnoresRangeDeletions) {
|
|
784
|
+
Options opts = CurrentOptions();
|
|
785
|
+
opts.max_write_buffer_number = 4;
|
|
786
|
+
opts.min_write_buffer_number_to_merge = 3;
|
|
787
|
+
opts.memtable_factory.reset(test::NewSpecialSkipListFactory(1));
|
|
788
|
+
Reopen(opts);
|
|
789
|
+
|
|
790
|
+
ASSERT_OK(db_->Put(WriteOptions(), "sst_key", "val"));
|
|
791
|
+
// snapshot prevents key from being deleted during flush
|
|
792
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
793
|
+
ASSERT_OK(
|
|
794
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
795
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
796
|
+
ASSERT_OK(db_->Put(WriteOptions(), "imm_key", "val"));
|
|
797
|
+
ASSERT_OK(
|
|
798
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
799
|
+
ASSERT_OK(db_->Put(WriteOptions(), "mem_key", "val"));
|
|
800
|
+
ASSERT_OK(
|
|
801
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
802
|
+
|
|
803
|
+
ReadOptions read_opts;
|
|
804
|
+
read_opts.ignore_range_deletions = true;
|
|
805
|
+
for (std::string key : {"sst_key", "imm_key", "mem_key"}) {
|
|
806
|
+
std::string value;
|
|
807
|
+
ASSERT_OK(db_->Get(read_opts, key, &value));
|
|
808
|
+
}
|
|
809
|
+
db_->ReleaseSnapshot(snapshot);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
TEST_F(DBRangeDelTest, IteratorRemovesCoveredKeys) {
|
|
813
|
+
const int kNum = 200, kRangeBegin = 50, kRangeEnd = 150, kNumPerFile = 25;
|
|
814
|
+
Options opts = CurrentOptions();
|
|
815
|
+
opts.comparator = test::Uint64Comparator();
|
|
816
|
+
opts.memtable_factory.reset(test::NewSpecialSkipListFactory(kNumPerFile));
|
|
817
|
+
DestroyAndReopen(opts);
|
|
818
|
+
|
|
819
|
+
// Write half of the keys before the tombstone and half after the tombstone.
|
|
820
|
+
// Only covered keys (i.e., within the range and older than the tombstone)
|
|
821
|
+
// should be deleted.
|
|
822
|
+
for (int i = 0; i < kNum; ++i) {
|
|
823
|
+
if (i == kNum / 2) {
|
|
824
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
825
|
+
GetNumericStr(kRangeBegin),
|
|
826
|
+
GetNumericStr(kRangeEnd)));
|
|
827
|
+
}
|
|
828
|
+
ASSERT_OK(db_->Put(WriteOptions(), GetNumericStr(i), "val"));
|
|
829
|
+
}
|
|
830
|
+
ReadOptions read_opts;
|
|
831
|
+
auto* iter = db_->NewIterator(read_opts);
|
|
832
|
+
ASSERT_OK(iter->status());
|
|
833
|
+
|
|
834
|
+
int expected = 0;
|
|
835
|
+
for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {
|
|
836
|
+
ASSERT_EQ(GetNumericStr(expected), iter->key());
|
|
837
|
+
if (expected == kRangeBegin - 1) {
|
|
838
|
+
expected = kNum / 2;
|
|
839
|
+
} else {
|
|
840
|
+
++expected;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
ASSERT_EQ(kNum, expected);
|
|
844
|
+
delete iter;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
TEST_F(DBRangeDelTest, IteratorOverUserSnapshot) {
|
|
848
|
+
const int kNum = 200, kRangeBegin = 50, kRangeEnd = 150, kNumPerFile = 25;
|
|
849
|
+
Options opts = CurrentOptions();
|
|
850
|
+
opts.comparator = test::Uint64Comparator();
|
|
851
|
+
opts.memtable_factory.reset(test::NewSpecialSkipListFactory(kNumPerFile));
|
|
852
|
+
DestroyAndReopen(opts);
|
|
853
|
+
|
|
854
|
+
const Snapshot* snapshot = nullptr;
|
|
855
|
+
// Put a snapshot before the range tombstone, verify an iterator using that
|
|
856
|
+
// snapshot sees all inserted keys.
|
|
857
|
+
for (int i = 0; i < kNum; ++i) {
|
|
858
|
+
if (i == kNum / 2) {
|
|
859
|
+
snapshot = db_->GetSnapshot();
|
|
860
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
861
|
+
GetNumericStr(kRangeBegin),
|
|
862
|
+
GetNumericStr(kRangeEnd)));
|
|
863
|
+
}
|
|
864
|
+
ASSERT_OK(db_->Put(WriteOptions(), GetNumericStr(i), "val"));
|
|
865
|
+
}
|
|
866
|
+
ReadOptions read_opts;
|
|
867
|
+
read_opts.snapshot = snapshot;
|
|
868
|
+
auto* iter = db_->NewIterator(read_opts);
|
|
869
|
+
ASSERT_OK(iter->status());
|
|
870
|
+
|
|
871
|
+
int expected = 0;
|
|
872
|
+
for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {
|
|
873
|
+
ASSERT_EQ(GetNumericStr(expected), iter->key());
|
|
874
|
+
++expected;
|
|
875
|
+
}
|
|
876
|
+
ASSERT_EQ(kNum / 2, expected);
|
|
877
|
+
delete iter;
|
|
878
|
+
db_->ReleaseSnapshot(snapshot);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
TEST_F(DBRangeDelTest, IteratorIgnoresRangeDeletions) {
|
|
882
|
+
Options opts = CurrentOptions();
|
|
883
|
+
opts.max_write_buffer_number = 4;
|
|
884
|
+
opts.min_write_buffer_number_to_merge = 3;
|
|
885
|
+
opts.memtable_factory.reset(test::NewSpecialSkipListFactory(1));
|
|
886
|
+
Reopen(opts);
|
|
887
|
+
|
|
888
|
+
ASSERT_OK(db_->Put(WriteOptions(), "sst_key", "val"));
|
|
889
|
+
// snapshot prevents key from being deleted during flush
|
|
890
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
891
|
+
ASSERT_OK(
|
|
892
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
893
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
894
|
+
ASSERT_OK(db_->Put(WriteOptions(), "imm_key", "val"));
|
|
895
|
+
ASSERT_OK(
|
|
896
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
897
|
+
ASSERT_OK(db_->Put(WriteOptions(), "mem_key", "val"));
|
|
898
|
+
ASSERT_OK(
|
|
899
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
900
|
+
|
|
901
|
+
ReadOptions read_opts;
|
|
902
|
+
read_opts.ignore_range_deletions = true;
|
|
903
|
+
auto* iter = db_->NewIterator(read_opts);
|
|
904
|
+
ASSERT_OK(iter->status());
|
|
905
|
+
int i = 0;
|
|
906
|
+
std::string expected[] = {"imm_key", "mem_key", "sst_key"};
|
|
907
|
+
for (iter->SeekToFirst(); iter->Valid(); iter->Next(), ++i) {
|
|
908
|
+
std::string key;
|
|
909
|
+
ASSERT_EQ(expected[i], iter->key());
|
|
910
|
+
}
|
|
911
|
+
ASSERT_EQ(3, i);
|
|
912
|
+
delete iter;
|
|
913
|
+
db_->ReleaseSnapshot(snapshot);
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
#ifndef ROCKSDB_UBSAN_RUN
|
|
917
|
+
TEST_F(DBRangeDelTest, TailingIteratorRangeTombstoneUnsupported) {
|
|
918
|
+
ASSERT_OK(db_->Put(WriteOptions(), "key", "val"));
|
|
919
|
+
// snapshot prevents key from being deleted during flush
|
|
920
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
921
|
+
ASSERT_OK(
|
|
922
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
923
|
+
|
|
924
|
+
// iterations check unsupported in memtable, l0, and then l1
|
|
925
|
+
for (int i = 0; i < 3; ++i) {
|
|
926
|
+
ReadOptions read_opts;
|
|
927
|
+
read_opts.tailing = true;
|
|
928
|
+
auto* iter = db_->NewIterator(read_opts);
|
|
929
|
+
if (i == 2) {
|
|
930
|
+
// For L1+, iterators over files are created on-demand, so need seek
|
|
931
|
+
iter->SeekToFirst();
|
|
932
|
+
}
|
|
933
|
+
ASSERT_TRUE(iter->status().IsNotSupported());
|
|
934
|
+
|
|
935
|
+
delete iter;
|
|
936
|
+
if (i == 0) {
|
|
937
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
938
|
+
} else if (i == 1) {
|
|
939
|
+
MoveFilesToLevel(1);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
db_->ReleaseSnapshot(snapshot);
|
|
943
|
+
}
|
|
944
|
+
#endif // !ROCKSDB_UBSAN_RUN
|
|
945
|
+
|
|
946
|
+
TEST_F(DBRangeDelTest, SubcompactionHasEmptyDedicatedRangeDelFile) {
|
|
947
|
+
const int kNumFiles = 2, kNumKeysPerFile = 4;
|
|
948
|
+
Options options = CurrentOptions();
|
|
949
|
+
options.compression = kNoCompression;
|
|
950
|
+
options.disable_auto_compactions = true;
|
|
951
|
+
options.level0_file_num_compaction_trigger = kNumFiles;
|
|
952
|
+
options.max_subcompactions = 2;
|
|
953
|
+
options.num_levels = 2;
|
|
954
|
+
options.target_file_size_base = 4096;
|
|
955
|
+
Reopen(options);
|
|
956
|
+
|
|
957
|
+
// need a L1 file for subcompaction to be triggered
|
|
958
|
+
ASSERT_OK(
|
|
959
|
+
db_->Put(WriteOptions(), db_->DefaultColumnFamily(), Key(0), "val"));
|
|
960
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
961
|
+
MoveFilesToLevel(1);
|
|
962
|
+
|
|
963
|
+
// put enough keys to fill up the first subcompaction, and later range-delete
|
|
964
|
+
// them so that the first subcompaction outputs no key-values. In that case
|
|
965
|
+
// it'll consider making an SST file dedicated to range deletions.
|
|
966
|
+
for (int i = 0; i < kNumKeysPerFile; ++i) {
|
|
967
|
+
ASSERT_OK(db_->Put(WriteOptions(), db_->DefaultColumnFamily(), Key(i),
|
|
968
|
+
std::string(1024, 'a')));
|
|
969
|
+
}
|
|
970
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
971
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(0),
|
|
972
|
+
Key(kNumKeysPerFile)));
|
|
973
|
+
|
|
974
|
+
// the above range tombstone can be dropped, so that one alone won't cause a
|
|
975
|
+
// dedicated file to be opened. We can make one protected by snapshot that
|
|
976
|
+
// must be considered. Make its range outside the first subcompaction's range
|
|
977
|
+
// to exercise the tricky part of the code.
|
|
978
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
979
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
980
|
+
Key(kNumKeysPerFile + 1),
|
|
981
|
+
Key(kNumKeysPerFile + 2)));
|
|
982
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
983
|
+
|
|
984
|
+
ASSERT_EQ(kNumFiles, NumTableFilesAtLevel(0));
|
|
985
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
986
|
+
|
|
987
|
+
ASSERT_OK(db_->EnableAutoCompaction({db_->DefaultColumnFamily()}));
|
|
988
|
+
ASSERT_OK(dbfull()->TEST_WaitForCompact());
|
|
989
|
+
db_->ReleaseSnapshot(snapshot);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
TEST_F(DBRangeDelTest, MemtableBloomFilter) {
|
|
993
|
+
// regression test for #2743. the range delete tombstones in memtable should
|
|
994
|
+
// be added even when Get() skips searching due to its prefix bloom filter
|
|
995
|
+
const int kMemtableSize = 1 << 20; // 1MB
|
|
996
|
+
const int kMemtablePrefixFilterSize = 1 << 13; // 8KB
|
|
997
|
+
const int kNumKeys = 1000;
|
|
998
|
+
const int kPrefixLen = 8;
|
|
999
|
+
Options options = CurrentOptions();
|
|
1000
|
+
options.memtable_prefix_bloom_size_ratio =
|
|
1001
|
+
static_cast<double>(kMemtablePrefixFilterSize) / kMemtableSize;
|
|
1002
|
+
options.prefix_extractor.reset(
|
|
1003
|
+
ROCKSDB_NAMESPACE::NewFixedPrefixTransform(kPrefixLen));
|
|
1004
|
+
options.write_buffer_size = kMemtableSize;
|
|
1005
|
+
Reopen(options);
|
|
1006
|
+
|
|
1007
|
+
for (int i = 0; i < kNumKeys; ++i) {
|
|
1008
|
+
ASSERT_OK(Put(Key(i), "val"));
|
|
1009
|
+
}
|
|
1010
|
+
ASSERT_OK(Flush());
|
|
1011
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(0),
|
|
1012
|
+
Key(kNumKeys)));
|
|
1013
|
+
for (int i = 0; i < kNumKeys; ++i) {
|
|
1014
|
+
std::string value;
|
|
1015
|
+
ASSERT_TRUE(db_->Get(ReadOptions(), Key(i), &value).IsNotFound());
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
TEST_F(DBRangeDelTest, CompactionTreatsSplitInputLevelDeletionAtomically) {
|
|
1020
|
+
// This test originally verified that compaction treated files containing a
|
|
1021
|
+
// split range deletion in the input level as an atomic unit. I.e.,
|
|
1022
|
+
// compacting any input-level file(s) containing a portion of the range
|
|
1023
|
+
// deletion causes all other input-level files containing portions of that
|
|
1024
|
+
// same range deletion to be included in the compaction. Range deletion
|
|
1025
|
+
// tombstones are now truncated to sstable boundaries which removed the need
|
|
1026
|
+
// for that behavior (which could lead to excessively large
|
|
1027
|
+
// compactions).
|
|
1028
|
+
const int kNumFilesPerLevel = 4, kValueBytes = 4 << 10;
|
|
1029
|
+
Options options = CurrentOptions();
|
|
1030
|
+
options.compression = kNoCompression;
|
|
1031
|
+
options.level0_file_num_compaction_trigger = kNumFilesPerLevel;
|
|
1032
|
+
options.memtable_factory.reset(
|
|
1033
|
+
test::NewSpecialSkipListFactory(2 /* num_entries_flush */));
|
|
1034
|
+
// max file size could be 2x of target file size, so set it to half of that
|
|
1035
|
+
options.target_file_size_base = kValueBytes / 2;
|
|
1036
|
+
// disable dynamic_file_size, as it will cut L1 files into more files (than
|
|
1037
|
+
// kNumFilesPerLevel).
|
|
1038
|
+
options.level_compaction_dynamic_file_size = false;
|
|
1039
|
+
options.max_compaction_bytes = 1500;
|
|
1040
|
+
// i == 0: CompactFiles
|
|
1041
|
+
// i == 1: CompactRange
|
|
1042
|
+
// i == 2: automatic compaction
|
|
1043
|
+
for (int i = 0; i < 3; ++i) {
|
|
1044
|
+
DestroyAndReopen(options);
|
|
1045
|
+
|
|
1046
|
+
ASSERT_OK(Put(Key(0), ""));
|
|
1047
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1048
|
+
MoveFilesToLevel(2);
|
|
1049
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
1050
|
+
|
|
1051
|
+
// snapshot protects range tombstone from dropping due to becoming obsolete.
|
|
1052
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
1053
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
1054
|
+
Key(0), Key(2 * kNumFilesPerLevel)));
|
|
1055
|
+
|
|
1056
|
+
Random rnd(301);
|
|
1057
|
+
std::string value = rnd.RandomString(kValueBytes);
|
|
1058
|
+
for (int j = 0; j < kNumFilesPerLevel; ++j) {
|
|
1059
|
+
// give files overlapping key-ranges to prevent trivial move
|
|
1060
|
+
ASSERT_OK(Put(Key(j), value));
|
|
1061
|
+
ASSERT_OK(Put(Key(2 * kNumFilesPerLevel - 1 - j), value));
|
|
1062
|
+
if (j > 0) {
|
|
1063
|
+
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable());
|
|
1064
|
+
ASSERT_EQ(j, NumTableFilesAtLevel(0));
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
// put extra key to trigger final flush
|
|
1068
|
+
ASSERT_OK(Put("", ""));
|
|
1069
|
+
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable());
|
|
1070
|
+
ASSERT_OK(dbfull()->TEST_WaitForCompact());
|
|
1071
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
1072
|
+
ASSERT_EQ(kNumFilesPerLevel, NumTableFilesAtLevel(1));
|
|
1073
|
+
|
|
1074
|
+
ColumnFamilyMetaData meta;
|
|
1075
|
+
db_->GetColumnFamilyMetaData(&meta);
|
|
1076
|
+
if (i == 0) {
|
|
1077
|
+
ASSERT_OK(db_->CompactFiles(
|
|
1078
|
+
CompactionOptions(), {meta.levels[1].files[0].name}, 2 /* level */));
|
|
1079
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(1));
|
|
1080
|
+
} else if (i == 1) {
|
|
1081
|
+
auto begin_str = Key(0), end_str = Key(1);
|
|
1082
|
+
Slice begin = begin_str, end = end_str;
|
|
1083
|
+
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), &begin, &end));
|
|
1084
|
+
ASSERT_EQ(3, NumTableFilesAtLevel(1));
|
|
1085
|
+
} else if (i == 2) {
|
|
1086
|
+
ASSERT_OK(db_->SetOptions(db_->DefaultColumnFamily(),
|
|
1087
|
+
{{"max_bytes_for_level_base", "10000"}}));
|
|
1088
|
+
ASSERT_OK(dbfull()->TEST_WaitForCompact());
|
|
1089
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
1090
|
+
}
|
|
1091
|
+
ASSERT_GT(NumTableFilesAtLevel(2), 0);
|
|
1092
|
+
|
|
1093
|
+
db_->ReleaseSnapshot(snapshot);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
TEST_F(DBRangeDelTest, RangeTombstoneEndKeyAsSstableUpperBound) {
|
|
1098
|
+
// Test the handling of the range-tombstone end-key as the
|
|
1099
|
+
// upper-bound for an sstable.
|
|
1100
|
+
|
|
1101
|
+
const int kNumFilesPerLevel = 2, kValueBytes = 4 << 10;
|
|
1102
|
+
Options options = CurrentOptions();
|
|
1103
|
+
options.compression = kNoCompression;
|
|
1104
|
+
options.level0_file_num_compaction_trigger = kNumFilesPerLevel;
|
|
1105
|
+
options.memtable_factory.reset(
|
|
1106
|
+
test::NewSpecialSkipListFactory(2 /* num_entries_flush */));
|
|
1107
|
+
options.target_file_size_base = kValueBytes;
|
|
1108
|
+
options.disable_auto_compactions = true;
|
|
1109
|
+
// disable it for now, otherwise the L1 files are going be cut before data 1:
|
|
1110
|
+
// L1: [0] [1,4]
|
|
1111
|
+
// L2: [0,0]
|
|
1112
|
+
// because the grandparent file is between [0]->[1] and it's size is more than
|
|
1113
|
+
// 1/8 of target size (4k).
|
|
1114
|
+
options.level_compaction_dynamic_file_size = false;
|
|
1115
|
+
|
|
1116
|
+
DestroyAndReopen(options);
|
|
1117
|
+
|
|
1118
|
+
// Create an initial sstable at L2:
|
|
1119
|
+
// [key000000#1,1, key000000#1,1]
|
|
1120
|
+
ASSERT_OK(Put(Key(0), ""));
|
|
1121
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1122
|
+
MoveFilesToLevel(2);
|
|
1123
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
1124
|
+
|
|
1125
|
+
// A snapshot protects the range tombstone from dropping due to
|
|
1126
|
+
// becoming obsolete.
|
|
1127
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
1128
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(0),
|
|
1129
|
+
Key(2 * kNumFilesPerLevel)));
|
|
1130
|
+
|
|
1131
|
+
// Create 2 additional sstables in L0. Note that the first sstable
|
|
1132
|
+
// contains the range tombstone.
|
|
1133
|
+
// [key000000#3,1, key000004#72057594037927935,15]
|
|
1134
|
+
// [key000001#5,1, key000002#6,1]
|
|
1135
|
+
Random rnd(301);
|
|
1136
|
+
std::string value = rnd.RandomString(kValueBytes);
|
|
1137
|
+
for (int j = 0; j < kNumFilesPerLevel; ++j) {
|
|
1138
|
+
// Give files overlapping key-ranges to prevent a trivial move when we
|
|
1139
|
+
// compact from L0 to L1.
|
|
1140
|
+
ASSERT_OK(Put(Key(j), value));
|
|
1141
|
+
ASSERT_OK(Put(Key(2 * kNumFilesPerLevel - 1 - j), value));
|
|
1142
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1143
|
+
ASSERT_EQ(j + 1, NumTableFilesAtLevel(0));
|
|
1144
|
+
}
|
|
1145
|
+
// Compact the 2 L0 sstables to L1, resulting in the following LSM. There
|
|
1146
|
+
// are 2 sstables generated in L1 due to the target_file_size_base setting.
|
|
1147
|
+
// L1:
|
|
1148
|
+
// [key000000#3,1, key000002#72057594037927935,15]
|
|
1149
|
+
// [key000002#6,1, key000004#72057594037927935,15]
|
|
1150
|
+
// L2:
|
|
1151
|
+
// [key000000#1,1, key000000#1,1]
|
|
1152
|
+
MoveFilesToLevel(1);
|
|
1153
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
1154
|
+
|
|
1155
|
+
{
|
|
1156
|
+
// Compact the second sstable in L1:
|
|
1157
|
+
// L1:
|
|
1158
|
+
// [key000000#3,1, key000002#72057594037927935,15]
|
|
1159
|
+
// L2:
|
|
1160
|
+
// [key000000#1,1, key000000#1,1]
|
|
1161
|
+
// [key000002#6,1, key000004#72057594037927935,15]
|
|
1162
|
+
//
|
|
1163
|
+
// At the same time, verify the compaction does not cause the key at the
|
|
1164
|
+
// endpoint (key000002#6,1) to disappear.
|
|
1165
|
+
ASSERT_EQ(value, Get(Key(2)));
|
|
1166
|
+
auto begin_str = Key(3);
|
|
1167
|
+
const ROCKSDB_NAMESPACE::Slice begin = begin_str;
|
|
1168
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(1, &begin, nullptr));
|
|
1169
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
1170
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(2));
|
|
1171
|
+
ASSERT_EQ(value, Get(Key(2)));
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
{
|
|
1175
|
+
// Compact the first sstable in L1. This should be copacetic, but
|
|
1176
|
+
// was previously resulting in overlapping sstables in L2 due to
|
|
1177
|
+
// mishandling of the range tombstone end-key when used as the
|
|
1178
|
+
// largest key for an sstable. The resulting LSM structure should
|
|
1179
|
+
// be:
|
|
1180
|
+
//
|
|
1181
|
+
// L2:
|
|
1182
|
+
// [key000000#1,1, key000001#72057594037927935,15]
|
|
1183
|
+
// [key000001#5,1, key000002#72057594037927935,15]
|
|
1184
|
+
// [key000002#6,1, key000004#72057594037927935,15]
|
|
1185
|
+
auto begin_str = Key(0);
|
|
1186
|
+
const ROCKSDB_NAMESPACE::Slice begin = begin_str;
|
|
1187
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(1, &begin, &begin));
|
|
1188
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(1));
|
|
1189
|
+
ASSERT_EQ(3, NumTableFilesAtLevel(2));
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
db_->ReleaseSnapshot(snapshot);
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
TEST_F(DBRangeDelTest, UnorderedTombstones) {
|
|
1196
|
+
// Regression test for #2752. Range delete tombstones between
|
|
1197
|
+
// different snapshot stripes are not stored in order, so the first
|
|
1198
|
+
// tombstone of each snapshot stripe should be checked as a smallest
|
|
1199
|
+
// candidate.
|
|
1200
|
+
Options options = CurrentOptions();
|
|
1201
|
+
DestroyAndReopen(options);
|
|
1202
|
+
|
|
1203
|
+
auto cf = db_->DefaultColumnFamily();
|
|
1204
|
+
|
|
1205
|
+
ASSERT_OK(db_->Put(WriteOptions(), cf, "a", "a"));
|
|
1206
|
+
ASSERT_OK(db_->Flush(FlushOptions(), cf));
|
|
1207
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1208
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr));
|
|
1209
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
1210
|
+
|
|
1211
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), cf, "b", "c"));
|
|
1212
|
+
// Hold a snapshot to separate these two delete ranges.
|
|
1213
|
+
auto snapshot = db_->GetSnapshot();
|
|
1214
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), cf, "a", "b"));
|
|
1215
|
+
ASSERT_OK(db_->Flush(FlushOptions(), cf));
|
|
1216
|
+
db_->ReleaseSnapshot(snapshot);
|
|
1217
|
+
|
|
1218
|
+
std::vector<std::vector<FileMetaData>> files;
|
|
1219
|
+
dbfull()->TEST_GetFilesMetaData(cf, &files);
|
|
1220
|
+
ASSERT_EQ(1, files[0].size());
|
|
1221
|
+
ASSERT_EQ("a", files[0][0].smallest.user_key());
|
|
1222
|
+
ASSERT_EQ("c", files[0][0].largest.user_key());
|
|
1223
|
+
|
|
1224
|
+
std::string v;
|
|
1225
|
+
auto s = db_->Get(ReadOptions(), "a", &v);
|
|
1226
|
+
ASSERT_TRUE(s.IsNotFound());
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
class MockMergeOperator : public MergeOperator {
|
|
1230
|
+
// Mock non-associative operator. Non-associativity is expressed by lack of
|
|
1231
|
+
// implementation for any `PartialMerge*` functions.
|
|
1232
|
+
public:
|
|
1233
|
+
bool FullMergeV2(const MergeOperationInput& merge_in,
|
|
1234
|
+
MergeOperationOutput* merge_out) const override {
|
|
1235
|
+
assert(merge_out != nullptr);
|
|
1236
|
+
merge_out->new_value = merge_in.operand_list.back().ToString();
|
|
1237
|
+
return true;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
const char* Name() const override { return "MockMergeOperator"; }
|
|
1241
|
+
};
|
|
1242
|
+
|
|
1243
|
+
TEST_F(DBRangeDelTest, KeyAtOverlappingEndpointReappears) {
|
|
1244
|
+
// This test uses a non-associative merge operator since that is a convenient
|
|
1245
|
+
// way to get compaction to write out files with overlapping user-keys at the
|
|
1246
|
+
// endpoints. Note, however, overlapping endpoints can also occur with other
|
|
1247
|
+
// value types (Put, etc.), assuming the right snapshots are present.
|
|
1248
|
+
const int kFileBytes = 1 << 20;
|
|
1249
|
+
const int kValueBytes = 1 << 10;
|
|
1250
|
+
const int kNumFiles = 4;
|
|
1251
|
+
|
|
1252
|
+
Options options = CurrentOptions();
|
|
1253
|
+
options.compression = kNoCompression;
|
|
1254
|
+
options.disable_auto_compactions = true;
|
|
1255
|
+
options.merge_operator.reset(new MockMergeOperator());
|
|
1256
|
+
options.target_file_size_base = kFileBytes;
|
|
1257
|
+
Reopen(options);
|
|
1258
|
+
|
|
1259
|
+
// Push dummy data to L3 so that our actual test files on L0-L2
|
|
1260
|
+
// will not be considered "bottommost" level, otherwise compaction
|
|
1261
|
+
// may prevent us from creating overlapping user keys
|
|
1262
|
+
// as on the bottommost layer MergeHelper
|
|
1263
|
+
ASSERT_OK(db_->Merge(WriteOptions(), "key", "dummy"));
|
|
1264
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1265
|
+
MoveFilesToLevel(3);
|
|
1266
|
+
|
|
1267
|
+
Random rnd(301);
|
|
1268
|
+
const Snapshot* snapshot = nullptr;
|
|
1269
|
+
for (int i = 0; i < kNumFiles; ++i) {
|
|
1270
|
+
for (int j = 0; j < kFileBytes / kValueBytes; ++j) {
|
|
1271
|
+
auto value = rnd.RandomString(kValueBytes);
|
|
1272
|
+
ASSERT_OK(db_->Merge(WriteOptions(), "key", value));
|
|
1273
|
+
}
|
|
1274
|
+
if (i == kNumFiles - 1) {
|
|
1275
|
+
// Take snapshot to prevent covered merge operands from being dropped by
|
|
1276
|
+
// compaction.
|
|
1277
|
+
snapshot = db_->GetSnapshot();
|
|
1278
|
+
// The DeleteRange is the last write so all merge operands are covered.
|
|
1279
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
1280
|
+
"key", "key_"));
|
|
1281
|
+
}
|
|
1282
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1283
|
+
}
|
|
1284
|
+
ASSERT_EQ(kNumFiles, NumTableFilesAtLevel(0));
|
|
1285
|
+
std::string value;
|
|
1286
|
+
ASSERT_TRUE(db_->Get(ReadOptions(), "key", &value).IsNotFound());
|
|
1287
|
+
|
|
1288
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(
|
|
1289
|
+
0 /* level */, nullptr /* begin */, nullptr /* end */,
|
|
1290
|
+
nullptr /* column_family */, true /* disallow_trivial_move */));
|
|
1291
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
1292
|
+
// Now we have multiple files at L1 all containing a single user key, thus
|
|
1293
|
+
// guaranteeing overlap in the file endpoints.
|
|
1294
|
+
ASSERT_GT(NumTableFilesAtLevel(1), 1);
|
|
1295
|
+
|
|
1296
|
+
// Verify no merge operands reappeared after the compaction.
|
|
1297
|
+
ASSERT_TRUE(db_->Get(ReadOptions(), "key", &value).IsNotFound());
|
|
1298
|
+
|
|
1299
|
+
// Compact and verify again. It's worthwhile because now the files have
|
|
1300
|
+
// tighter endpoints, so we can verify that doesn't mess anything up.
|
|
1301
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(
|
|
1302
|
+
1 /* level */, nullptr /* begin */, nullptr /* end */,
|
|
1303
|
+
nullptr /* column_family */, true /* disallow_trivial_move */));
|
|
1304
|
+
ASSERT_GT(NumTableFilesAtLevel(2), 1);
|
|
1305
|
+
ASSERT_TRUE(db_->Get(ReadOptions(), "key", &value).IsNotFound());
|
|
1306
|
+
|
|
1307
|
+
db_->ReleaseSnapshot(snapshot);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
TEST_F(DBRangeDelTest, UntruncatedTombstoneDoesNotDeleteNewerKey) {
|
|
1311
|
+
// Verify a key newer than a range tombstone cannot be deleted by being
|
|
1312
|
+
// compacted to the bottom level (and thus having its seqnum zeroed) before
|
|
1313
|
+
// the range tombstone. This used to happen when range tombstones were
|
|
1314
|
+
// untruncated on reads such that they extended past their file boundaries.
|
|
1315
|
+
//
|
|
1316
|
+
// Test summary:
|
|
1317
|
+
//
|
|
1318
|
+
// - L1 is bottommost.
|
|
1319
|
+
// - A couple snapshots are strategically taken to prevent seqnums from being
|
|
1320
|
+
// zeroed, range tombstone from being dropped, merge operands from being
|
|
1321
|
+
// dropped, and merge operands from being combined.
|
|
1322
|
+
// - Left half of files in L1 all have same user key, ensuring their file
|
|
1323
|
+
// boundaries overlap. In the past this would cause range tombstones to be
|
|
1324
|
+
// untruncated.
|
|
1325
|
+
// - Right half of L1 files all have different keys, ensuring no overlap.
|
|
1326
|
+
// - A range tombstone spans all L1 keys, so it is stored in every L1 file.
|
|
1327
|
+
// - Keys in the right side of the key-range are overwritten. These are
|
|
1328
|
+
// compacted down to L1 after releasing snapshots such that their seqnums
|
|
1329
|
+
// will be zeroed.
|
|
1330
|
+
// - A full range scan is performed. If the tombstone in the left L1 files
|
|
1331
|
+
// were untruncated, it would now cover keys newer than it (but with zeroed
|
|
1332
|
+
// seqnums) in the right L1 files.
|
|
1333
|
+
const int kFileBytes = 1 << 20;
|
|
1334
|
+
const int kValueBytes = 1 << 10;
|
|
1335
|
+
const int kNumFiles = 4;
|
|
1336
|
+
const int kMaxKey = kNumFiles * kFileBytes / kValueBytes;
|
|
1337
|
+
const int kKeysOverwritten = 10;
|
|
1338
|
+
|
|
1339
|
+
Options options = CurrentOptions();
|
|
1340
|
+
options.compression = kNoCompression;
|
|
1341
|
+
options.disable_auto_compactions = true;
|
|
1342
|
+
options.merge_operator.reset(new MockMergeOperator());
|
|
1343
|
+
options.num_levels = 2;
|
|
1344
|
+
options.target_file_size_base = kFileBytes;
|
|
1345
|
+
Reopen(options);
|
|
1346
|
+
|
|
1347
|
+
Random rnd(301);
|
|
1348
|
+
// - snapshots[0] prevents merge operands from being combined during
|
|
1349
|
+
// compaction.
|
|
1350
|
+
// - snapshots[1] prevents merge operands from being dropped due to the
|
|
1351
|
+
// covering range tombstone.
|
|
1352
|
+
const Snapshot* snapshots[] = {nullptr, nullptr};
|
|
1353
|
+
for (int i = 0; i < kNumFiles; ++i) {
|
|
1354
|
+
for (int j = 0; j < kFileBytes / kValueBytes; ++j) {
|
|
1355
|
+
auto value = rnd.RandomString(kValueBytes);
|
|
1356
|
+
std::string key;
|
|
1357
|
+
if (i < kNumFiles / 2) {
|
|
1358
|
+
key = Key(0);
|
|
1359
|
+
} else {
|
|
1360
|
+
key = Key(1 + i * kFileBytes / kValueBytes + j);
|
|
1361
|
+
}
|
|
1362
|
+
ASSERT_OK(db_->Merge(WriteOptions(), key, value));
|
|
1363
|
+
}
|
|
1364
|
+
if (i == 0) {
|
|
1365
|
+
snapshots[0] = db_->GetSnapshot();
|
|
1366
|
+
}
|
|
1367
|
+
if (i == kNumFiles - 1) {
|
|
1368
|
+
snapshots[1] = db_->GetSnapshot();
|
|
1369
|
+
// The DeleteRange is the last write so all merge operands are covered.
|
|
1370
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
1371
|
+
Key(0), Key(kMaxKey + 1)));
|
|
1372
|
+
}
|
|
1373
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1374
|
+
}
|
|
1375
|
+
ASSERT_EQ(kNumFiles, NumTableFilesAtLevel(0));
|
|
1376
|
+
|
|
1377
|
+
auto get_key_count = [this]() -> int {
|
|
1378
|
+
auto* iter = db_->NewIterator(ReadOptions());
|
|
1379
|
+
assert(iter->status().ok());
|
|
1380
|
+
iter->SeekToFirst();
|
|
1381
|
+
int keys_found = 0;
|
|
1382
|
+
for (; iter->Valid(); iter->Next()) {
|
|
1383
|
+
++keys_found;
|
|
1384
|
+
}
|
|
1385
|
+
delete iter;
|
|
1386
|
+
return keys_found;
|
|
1387
|
+
};
|
|
1388
|
+
|
|
1389
|
+
// All keys should be covered
|
|
1390
|
+
ASSERT_EQ(0, get_key_count());
|
|
1391
|
+
|
|
1392
|
+
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), nullptr /* begin_key */,
|
|
1393
|
+
nullptr /* end_key */));
|
|
1394
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
1395
|
+
// Roughly the left half of L1 files should have overlapping boundary keys,
|
|
1396
|
+
// while the right half should not.
|
|
1397
|
+
ASSERT_GE(NumTableFilesAtLevel(1), kNumFiles);
|
|
1398
|
+
|
|
1399
|
+
// Now overwrite a few keys that are in L1 files that definitely don't have
|
|
1400
|
+
// overlapping boundary keys.
|
|
1401
|
+
for (int i = kMaxKey; i > kMaxKey - kKeysOverwritten; --i) {
|
|
1402
|
+
auto value = rnd.RandomString(kValueBytes);
|
|
1403
|
+
ASSERT_OK(db_->Merge(WriteOptions(), Key(i), value));
|
|
1404
|
+
}
|
|
1405
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1406
|
+
|
|
1407
|
+
// The overwritten keys are in L0 now, so clearly aren't covered by the range
|
|
1408
|
+
// tombstone in L1.
|
|
1409
|
+
ASSERT_EQ(kKeysOverwritten, get_key_count());
|
|
1410
|
+
|
|
1411
|
+
// Release snapshots so seqnums can be zeroed when L0->L1 happens.
|
|
1412
|
+
db_->ReleaseSnapshot(snapshots[0]);
|
|
1413
|
+
db_->ReleaseSnapshot(snapshots[1]);
|
|
1414
|
+
|
|
1415
|
+
auto begin_key_storage = Key(kMaxKey - kKeysOverwritten + 1);
|
|
1416
|
+
auto end_key_storage = Key(kMaxKey);
|
|
1417
|
+
Slice begin_key(begin_key_storage);
|
|
1418
|
+
Slice end_key(end_key_storage);
|
|
1419
|
+
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), &begin_key, &end_key));
|
|
1420
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
1421
|
+
ASSERT_GE(NumTableFilesAtLevel(1), kNumFiles);
|
|
1422
|
+
|
|
1423
|
+
ASSERT_EQ(kKeysOverwritten, get_key_count());
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
TEST_F(DBRangeDelTest, DeletedMergeOperandReappearsIterPrev) {
|
|
1427
|
+
// Exposes a bug where we were using
|
|
1428
|
+
// `RangeDelPositioningMode::kBackwardTraversal` while scanning merge operands
|
|
1429
|
+
// in the forward direction. Confusingly, this case happened during
|
|
1430
|
+
// `DBIter::Prev`. It could cause assertion failure, or reappearing keys.
|
|
1431
|
+
const int kFileBytes = 1 << 20;
|
|
1432
|
+
const int kValueBytes = 1 << 10;
|
|
1433
|
+
// Need multiple keys so we can get results when calling `Prev()` after
|
|
1434
|
+
// `SeekToLast()`.
|
|
1435
|
+
const int kNumKeys = 3;
|
|
1436
|
+
const int kNumFiles = 4;
|
|
1437
|
+
|
|
1438
|
+
Options options = CurrentOptions();
|
|
1439
|
+
options.compression = kNoCompression;
|
|
1440
|
+
options.disable_auto_compactions = true;
|
|
1441
|
+
options.merge_operator.reset(new MockMergeOperator());
|
|
1442
|
+
options.target_file_size_base = kFileBytes;
|
|
1443
|
+
Reopen(options);
|
|
1444
|
+
|
|
1445
|
+
Random rnd(301);
|
|
1446
|
+
const Snapshot* snapshot = nullptr;
|
|
1447
|
+
for (int i = 0; i < kNumFiles; ++i) {
|
|
1448
|
+
for (int j = 0; j < kFileBytes / kValueBytes; ++j) {
|
|
1449
|
+
auto value = rnd.RandomString(kValueBytes);
|
|
1450
|
+
ASSERT_OK(db_->Merge(WriteOptions(), Key(j % kNumKeys), value));
|
|
1451
|
+
if (i == 0 && j == kNumKeys) {
|
|
1452
|
+
// Take snapshot to prevent covered merge operands from being dropped or
|
|
1453
|
+
// merged by compaction.
|
|
1454
|
+
snapshot = db_->GetSnapshot();
|
|
1455
|
+
// Do a DeleteRange near the beginning so only the oldest merge operand
|
|
1456
|
+
// for each key is covered. This ensures the sequence of events:
|
|
1457
|
+
//
|
|
1458
|
+
// - `DBIter::Prev()` is called
|
|
1459
|
+
// - After several same versions of the same user key are encountered,
|
|
1460
|
+
// it decides to seek using `DBIter::FindValueForCurrentKeyUsingSeek`.
|
|
1461
|
+
// - Binary searches to the newest version of the key, which is in the
|
|
1462
|
+
// leftmost file containing the user key.
|
|
1463
|
+
// - Scans forwards to collect all merge operands. Eventually reaches
|
|
1464
|
+
// the rightmost file containing the oldest merge operand, which
|
|
1465
|
+
// should be covered by the `DeleteRange`. If `RangeDelAggregator`
|
|
1466
|
+
// were not properly using `kForwardTraversal` here, that operand
|
|
1467
|
+
// would reappear.
|
|
1468
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
1469
|
+
Key(0), Key(kNumKeys + 1)));
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1473
|
+
}
|
|
1474
|
+
ASSERT_EQ(kNumFiles, NumTableFilesAtLevel(0));
|
|
1475
|
+
|
|
1476
|
+
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), nullptr /* begin_key */,
|
|
1477
|
+
nullptr /* end_key */));
|
|
1478
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
1479
|
+
ASSERT_GT(NumTableFilesAtLevel(1), 1);
|
|
1480
|
+
|
|
1481
|
+
auto* iter = db_->NewIterator(ReadOptions());
|
|
1482
|
+
ASSERT_OK(iter->status());
|
|
1483
|
+
iter->SeekToLast();
|
|
1484
|
+
int keys_found = 0;
|
|
1485
|
+
for (; iter->Valid(); iter->Prev()) {
|
|
1486
|
+
++keys_found;
|
|
1487
|
+
}
|
|
1488
|
+
delete iter;
|
|
1489
|
+
ASSERT_EQ(kNumKeys, keys_found);
|
|
1490
|
+
|
|
1491
|
+
db_->ReleaseSnapshot(snapshot);
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
TEST_F(DBRangeDelTest, SnapshotPreventsDroppedKeys) {
|
|
1495
|
+
const int kFileBytes = 1 << 20;
|
|
1496
|
+
|
|
1497
|
+
Options options = CurrentOptions();
|
|
1498
|
+
options.compression = kNoCompression;
|
|
1499
|
+
options.disable_auto_compactions = true;
|
|
1500
|
+
options.target_file_size_base = kFileBytes;
|
|
1501
|
+
Reopen(options);
|
|
1502
|
+
|
|
1503
|
+
ASSERT_OK(Put(Key(0), "a"));
|
|
1504
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
1505
|
+
|
|
1506
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(0),
|
|
1507
|
+
Key(10)));
|
|
1508
|
+
|
|
1509
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1510
|
+
|
|
1511
|
+
ReadOptions read_opts;
|
|
1512
|
+
read_opts.snapshot = snapshot;
|
|
1513
|
+
auto* iter = db_->NewIterator(read_opts);
|
|
1514
|
+
ASSERT_OK(iter->status());
|
|
1515
|
+
|
|
1516
|
+
iter->SeekToFirst();
|
|
1517
|
+
ASSERT_TRUE(iter->Valid());
|
|
1518
|
+
ASSERT_EQ(Key(0), iter->key());
|
|
1519
|
+
|
|
1520
|
+
iter->Next();
|
|
1521
|
+
ASSERT_FALSE(iter->Valid());
|
|
1522
|
+
|
|
1523
|
+
delete iter;
|
|
1524
|
+
db_->ReleaseSnapshot(snapshot);
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
TEST_F(DBRangeDelTest, SnapshotPreventsDroppedKeysInImmMemTables) {
|
|
1528
|
+
const int kFileBytes = 1 << 20;
|
|
1529
|
+
|
|
1530
|
+
Options options = CurrentOptions();
|
|
1531
|
+
options.compression = kNoCompression;
|
|
1532
|
+
options.disable_auto_compactions = true;
|
|
1533
|
+
options.target_file_size_base = kFileBytes;
|
|
1534
|
+
Reopen(options);
|
|
1535
|
+
|
|
1536
|
+
// block flush thread -> pin immtables in memory
|
|
1537
|
+
SyncPoint::GetInstance()->DisableProcessing();
|
|
1538
|
+
SyncPoint::GetInstance()->LoadDependency({
|
|
1539
|
+
{"SnapshotPreventsDroppedKeysInImmMemTables:AfterNewIterator",
|
|
1540
|
+
"DBImpl::BGWorkFlush"},
|
|
1541
|
+
});
|
|
1542
|
+
SyncPoint::GetInstance()->EnableProcessing();
|
|
1543
|
+
|
|
1544
|
+
ASSERT_OK(Put(Key(0), "a"));
|
|
1545
|
+
std::unique_ptr<const Snapshot, std::function<void(const Snapshot*)>>
|
|
1546
|
+
snapshot(db_->GetSnapshot(),
|
|
1547
|
+
[this](const Snapshot* s) { db_->ReleaseSnapshot(s); });
|
|
1548
|
+
|
|
1549
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(0),
|
|
1550
|
+
Key(10)));
|
|
1551
|
+
|
|
1552
|
+
ASSERT_OK(dbfull()->TEST_SwitchMemtable());
|
|
1553
|
+
|
|
1554
|
+
ReadOptions read_opts;
|
|
1555
|
+
read_opts.snapshot = snapshot.get();
|
|
1556
|
+
std::unique_ptr<Iterator> iter(db_->NewIterator(read_opts));
|
|
1557
|
+
ASSERT_OK(iter->status());
|
|
1558
|
+
|
|
1559
|
+
TEST_SYNC_POINT("SnapshotPreventsDroppedKeysInImmMemTables:AfterNewIterator");
|
|
1560
|
+
|
|
1561
|
+
iter->SeekToFirst();
|
|
1562
|
+
ASSERT_TRUE(iter->Valid());
|
|
1563
|
+
ASSERT_EQ(Key(0), iter->key());
|
|
1564
|
+
|
|
1565
|
+
iter->Next();
|
|
1566
|
+
ASSERT_FALSE(iter->Valid());
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
TEST_F(DBRangeDelTest, RangeTombstoneWrittenToMinimalSsts) {
|
|
1570
|
+
// Adapted from
|
|
1571
|
+
// https://github.com/cockroachdb/cockroach/blob/de8b3ea603dd1592d9dc26443c2cc92c356fbc2f/pkg/storage/engine/rocksdb_test.go#L1267-L1398.
|
|
1572
|
+
// Regression test for issue where range tombstone was written to more files
|
|
1573
|
+
// than necessary when it began exactly at the begin key in the next
|
|
1574
|
+
// compaction output file.
|
|
1575
|
+
const int kFileBytes = 1 << 20;
|
|
1576
|
+
const int kValueBytes = 4 << 10;
|
|
1577
|
+
Options options = CurrentOptions();
|
|
1578
|
+
options.compression = kNoCompression;
|
|
1579
|
+
options.disable_auto_compactions = true;
|
|
1580
|
+
// Have a bit of slack in the size limits but we enforce them more strictly
|
|
1581
|
+
// when manually flushing/compacting.
|
|
1582
|
+
options.max_compaction_bytes = 2 * kFileBytes;
|
|
1583
|
+
options.target_file_size_base = 2 * kFileBytes;
|
|
1584
|
+
options.write_buffer_size = 2 * kFileBytes;
|
|
1585
|
+
Reopen(options);
|
|
1586
|
+
|
|
1587
|
+
Random rnd(301);
|
|
1588
|
+
for (char first_char : {'a', 'b', 'c'}) {
|
|
1589
|
+
for (int i = 0; i < kFileBytes / kValueBytes; ++i) {
|
|
1590
|
+
std::string key(1, first_char);
|
|
1591
|
+
key.append(Key(i));
|
|
1592
|
+
std::string value = rnd.RandomString(kValueBytes);
|
|
1593
|
+
ASSERT_OK(Put(key, value));
|
|
1594
|
+
}
|
|
1595
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1596
|
+
MoveFilesToLevel(2);
|
|
1597
|
+
}
|
|
1598
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(0));
|
|
1599
|
+
ASSERT_EQ(3, NumTableFilesAtLevel(2));
|
|
1600
|
+
|
|
1601
|
+
// Populate the memtable lightly while spanning the whole key-space. The
|
|
1602
|
+
// setting of `max_compaction_bytes` will cause the L0->L1 to output multiple
|
|
1603
|
+
// files to prevent a large L1->L2 compaction later.
|
|
1604
|
+
ASSERT_OK(Put("a", "val"));
|
|
1605
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
1606
|
+
"c" + Key(1), "d"));
|
|
1607
|
+
// Our compaction output file cutting logic currently only considers point
|
|
1608
|
+
// keys. So, in order for the range tombstone to have a chance at landing at
|
|
1609
|
+
// the start of a new file, we need a point key at the range tombstone's
|
|
1610
|
+
// start.
|
|
1611
|
+
// TODO(ajkr): remove this `Put` after file cutting accounts for range
|
|
1612
|
+
// tombstones (#3977).
|
|
1613
|
+
ASSERT_OK(Put("c" + Key(1), "value"));
|
|
1614
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1615
|
+
|
|
1616
|
+
// Ensure manual L0->L1 compaction cuts the outputs before the range tombstone
|
|
1617
|
+
// and the range tombstone is only placed in the second SST.
|
|
1618
|
+
std::string begin_key_storage("c" + Key(1));
|
|
1619
|
+
Slice begin_key(begin_key_storage);
|
|
1620
|
+
std::string end_key_storage("d");
|
|
1621
|
+
Slice end_key(end_key_storage);
|
|
1622
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(
|
|
1623
|
+
0 /* level */, &begin_key /* begin */, &end_key /* end */,
|
|
1624
|
+
nullptr /* column_family */, true /* disallow_trivial_move */));
|
|
1625
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
1626
|
+
|
|
1627
|
+
std::vector<LiveFileMetaData> all_metadata;
|
|
1628
|
+
std::vector<LiveFileMetaData> l1_metadata;
|
|
1629
|
+
db_->GetLiveFilesMetaData(&all_metadata);
|
|
1630
|
+
for (const auto& metadata : all_metadata) {
|
|
1631
|
+
if (metadata.level == 1) {
|
|
1632
|
+
l1_metadata.push_back(metadata);
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
std::sort(l1_metadata.begin(), l1_metadata.end(),
|
|
1636
|
+
[&](const LiveFileMetaData& a, const LiveFileMetaData& b) {
|
|
1637
|
+
return options.comparator->Compare(a.smallestkey, b.smallestkey) <
|
|
1638
|
+
0;
|
|
1639
|
+
});
|
|
1640
|
+
ASSERT_EQ("a", l1_metadata[0].smallestkey);
|
|
1641
|
+
ASSERT_EQ("a", l1_metadata[0].largestkey);
|
|
1642
|
+
ASSERT_EQ("c" + Key(1), l1_metadata[1].smallestkey);
|
|
1643
|
+
ASSERT_EQ("d", l1_metadata[1].largestkey);
|
|
1644
|
+
|
|
1645
|
+
TablePropertiesCollection all_table_props;
|
|
1646
|
+
ASSERT_OK(db_->GetPropertiesOfAllTables(&all_table_props));
|
|
1647
|
+
int64_t num_range_deletions = 0;
|
|
1648
|
+
for (const auto& name_and_table_props : all_table_props) {
|
|
1649
|
+
const auto& name = name_and_table_props.first;
|
|
1650
|
+
const auto& table_props = name_and_table_props.second;
|
|
1651
|
+
// The range tombstone should only be output to the second L1 SST.
|
|
1652
|
+
if (name.size() >= l1_metadata[1].name.size() &&
|
|
1653
|
+
name.substr(name.size() - l1_metadata[1].name.size())
|
|
1654
|
+
.compare(l1_metadata[1].name) == 0) {
|
|
1655
|
+
ASSERT_EQ(1, table_props->num_range_deletions);
|
|
1656
|
+
++num_range_deletions;
|
|
1657
|
+
} else {
|
|
1658
|
+
ASSERT_EQ(0, table_props->num_range_deletions);
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
ASSERT_EQ(1, num_range_deletions);
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
TEST_F(DBRangeDelTest, LevelCompactOutputCutAtRangeTombstoneForTtlFiles) {
|
|
1665
|
+
Options options = CurrentOptions();
|
|
1666
|
+
options.compression = kNoCompression;
|
|
1667
|
+
options.compaction_pri = kMinOverlappingRatio;
|
|
1668
|
+
options.disable_auto_compactions = true;
|
|
1669
|
+
options.ttl = 24 * 60 * 60; // 24 hours
|
|
1670
|
+
options.target_file_size_base = 8 << 10;
|
|
1671
|
+
env_->SetMockSleep();
|
|
1672
|
+
options.env = env_;
|
|
1673
|
+
DestroyAndReopen(options);
|
|
1674
|
+
|
|
1675
|
+
Random rnd(301);
|
|
1676
|
+
// Fill some data so that future compactions are not bottommost level
|
|
1677
|
+
// compaction, and hence they would try cut around files for ttl
|
|
1678
|
+
for (int i = 5; i < 10; ++i) {
|
|
1679
|
+
ASSERT_OK(Put(Key(i), rnd.RandomString(1 << 10)));
|
|
1680
|
+
}
|
|
1681
|
+
ASSERT_OK(Flush());
|
|
1682
|
+
MoveFilesToLevel(3);
|
|
1683
|
+
ASSERT_EQ("0,0,0,1", FilesPerLevel());
|
|
1684
|
+
|
|
1685
|
+
for (int i = 5; i < 10; ++i) {
|
|
1686
|
+
ASSERT_OK(Put(Key(i), rnd.RandomString(1 << 10)));
|
|
1687
|
+
}
|
|
1688
|
+
ASSERT_OK(Flush());
|
|
1689
|
+
MoveFilesToLevel(1);
|
|
1690
|
+
ASSERT_EQ("0,1,0,1", FilesPerLevel());
|
|
1691
|
+
|
|
1692
|
+
env_->MockSleepForSeconds(20 * 60 * 60);
|
|
1693
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
1694
|
+
Key(11), Key(12)));
|
|
1695
|
+
ASSERT_OK(Put(Key(0), rnd.RandomString(1 << 10)));
|
|
1696
|
+
ASSERT_OK(Flush());
|
|
1697
|
+
ASSERT_EQ("1,1,0,1", FilesPerLevel());
|
|
1698
|
+
// L0 file is new, L1 and L3 file are old and qualified for TTL
|
|
1699
|
+
env_->MockSleepForSeconds(10 * 60 * 60);
|
|
1700
|
+
MoveFilesToLevel(1);
|
|
1701
|
+
// L1 output should be cut into 3 files:
|
|
1702
|
+
// File 0: Key(0)
|
|
1703
|
+
// File 1: (qualified for TTL): Key(5) - Key(10)
|
|
1704
|
+
// File 1: DeleteRange [11, 12)
|
|
1705
|
+
ASSERT_EQ("0,3,0,1", FilesPerLevel());
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
// Test SST partitioner cut after every single key
|
|
1709
|
+
class SingleKeySstPartitioner : public SstPartitioner {
|
|
1710
|
+
public:
|
|
1711
|
+
const char* Name() const override { return "SingleKeySstPartitioner"; }
|
|
1712
|
+
|
|
1713
|
+
PartitionerResult ShouldPartition(
|
|
1714
|
+
const PartitionerRequest& /*request*/) override {
|
|
1715
|
+
return kRequired;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
bool CanDoTrivialMove(const Slice& /*smallest_user_key*/,
|
|
1719
|
+
const Slice& /*largest_user_key*/) override {
|
|
1720
|
+
return false;
|
|
1721
|
+
}
|
|
1722
|
+
};
|
|
1723
|
+
|
|
1724
|
+
class SingleKeySstPartitionerFactory : public SstPartitionerFactory {
|
|
1725
|
+
public:
|
|
1726
|
+
static const char* kClassName() { return "SingleKeySstPartitionerFactory"; }
|
|
1727
|
+
const char* Name() const override { return kClassName(); }
|
|
1728
|
+
|
|
1729
|
+
std::unique_ptr<SstPartitioner> CreatePartitioner(
|
|
1730
|
+
const SstPartitioner::Context& /* context */) const override {
|
|
1731
|
+
return std::unique_ptr<SstPartitioner>(new SingleKeySstPartitioner());
|
|
1732
|
+
}
|
|
1733
|
+
};
|
|
1734
|
+
|
|
1735
|
+
TEST_F(DBRangeDelTest, CompactionEmitRangeTombstoneToSSTPartitioner) {
|
|
1736
|
+
Options options = CurrentOptions();
|
|
1737
|
+
auto factory = std::make_shared<SingleKeySstPartitionerFactory>();
|
|
1738
|
+
options.sst_partitioner_factory = factory;
|
|
1739
|
+
options.disable_auto_compactions = true;
|
|
1740
|
+
DestroyAndReopen(options);
|
|
1741
|
+
|
|
1742
|
+
Random rnd(301);
|
|
1743
|
+
// range deletion keys are not processed when compacting to bottommost level,
|
|
1744
|
+
// so creating a file at older level to make the next compaction not
|
|
1745
|
+
// bottommost level
|
|
1746
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(4), rnd.RandomString(10)));
|
|
1747
|
+
ASSERT_OK(Flush());
|
|
1748
|
+
MoveFilesToLevel(5);
|
|
1749
|
+
|
|
1750
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(1), rnd.RandomString(10)));
|
|
1751
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(2),
|
|
1752
|
+
Key(5)));
|
|
1753
|
+
ASSERT_OK(Flush());
|
|
1754
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1755
|
+
MoveFilesToLevel(1);
|
|
1756
|
+
// SSTPartitioner decides to cut when range tombstone start key is passed to
|
|
1757
|
+
// it. Note that the range tombstone [2, 5) itself span multiple keys, but we
|
|
1758
|
+
// are not able to partition within its range yet.
|
|
1759
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
TEST_F(DBRangeDelTest, OversizeCompactionGapBetweenPointKeyAndTombstone) {
|
|
1763
|
+
// L2 has 2 files
|
|
1764
|
+
// L2_0: 0, 1, 2, 3, 4
|
|
1765
|
+
// L2_1: 5, 6, 7
|
|
1766
|
+
// L0 has 1 file
|
|
1767
|
+
// L0: 0, [5, 6), 8
|
|
1768
|
+
// max_compaction_bytes is less than the size of L2_0 and L2_1.
|
|
1769
|
+
// When compacting L0 into L1, it should split into 3 files:
|
|
1770
|
+
// compaction output should cut before key 5 and key 8 to
|
|
1771
|
+
// limit future compaction size.
|
|
1772
|
+
const int kNumPerFile = 4, kNumFiles = 2;
|
|
1773
|
+
Options options = CurrentOptions();
|
|
1774
|
+
options.disable_auto_compactions = true;
|
|
1775
|
+
options.target_file_size_base = 9 * 1024;
|
|
1776
|
+
options.max_compaction_bytes = 9 * 1024;
|
|
1777
|
+
DestroyAndReopen(options);
|
|
1778
|
+
Random rnd(301);
|
|
1779
|
+
for (int i = 0; i < kNumFiles; ++i) {
|
|
1780
|
+
std::vector<std::string> values;
|
|
1781
|
+
for (int j = 0; j < kNumPerFile; j++) {
|
|
1782
|
+
values.push_back(rnd.RandomString(3 << 10));
|
|
1783
|
+
ASSERT_OK(Put(Key(i * kNumPerFile + j), values[j]));
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1787
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1788
|
+
MoveFilesToLevel(2);
|
|
1789
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(2));
|
|
1790
|
+
ASSERT_OK(Put(Key(0), rnd.RandomString(1 << 10)));
|
|
1791
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(5),
|
|
1792
|
+
Key(6)));
|
|
1793
|
+
ASSERT_OK(Put(Key(8), rnd.RandomString(1 << 10)));
|
|
1794
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1795
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1796
|
+
|
|
1797
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr, nullptr,
|
|
1798
|
+
true /* disallow_trivial_move */));
|
|
1799
|
+
ASSERT_EQ(3, NumTableFilesAtLevel(1));
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
TEST_F(DBRangeDelTest, OversizeCompactionGapBetweenTombstone) {
|
|
1803
|
+
// L2 has two files
|
|
1804
|
+
// L2_0: 0, 1, 2, 3, 4. L2_1: 5, 6, 7
|
|
1805
|
+
// L0 has two range tombstones [0, 1), [7, 8).
|
|
1806
|
+
// max_compaction_bytes is less than the size of L2_0.
|
|
1807
|
+
// When compacting L0 into L1, the two range tombstones should be
|
|
1808
|
+
// split into two files.
|
|
1809
|
+
const int kNumPerFile = 4, kNumFiles = 2;
|
|
1810
|
+
Options options = CurrentOptions();
|
|
1811
|
+
options.disable_auto_compactions = true;
|
|
1812
|
+
options.target_file_size_base = 9 * 1024;
|
|
1813
|
+
options.max_compaction_bytes = 9 * 1024;
|
|
1814
|
+
DestroyAndReopen(options);
|
|
1815
|
+
Random rnd(301);
|
|
1816
|
+
for (int i = 0; i < kNumFiles; ++i) {
|
|
1817
|
+
std::vector<std::string> values;
|
|
1818
|
+
// Write 12K (4 values, each 3K)
|
|
1819
|
+
for (int j = 0; j < kNumPerFile; j++) {
|
|
1820
|
+
values.push_back(rnd.RandomString(3 << 10));
|
|
1821
|
+
ASSERT_OK(Put(Key(i * kNumPerFile + j), values[j]));
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1825
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1826
|
+
MoveFilesToLevel(2);
|
|
1827
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(2));
|
|
1828
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(0),
|
|
1829
|
+
Key(1)));
|
|
1830
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(7),
|
|
1831
|
+
Key(8)));
|
|
1832
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1833
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1834
|
+
|
|
1835
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr, nullptr,
|
|
1836
|
+
true /* disallow_trivial_move */));
|
|
1837
|
+
// This is L0 -> L1 compaction
|
|
1838
|
+
// The two range tombstones are broken up into two output files
|
|
1839
|
+
// to limit compaction size.
|
|
1840
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
TEST_F(DBRangeDelTest, OversizeCompactionPointKeyWithinRangetombstone) {
|
|
1844
|
+
// L2 has two files
|
|
1845
|
+
// L2_0: 0, 1, 2, 3, 4. L2_1: 6, 7, 8
|
|
1846
|
+
// L0 has [0, 9) and point key 5
|
|
1847
|
+
// max_compaction_bytes is less than the size of L2_0.
|
|
1848
|
+
// When compacting L0 into L1, the compaction should cut at point key 5.
|
|
1849
|
+
Options options = CurrentOptions();
|
|
1850
|
+
options.disable_auto_compactions = true;
|
|
1851
|
+
options.target_file_size_base = 9 * 1024;
|
|
1852
|
+
options.max_compaction_bytes = 9 * 1024;
|
|
1853
|
+
DestroyAndReopen(options);
|
|
1854
|
+
Random rnd(301);
|
|
1855
|
+
for (int i = 0; i < 9; ++i) {
|
|
1856
|
+
if (i == 5) {
|
|
1857
|
+
++i;
|
|
1858
|
+
}
|
|
1859
|
+
ASSERT_OK(Put(Key(i), rnd.RandomString(3 << 10)));
|
|
1860
|
+
}
|
|
1861
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1862
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1863
|
+
MoveFilesToLevel(2);
|
|
1864
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(2));
|
|
1865
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(0),
|
|
1866
|
+
Key(9)));
|
|
1867
|
+
ASSERT_OK(Put(Key(5), rnd.RandomString(1 << 10)));
|
|
1868
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1869
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1870
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr, nullptr,
|
|
1871
|
+
true /* disallow_trivial_move */));
|
|
1872
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
TEST_F(DBRangeDelTest, OverlappedTombstones) {
|
|
1876
|
+
const int kNumPerFile = 4, kNumFiles = 2;
|
|
1877
|
+
Options options = CurrentOptions();
|
|
1878
|
+
options.disable_auto_compactions = true;
|
|
1879
|
+
options.target_file_size_base = 9 * 1024;
|
|
1880
|
+
options.max_compaction_bytes = 9 * 1024;
|
|
1881
|
+
DestroyAndReopen(options);
|
|
1882
|
+
Random rnd(301);
|
|
1883
|
+
for (int i = 0; i < kNumFiles; ++i) {
|
|
1884
|
+
std::vector<std::string> values;
|
|
1885
|
+
// Write 12K (4 values, each 3K)
|
|
1886
|
+
for (int j = 0; j < kNumPerFile; j++) {
|
|
1887
|
+
values.push_back(rnd.RandomString(3 << 10));
|
|
1888
|
+
ASSERT_OK(Put(Key(i * kNumPerFile + j), values[j]));
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1892
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1893
|
+
MoveFilesToLevel(2);
|
|
1894
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(2));
|
|
1895
|
+
|
|
1896
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(1),
|
|
1897
|
+
Key((kNumFiles)*kNumPerFile + 1)));
|
|
1898
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1899
|
+
|
|
1900
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1901
|
+
|
|
1902
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr, nullptr,
|
|
1903
|
+
true /* disallow_trivial_move */));
|
|
1904
|
+
|
|
1905
|
+
// The tombstone range is not broken up into multiple SSTs which may incur a
|
|
1906
|
+
// large compaction with L2.
|
|
1907
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
1908
|
+
std::vector<std::vector<FileMetaData>> files;
|
|
1909
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(1, nullptr, nullptr, nullptr,
|
|
1910
|
+
true /* disallow_trivial_move */));
|
|
1911
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
1912
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(1));
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
TEST_F(DBRangeDelTest, OverlappedKeys) {
|
|
1916
|
+
const int kNumPerFile = 4, kNumFiles = 2;
|
|
1917
|
+
Options options = CurrentOptions();
|
|
1918
|
+
options.disable_auto_compactions = true;
|
|
1919
|
+
options.target_file_size_base = 9 * 1024;
|
|
1920
|
+
options.max_compaction_bytes = 9 * 1024;
|
|
1921
|
+
DestroyAndReopen(options);
|
|
1922
|
+
Random rnd(301);
|
|
1923
|
+
for (int i = 0; i < kNumFiles; ++i) {
|
|
1924
|
+
std::vector<std::string> values;
|
|
1925
|
+
// Write 12K (4 values, each 3K)
|
|
1926
|
+
for (int j = 0; j < kNumPerFile; j++) {
|
|
1927
|
+
values.push_back(rnd.RandomString(3 << 10));
|
|
1928
|
+
ASSERT_OK(Put(Key(i * kNumPerFile + j), values[j]));
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1932
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1933
|
+
MoveFilesToLevel(2);
|
|
1934
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(2));
|
|
1935
|
+
|
|
1936
|
+
for (int i = 1; i < kNumFiles * kNumPerFile + 1; i++) {
|
|
1937
|
+
ASSERT_OK(Put(Key(i), "0x123"));
|
|
1938
|
+
}
|
|
1939
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1940
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
1941
|
+
|
|
1942
|
+
// The key range is broken up into three SSTs to avoid a future big compaction
|
|
1943
|
+
// with the grandparent
|
|
1944
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr, nullptr,
|
|
1945
|
+
true /* disallow_trivial_move */));
|
|
1946
|
+
ASSERT_EQ(3, NumTableFilesAtLevel(1));
|
|
1947
|
+
|
|
1948
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(1, nullptr, nullptr, nullptr,
|
|
1949
|
+
true /* disallow_trivial_move */));
|
|
1950
|
+
// L1->L2 compaction size is limited to max_compaction_bytes
|
|
1951
|
+
ASSERT_EQ(3, NumTableFilesAtLevel(2));
|
|
1952
|
+
ASSERT_EQ(0, NumTableFilesAtLevel(1));
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
TEST_F(DBRangeDelTest, IteratorRefresh) {
|
|
1956
|
+
// Refreshing an iterator after a range tombstone is added should cause the
|
|
1957
|
+
// deleted range of keys to disappear.
|
|
1958
|
+
for (bool sv_changed : {false, true}) {
|
|
1959
|
+
ASSERT_OK(db_->Put(WriteOptions(), "key1", "value1"));
|
|
1960
|
+
ASSERT_OK(db_->Put(WriteOptions(), "key2", "value2"));
|
|
1961
|
+
|
|
1962
|
+
auto* iter = db_->NewIterator(ReadOptions());
|
|
1963
|
+
ASSERT_OK(iter->status());
|
|
1964
|
+
|
|
1965
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(),
|
|
1966
|
+
"key2", "key3"));
|
|
1967
|
+
|
|
1968
|
+
if (sv_changed) {
|
|
1969
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
ASSERT_OK(iter->Refresh());
|
|
1973
|
+
ASSERT_OK(iter->status());
|
|
1974
|
+
iter->SeekToFirst();
|
|
1975
|
+
ASSERT_EQ("key1", iter->key());
|
|
1976
|
+
iter->Next();
|
|
1977
|
+
ASSERT_FALSE(iter->Valid());
|
|
1978
|
+
|
|
1979
|
+
delete iter;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
void VerifyIteratorReachesEnd(InternalIterator* iter) {
|
|
1984
|
+
ASSERT_TRUE(!iter->Valid() && iter->status().ok());
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
void VerifyIteratorReachesEnd(Iterator* iter) {
|
|
1988
|
+
ASSERT_TRUE(!iter->Valid() && iter->status().ok());
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
TEST_F(DBRangeDelTest, IteratorReseek) {
|
|
1992
|
+
// Range tombstone triggers reseek (seeking to a range tombstone end key) in
|
|
1993
|
+
// merging iterator. Test set up:
|
|
1994
|
+
// one memtable: range tombstone [0, 1)
|
|
1995
|
+
// one immutable memtable: range tombstone [1, 2)
|
|
1996
|
+
// one L0 file with range tombstone [2, 3)
|
|
1997
|
+
// one L1 file with range tombstone [3, 4)
|
|
1998
|
+
// Seek(0) should trigger cascading reseeks at all levels below memtable.
|
|
1999
|
+
// Seek(1) should trigger cascading reseeks at all levels below immutable
|
|
2000
|
+
// memtable. SeekToFirst and SeekToLast trigger no reseek.
|
|
2001
|
+
Options options = CurrentOptions();
|
|
2002
|
+
options.compression = kNoCompression;
|
|
2003
|
+
options.disable_auto_compactions = true;
|
|
2004
|
+
|
|
2005
|
+
DestroyAndReopen(options);
|
|
2006
|
+
// L1
|
|
2007
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(3),
|
|
2008
|
+
Key(4)));
|
|
2009
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2010
|
+
MoveFilesToLevel(1);
|
|
2011
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2012
|
+
// L0
|
|
2013
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(2),
|
|
2014
|
+
Key(3)));
|
|
2015
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2016
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
2017
|
+
// Immutable memtable
|
|
2018
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(1),
|
|
2019
|
+
Key(2)));
|
|
2020
|
+
ASSERT_OK(static_cast_with_check<DBImpl>(db_)->TEST_SwitchMemtable());
|
|
2021
|
+
std::string value;
|
|
2022
|
+
ASSERT_TRUE(dbfull()->GetProperty(db_->DefaultColumnFamily(),
|
|
2023
|
+
"rocksdb.num-immutable-mem-table", &value));
|
|
2024
|
+
ASSERT_EQ(1, std::stoi(value));
|
|
2025
|
+
// live memtable
|
|
2026
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(0),
|
|
2027
|
+
Key(1)));
|
|
2028
|
+
// this memtable is still active
|
|
2029
|
+
ASSERT_TRUE(dbfull()->GetProperty(db_->DefaultColumnFamily(),
|
|
2030
|
+
"rocksdb.num-immutable-mem-table", &value));
|
|
2031
|
+
ASSERT_EQ(1, std::stoi(value));
|
|
2032
|
+
|
|
2033
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2034
|
+
get_perf_context()->Reset();
|
|
2035
|
+
iter->Seek(Key(0));
|
|
2036
|
+
// Reseeked immutable memtable, L0 and L1
|
|
2037
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 3);
|
|
2038
|
+
VerifyIteratorReachesEnd(iter);
|
|
2039
|
+
get_perf_context()->Reset();
|
|
2040
|
+
iter->SeekForPrev(Key(1));
|
|
2041
|
+
// Reseeked L0 and L1
|
|
2042
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 2);
|
|
2043
|
+
VerifyIteratorReachesEnd(iter);
|
|
2044
|
+
get_perf_context()->Reset();
|
|
2045
|
+
iter->SeekToFirst();
|
|
2046
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 0);
|
|
2047
|
+
VerifyIteratorReachesEnd(iter);
|
|
2048
|
+
iter->SeekToLast();
|
|
2049
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 0);
|
|
2050
|
+
VerifyIteratorReachesEnd(iter);
|
|
2051
|
+
delete iter;
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
TEST_F(DBRangeDelTest, ReseekDuringNextAndPrev) {
|
|
2055
|
+
// Range tombstone triggers reseek during Next()/Prev() in merging iterator.
|
|
2056
|
+
// Test set up:
|
|
2057
|
+
// memtable has: [0, 1) [2, 3)
|
|
2058
|
+
// L0 has: 2
|
|
2059
|
+
// L1 has: 1, 2, 3
|
|
2060
|
+
// Seek(0) will reseek to 1 for L0 and L1. Seek(1) will not trigger any
|
|
2061
|
+
// reseek. Then Next() determines 2 is covered by [2, 3), it will try to
|
|
2062
|
+
// reseek to 3 for L0 and L1. Similar story for Prev() and SeekForPrev() is
|
|
2063
|
+
// tested.
|
|
2064
|
+
Options options = CurrentOptions();
|
|
2065
|
+
options.compression = kNoCompression;
|
|
2066
|
+
options.disable_auto_compactions = true;
|
|
2067
|
+
|
|
2068
|
+
DestroyAndReopen(options);
|
|
2069
|
+
// L1
|
|
2070
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(1), "foo"));
|
|
2071
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(2), "foo"));
|
|
2072
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(3), "foo"));
|
|
2073
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2074
|
+
MoveFilesToLevel(1);
|
|
2075
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2076
|
+
|
|
2077
|
+
// L0
|
|
2078
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(2), "foo"));
|
|
2079
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2080
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
2081
|
+
|
|
2082
|
+
// Memtable
|
|
2083
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(0),
|
|
2084
|
+
Key(1)));
|
|
2085
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(2),
|
|
2086
|
+
Key(3)));
|
|
2087
|
+
|
|
2088
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2089
|
+
auto iter_test_forward = [&] {
|
|
2090
|
+
ASSERT_TRUE(iter->Valid());
|
|
2091
|
+
ASSERT_EQ(iter->key().ToString(), Key(1));
|
|
2092
|
+
|
|
2093
|
+
get_perf_context()->Reset();
|
|
2094
|
+
iter->Next();
|
|
2095
|
+
ASSERT_TRUE(iter->Valid());
|
|
2096
|
+
ASSERT_EQ(iter->key().ToString(), Key(3));
|
|
2097
|
+
// Reseeked L0 and L1
|
|
2098
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 2);
|
|
2099
|
+
|
|
2100
|
+
// Next to Prev
|
|
2101
|
+
get_perf_context()->Reset();
|
|
2102
|
+
iter->Prev();
|
|
2103
|
+
ASSERT_TRUE(iter->Valid());
|
|
2104
|
+
ASSERT_EQ(iter->key().ToString(), Key(1));
|
|
2105
|
+
// Reseeked L0 and L1
|
|
2106
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 2);
|
|
2107
|
+
|
|
2108
|
+
// Prev to Next
|
|
2109
|
+
get_perf_context()->Reset();
|
|
2110
|
+
iter->Next();
|
|
2111
|
+
ASSERT_TRUE(iter->Valid());
|
|
2112
|
+
ASSERT_EQ(iter->key().ToString(), Key(3));
|
|
2113
|
+
// Reseeked L0 and L1
|
|
2114
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 2);
|
|
2115
|
+
|
|
2116
|
+
iter->Next();
|
|
2117
|
+
VerifyIteratorReachesEnd(iter);
|
|
2118
|
+
};
|
|
2119
|
+
|
|
2120
|
+
get_perf_context()->Reset();
|
|
2121
|
+
iter->Seek(Key(0));
|
|
2122
|
+
// Reseeked L0 and L1
|
|
2123
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 2);
|
|
2124
|
+
iter_test_forward();
|
|
2125
|
+
get_perf_context()->Reset();
|
|
2126
|
+
iter->Seek(Key(1));
|
|
2127
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 0);
|
|
2128
|
+
iter_test_forward();
|
|
2129
|
+
|
|
2130
|
+
get_perf_context()->Reset();
|
|
2131
|
+
iter->SeekForPrev(Key(2));
|
|
2132
|
+
// Reseeked L0 and L1
|
|
2133
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 2);
|
|
2134
|
+
iter_test_forward();
|
|
2135
|
+
get_perf_context()->Reset();
|
|
2136
|
+
iter->SeekForPrev(Key(1));
|
|
2137
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 0);
|
|
2138
|
+
iter_test_forward();
|
|
2139
|
+
|
|
2140
|
+
get_perf_context()->Reset();
|
|
2141
|
+
iter->SeekToFirst();
|
|
2142
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 0);
|
|
2143
|
+
iter_test_forward();
|
|
2144
|
+
|
|
2145
|
+
iter->SeekToLast();
|
|
2146
|
+
iter->Prev();
|
|
2147
|
+
iter_test_forward();
|
|
2148
|
+
delete iter;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
TEST_F(DBRangeDelTest, TombstoneFromCurrentLevel) {
|
|
2152
|
+
// Range tombstone triggers reseek when covering key from the same level.
|
|
2153
|
+
// in merging iterator. Test set up:
|
|
2154
|
+
// memtable has: [0, 1)
|
|
2155
|
+
// L0 has: [2, 3), 2
|
|
2156
|
+
// L1 has: 1, 2, 3
|
|
2157
|
+
// Seek(0) will reseek to 1 for L0 and L1.
|
|
2158
|
+
// Then Next() will reseek to 3 for L1 since 2 in L0 is covered by [2, 3) in
|
|
2159
|
+
// L0.
|
|
2160
|
+
Options options = CurrentOptions();
|
|
2161
|
+
options.compression = kNoCompression;
|
|
2162
|
+
options.disable_auto_compactions = true;
|
|
2163
|
+
|
|
2164
|
+
DestroyAndReopen(options);
|
|
2165
|
+
// L1
|
|
2166
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(1), "foo"));
|
|
2167
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(2), "foo"));
|
|
2168
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(3), "foo"));
|
|
2169
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2170
|
+
MoveFilesToLevel(1);
|
|
2171
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2172
|
+
|
|
2173
|
+
// L0
|
|
2174
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(2), "foo"));
|
|
2175
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(2),
|
|
2176
|
+
Key(3)));
|
|
2177
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2178
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
2179
|
+
|
|
2180
|
+
// Memtable
|
|
2181
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(0),
|
|
2182
|
+
Key(1)));
|
|
2183
|
+
|
|
2184
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2185
|
+
get_perf_context()->Reset();
|
|
2186
|
+
iter->Seek(Key(0));
|
|
2187
|
+
ASSERT_TRUE(iter->Valid());
|
|
2188
|
+
ASSERT_EQ(iter->key().ToString(), Key(1));
|
|
2189
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 2);
|
|
2190
|
+
|
|
2191
|
+
get_perf_context()->Reset();
|
|
2192
|
+
iter->Next();
|
|
2193
|
+
ASSERT_TRUE(iter->Valid());
|
|
2194
|
+
ASSERT_EQ(iter->key().ToString(), Key(3));
|
|
2195
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 1);
|
|
2196
|
+
|
|
2197
|
+
delete iter;
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
class TombstoneTestSstPartitioner : public SstPartitioner {
|
|
2201
|
+
public:
|
|
2202
|
+
const char* Name() const override { return "SingleKeySstPartitioner"; }
|
|
2203
|
+
|
|
2204
|
+
PartitionerResult ShouldPartition(
|
|
2205
|
+
const PartitionerRequest& request) override {
|
|
2206
|
+
if (cmp->Compare(*request.current_user_key, DBTestBase::Key(5)) == 0) {
|
|
2207
|
+
return kRequired;
|
|
2208
|
+
} else {
|
|
2209
|
+
return kNotRequired;
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
bool CanDoTrivialMove(const Slice& /*smallest_user_key*/,
|
|
2214
|
+
const Slice& /*largest_user_key*/) override {
|
|
2215
|
+
return false;
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2218
|
+
const Comparator* cmp = BytewiseComparator();
|
|
2219
|
+
};
|
|
2220
|
+
|
|
2221
|
+
class TombstoneTestSstPartitionerFactory : public SstPartitionerFactory {
|
|
2222
|
+
public:
|
|
2223
|
+
static const char* kClassName() {
|
|
2224
|
+
return "TombstoneTestSstPartitionerFactory";
|
|
2225
|
+
}
|
|
2226
|
+
const char* Name() const override { return kClassName(); }
|
|
2227
|
+
|
|
2228
|
+
std::unique_ptr<SstPartitioner> CreatePartitioner(
|
|
2229
|
+
const SstPartitioner::Context& /* context */) const override {
|
|
2230
|
+
return std::unique_ptr<SstPartitioner>(new TombstoneTestSstPartitioner());
|
|
2231
|
+
}
|
|
2232
|
+
};
|
|
2233
|
+
|
|
2234
|
+
TEST_F(DBRangeDelTest, TombstoneAcrossFileBoundary) {
|
|
2235
|
+
// Verify that a range tombstone across file boundary covers keys from older
|
|
2236
|
+
// levels. Test set up:
|
|
2237
|
+
// L1_0: 1, 3, [2, 6) L1_1: 5, 7, [2, 6) ([2, 6) is from compaction with
|
|
2238
|
+
// L1_0) L2 has: 5
|
|
2239
|
+
// Seek(1) and then Next() should move the L1 level iterator to
|
|
2240
|
+
// L1_1. Check if 5 is returned after Next().
|
|
2241
|
+
Options options = CurrentOptions();
|
|
2242
|
+
options.compression = kNoCompression;
|
|
2243
|
+
options.disable_auto_compactions = true;
|
|
2244
|
+
options.target_file_size_base = 2 * 1024;
|
|
2245
|
+
options.max_compaction_bytes = 2 * 1024;
|
|
2246
|
+
|
|
2247
|
+
// Make sure L1 files are split before "5"
|
|
2248
|
+
auto factory = std::make_shared<TombstoneTestSstPartitionerFactory>();
|
|
2249
|
+
options.sst_partitioner_factory = factory;
|
|
2250
|
+
|
|
2251
|
+
DestroyAndReopen(options);
|
|
2252
|
+
|
|
2253
|
+
Random rnd(301);
|
|
2254
|
+
// L2
|
|
2255
|
+
// the file should be smaller than max_compaction_bytes, otherwise the file
|
|
2256
|
+
// will be cut before 7.
|
|
2257
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(5), rnd.RandomString(1 << 9)));
|
|
2258
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2259
|
+
MoveFilesToLevel(2);
|
|
2260
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2261
|
+
|
|
2262
|
+
// L1_1
|
|
2263
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(5), rnd.RandomString(1 << 10)));
|
|
2264
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(7), rnd.RandomString(1 << 10)));
|
|
2265
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2266
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
2267
|
+
|
|
2268
|
+
// L1_0
|
|
2269
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(1), rnd.RandomString(1 << 10)));
|
|
2270
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(3), rnd.RandomString(1 << 10)));
|
|
2271
|
+
// Prevent keys being compacted away
|
|
2272
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
2273
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(2),
|
|
2274
|
+
Key(6)));
|
|
2275
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2276
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(0));
|
|
2277
|
+
MoveFilesToLevel(1);
|
|
2278
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
2279
|
+
|
|
2280
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2281
|
+
get_perf_context()->Reset();
|
|
2282
|
+
iter->Seek(Key(1));
|
|
2283
|
+
ASSERT_TRUE(iter->Valid());
|
|
2284
|
+
ASSERT_EQ(iter->key().ToString(), Key(1));
|
|
2285
|
+
iter->Next();
|
|
2286
|
+
ASSERT_TRUE(iter->Valid());
|
|
2287
|
+
ASSERT_EQ(iter->key().ToString(), Key(7));
|
|
2288
|
+
// 1 reseek into L2 when key 5 in L2 is covered by [2, 6) from L1
|
|
2289
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 1);
|
|
2290
|
+
|
|
2291
|
+
delete iter;
|
|
2292
|
+
db_->ReleaseSnapshot(snapshot);
|
|
2293
|
+
}
|
|
2294
|
+
|
|
2295
|
+
TEST_F(DBRangeDelTest, NonOverlappingTombstonAtBoundary) {
|
|
2296
|
+
// Verify that a range tombstone across file boundary covers keys from older
|
|
2297
|
+
// levels.
|
|
2298
|
+
// Test set up:
|
|
2299
|
+
// L1_0: 1, 3, [4, 7) L1_1: 6, 8, [4, 7)
|
|
2300
|
+
// L2: 5
|
|
2301
|
+
// Note that [4, 7) is at end of L1_0 and not overlapping with any point key
|
|
2302
|
+
// in L1_0. [4, 7) from L1_0 should cover 5 is sentinel works
|
|
2303
|
+
Options options = CurrentOptions();
|
|
2304
|
+
options.compression = kNoCompression;
|
|
2305
|
+
options.disable_auto_compactions = true;
|
|
2306
|
+
options.target_file_size_base = 2 * 1024;
|
|
2307
|
+
options.level_compaction_dynamic_file_size = false;
|
|
2308
|
+
DestroyAndReopen(options);
|
|
2309
|
+
|
|
2310
|
+
Random rnd(301);
|
|
2311
|
+
// L2
|
|
2312
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(5), rnd.RandomString(4 << 10)));
|
|
2313
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2314
|
+
MoveFilesToLevel(2);
|
|
2315
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2316
|
+
|
|
2317
|
+
// L1_1
|
|
2318
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(6), rnd.RandomString(4 << 10)));
|
|
2319
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(8), rnd.RandomString(4 << 10)));
|
|
2320
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2321
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
2322
|
+
|
|
2323
|
+
// L1_0
|
|
2324
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(1), rnd.RandomString(4 << 10)));
|
|
2325
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(3), rnd.RandomString(4 << 10)));
|
|
2326
|
+
// Prevent keys being compacted away
|
|
2327
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(4),
|
|
2328
|
+
Key(7)));
|
|
2329
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2330
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(0));
|
|
2331
|
+
MoveFilesToLevel(1);
|
|
2332
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
2333
|
+
|
|
2334
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2335
|
+
iter->Seek(Key(3));
|
|
2336
|
+
ASSERT_TRUE(iter->Valid());
|
|
2337
|
+
ASSERT_EQ(iter->key(), Key(3));
|
|
2338
|
+
get_perf_context()->Reset();
|
|
2339
|
+
iter->Next();
|
|
2340
|
+
ASSERT_TRUE(iter->Valid());
|
|
2341
|
+
ASSERT_EQ(iter->key().ToString(), Key(8));
|
|
2342
|
+
// 1 reseek into L1 since 5 from L2 is covered by [4, 7) from L1
|
|
2343
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 1);
|
|
2344
|
+
for (auto& k : {4, 5, 6}) {
|
|
2345
|
+
get_perf_context()->Reset();
|
|
2346
|
+
iter->Seek(Key(k));
|
|
2347
|
+
ASSERT_TRUE(iter->Valid());
|
|
2348
|
+
ASSERT_EQ(iter->key().ToString(), Key(8));
|
|
2349
|
+
// 1 reseek into L1
|
|
2350
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count, 1);
|
|
2351
|
+
}
|
|
2352
|
+
delete iter;
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
TEST_F(DBRangeDelTest, OlderLevelHasNewerData) {
|
|
2356
|
+
// L1_0: 1, 3, [2, 7) L1_1: 5, 6 at a newer sequence number than [2, 7)
|
|
2357
|
+
// Compact L1_1 to L2. Seek(3) should not skip 5 or 6.
|
|
2358
|
+
Options options = CurrentOptions();
|
|
2359
|
+
options.compression = kNoCompression;
|
|
2360
|
+
options.disable_auto_compactions = true;
|
|
2361
|
+
options.target_file_size_base = 3 * 1024;
|
|
2362
|
+
DestroyAndReopen(options);
|
|
2363
|
+
|
|
2364
|
+
Random rnd(301);
|
|
2365
|
+
// L1_0
|
|
2366
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(1), rnd.RandomString(4 << 10)));
|
|
2367
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(3), rnd.RandomString(4 << 10)));
|
|
2368
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
2369
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(2),
|
|
2370
|
+
Key(7)));
|
|
2371
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2372
|
+
MoveFilesToLevel(1);
|
|
2373
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2374
|
+
|
|
2375
|
+
// L1_1
|
|
2376
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(5), rnd.RandomString(4 << 10)));
|
|
2377
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(6), rnd.RandomString(4 << 10)));
|
|
2378
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2379
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(0));
|
|
2380
|
+
MoveFilesToLevel(1);
|
|
2381
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
2382
|
+
|
|
2383
|
+
auto key = Key(6);
|
|
2384
|
+
Slice begin(key);
|
|
2385
|
+
EXPECT_OK(dbfull()->TEST_CompactRange(1, &begin, nullptr));
|
|
2386
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2387
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2388
|
+
|
|
2389
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2390
|
+
iter->Seek(Key(3));
|
|
2391
|
+
ASSERT_TRUE(iter->Valid());
|
|
2392
|
+
ASSERT_EQ(iter->key().ToString(), Key(5));
|
|
2393
|
+
iter->Next();
|
|
2394
|
+
ASSERT_TRUE(iter->Valid());
|
|
2395
|
+
ASSERT_EQ(iter->key().ToString(), Key(6));
|
|
2396
|
+
delete iter;
|
|
2397
|
+
db_->ReleaseSnapshot(snapshot);
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
TEST_F(DBRangeDelTest, LevelBoundaryDefinedByTombstone) {
|
|
2401
|
+
// L1 has: 1, 2, [4, 5)
|
|
2402
|
+
// L2 has: 4
|
|
2403
|
+
// Seek(3), which is over all points keys in L1, check whether
|
|
2404
|
+
// sentinel key from L1 works in this case.
|
|
2405
|
+
Options options = CurrentOptions();
|
|
2406
|
+
options.compression = kNoCompression;
|
|
2407
|
+
options.disable_auto_compactions = true;
|
|
2408
|
+
options.target_file_size_base = 3 * 1024;
|
|
2409
|
+
DestroyAndReopen(options);
|
|
2410
|
+
Random rnd(301);
|
|
2411
|
+
// L2
|
|
2412
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(4), "foo"));
|
|
2413
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2414
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
2415
|
+
MoveFilesToLevel(2);
|
|
2416
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2417
|
+
|
|
2418
|
+
// L1_0
|
|
2419
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(1), rnd.RandomString(4 << 10)));
|
|
2420
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(2), rnd.RandomString(4 << 10)));
|
|
2421
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(4),
|
|
2422
|
+
Key(5)));
|
|
2423
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2424
|
+
MoveFilesToLevel(1);
|
|
2425
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2426
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2427
|
+
|
|
2428
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2429
|
+
iter->Seek(Key(3));
|
|
2430
|
+
ASSERT_TRUE(!iter->Valid());
|
|
2431
|
+
ASSERT_OK(iter->status());
|
|
2432
|
+
|
|
2433
|
+
get_perf_context()->Reset();
|
|
2434
|
+
iter->SeekForPrev(Key(5));
|
|
2435
|
+
ASSERT_TRUE(iter->Valid());
|
|
2436
|
+
ASSERT_EQ(iter->key(), Key(2));
|
|
2437
|
+
db_->ReleaseSnapshot(snapshot);
|
|
2438
|
+
delete iter;
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
TEST_F(DBRangeDelTest, TombstoneOnlyFile) {
|
|
2442
|
+
// L1_0: 1, 2, L1_1: [3, 5)
|
|
2443
|
+
// L2: 3
|
|
2444
|
+
// Seek(2) then Next() should advance L1 iterator into L1_1.
|
|
2445
|
+
// If sentinel works with tombstone only file, it should cover the key in L2.
|
|
2446
|
+
// Similar story for SeekForPrev(4).
|
|
2447
|
+
Options options = CurrentOptions();
|
|
2448
|
+
options.compression = kNoCompression;
|
|
2449
|
+
options.disable_auto_compactions = true;
|
|
2450
|
+
options.target_file_size_base = 3 * 1024;
|
|
2451
|
+
|
|
2452
|
+
DestroyAndReopen(options);
|
|
2453
|
+
Random rnd(301);
|
|
2454
|
+
// L2
|
|
2455
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(3), "foo"));
|
|
2456
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2457
|
+
MoveFilesToLevel(2);
|
|
2458
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2459
|
+
|
|
2460
|
+
// L1_0
|
|
2461
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(1), rnd.RandomString(4 << 10)));
|
|
2462
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(2), rnd.RandomString(4 << 10)));
|
|
2463
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2464
|
+
MoveFilesToLevel(1);
|
|
2465
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2466
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2467
|
+
|
|
2468
|
+
// L1_1
|
|
2469
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(3),
|
|
2470
|
+
Key(5)));
|
|
2471
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2472
|
+
MoveFilesToLevel(1);
|
|
2473
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
2474
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2475
|
+
|
|
2476
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2477
|
+
iter->Seek(Key(2));
|
|
2478
|
+
ASSERT_TRUE(iter->Valid());
|
|
2479
|
+
ASSERT_EQ(iter->key(), Key(2));
|
|
2480
|
+
iter->Next();
|
|
2481
|
+
VerifyIteratorReachesEnd(iter);
|
|
2482
|
+
iter->SeekForPrev(Key(4));
|
|
2483
|
+
ASSERT_TRUE(iter->Valid());
|
|
2484
|
+
ASSERT_EQ(iter->key(), Key(2));
|
|
2485
|
+
iter->Next();
|
|
2486
|
+
VerifyIteratorReachesEnd(iter);
|
|
2487
|
+
delete iter;
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
void VerifyIteratorKey(InternalIterator* iter,
|
|
2491
|
+
const std::vector<std::string>& expected_keys,
|
|
2492
|
+
bool forward = true) {
|
|
2493
|
+
for (auto& key : expected_keys) {
|
|
2494
|
+
ASSERT_TRUE(iter->Valid());
|
|
2495
|
+
ASSERT_EQ(iter->user_key(), key);
|
|
2496
|
+
if (forward) {
|
|
2497
|
+
iter->Next();
|
|
2498
|
+
} else {
|
|
2499
|
+
iter->Prev();
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
TEST_F(DBRangeDelTest, TombstoneOnlyLevel) {
|
|
2505
|
+
// L1 [3, 5)
|
|
2506
|
+
// L2 has: 3, 4
|
|
2507
|
+
// Any kind of iterator seek should skip 3 and 4 in L2.
|
|
2508
|
+
// L1 level iterator should produce sentinel key.
|
|
2509
|
+
Options options = CurrentOptions();
|
|
2510
|
+
options.compression = kNoCompression;
|
|
2511
|
+
options.disable_auto_compactions = true;
|
|
2512
|
+
options.target_file_size_base = 3 * 1024;
|
|
2513
|
+
|
|
2514
|
+
DestroyAndReopen(options);
|
|
2515
|
+
// L2
|
|
2516
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(3), "foo"));
|
|
2517
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(4), "bar"));
|
|
2518
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2519
|
+
MoveFilesToLevel(2);
|
|
2520
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2521
|
+
|
|
2522
|
+
// L1
|
|
2523
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(3),
|
|
2524
|
+
Key(5)));
|
|
2525
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2526
|
+
MoveFilesToLevel(1);
|
|
2527
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2528
|
+
|
|
2529
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2530
|
+
get_perf_context()->Reset();
|
|
2531
|
+
uint64_t expected_reseek = 0;
|
|
2532
|
+
for (auto i = 0; i < 7; ++i) {
|
|
2533
|
+
iter->Seek(Key(i));
|
|
2534
|
+
VerifyIteratorReachesEnd(iter);
|
|
2535
|
+
if (i < 5) {
|
|
2536
|
+
++expected_reseek;
|
|
2537
|
+
}
|
|
2538
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count,
|
|
2539
|
+
expected_reseek);
|
|
2540
|
+
iter->SeekForPrev(Key(i));
|
|
2541
|
+
VerifyIteratorReachesEnd(iter);
|
|
2542
|
+
if (i > 2) {
|
|
2543
|
+
++expected_reseek;
|
|
2544
|
+
}
|
|
2545
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count,
|
|
2546
|
+
expected_reseek);
|
|
2547
|
+
iter->SeekToFirst();
|
|
2548
|
+
VerifyIteratorReachesEnd(iter);
|
|
2549
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count,
|
|
2550
|
+
++expected_reseek);
|
|
2551
|
+
iter->SeekToLast();
|
|
2552
|
+
VerifyIteratorReachesEnd(iter);
|
|
2553
|
+
ASSERT_EQ(get_perf_context()->internal_range_del_reseek_count,
|
|
2554
|
+
++expected_reseek);
|
|
2555
|
+
}
|
|
2556
|
+
delete iter;
|
|
2557
|
+
|
|
2558
|
+
// Check L1 LevelIterator behavior
|
|
2559
|
+
ColumnFamilyData* cfd =
|
|
2560
|
+
static_cast_with_check<ColumnFamilyHandleImpl>(db_->DefaultColumnFamily())
|
|
2561
|
+
->cfd();
|
|
2562
|
+
SuperVersion* sv = cfd->GetSuperVersion();
|
|
2563
|
+
Arena arena;
|
|
2564
|
+
ReadOptions read_options;
|
|
2565
|
+
MergeIteratorBuilder merge_iter_builder(&cfd->internal_comparator(), &arena,
|
|
2566
|
+
false /* prefix seek */);
|
|
2567
|
+
InternalIterator* level_iter = sv->current->TEST_GetLevelIterator(
|
|
2568
|
+
read_options, &merge_iter_builder, 1 /* level */, true);
|
|
2569
|
+
// This is needed to make LevelIterator range tombstone aware
|
|
2570
|
+
auto miter = merge_iter_builder.Finish();
|
|
2571
|
+
auto k = Key(3);
|
|
2572
|
+
IterKey target;
|
|
2573
|
+
target.SetInternalKey(k, kMaxSequenceNumber, kValueTypeForSeek);
|
|
2574
|
+
level_iter->Seek(target.GetInternalKey());
|
|
2575
|
+
// sentinel key (file boundary as a fake key)
|
|
2576
|
+
VerifyIteratorKey(level_iter, {Key(5)});
|
|
2577
|
+
VerifyIteratorReachesEnd(level_iter);
|
|
2578
|
+
|
|
2579
|
+
k = Key(5);
|
|
2580
|
+
target.SetInternalKey(k, 0, kValueTypeForSeekForPrev);
|
|
2581
|
+
level_iter->SeekForPrev(target.GetInternalKey());
|
|
2582
|
+
VerifyIteratorKey(level_iter, {Key(3)}, false);
|
|
2583
|
+
VerifyIteratorReachesEnd(level_iter);
|
|
2584
|
+
|
|
2585
|
+
level_iter->SeekToFirst();
|
|
2586
|
+
VerifyIteratorKey(level_iter, {Key(5)});
|
|
2587
|
+
VerifyIteratorReachesEnd(level_iter);
|
|
2588
|
+
|
|
2589
|
+
level_iter->SeekToLast();
|
|
2590
|
+
VerifyIteratorKey(level_iter, {Key(3)}, false);
|
|
2591
|
+
VerifyIteratorReachesEnd(level_iter);
|
|
2592
|
+
|
|
2593
|
+
miter->~InternalIterator();
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
TEST_F(DBRangeDelTest, TombstoneOnlyWithOlderVisibleKey) {
|
|
2597
|
+
// L1: [3, 5)
|
|
2598
|
+
// L2: 2, 4, 5
|
|
2599
|
+
// 2 and 5 should be visible
|
|
2600
|
+
Options options = CurrentOptions();
|
|
2601
|
+
options.compression = kNoCompression;
|
|
2602
|
+
options.disable_auto_compactions = true;
|
|
2603
|
+
options.target_file_size_base = 3 * 1024;
|
|
2604
|
+
|
|
2605
|
+
DestroyAndReopen(options);
|
|
2606
|
+
// L2
|
|
2607
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(2), "foo"));
|
|
2608
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(4), "bar"));
|
|
2609
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(5), "foobar"));
|
|
2610
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2611
|
+
MoveFilesToLevel(2);
|
|
2612
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2613
|
+
|
|
2614
|
+
// l1
|
|
2615
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(3),
|
|
2616
|
+
Key(5)));
|
|
2617
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2618
|
+
MoveFilesToLevel(1);
|
|
2619
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2620
|
+
|
|
2621
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2622
|
+
auto iter_test_backward = [&] {
|
|
2623
|
+
ASSERT_TRUE(iter->Valid());
|
|
2624
|
+
ASSERT_EQ(iter->key(), Key(5));
|
|
2625
|
+
iter->Prev();
|
|
2626
|
+
ASSERT_TRUE(iter->Valid());
|
|
2627
|
+
ASSERT_EQ(iter->key(), Key(2));
|
|
2628
|
+
iter->Prev();
|
|
2629
|
+
VerifyIteratorReachesEnd(iter);
|
|
2630
|
+
};
|
|
2631
|
+
auto iter_test_forward = [&] {
|
|
2632
|
+
ASSERT_TRUE(iter->Valid());
|
|
2633
|
+
ASSERT_EQ(iter->key(), Key(2));
|
|
2634
|
+
iter->Next();
|
|
2635
|
+
ASSERT_TRUE(iter->Valid());
|
|
2636
|
+
ASSERT_EQ(iter->key(), Key(5));
|
|
2637
|
+
iter->Next();
|
|
2638
|
+
VerifyIteratorReachesEnd(iter);
|
|
2639
|
+
};
|
|
2640
|
+
iter->Seek(Key(4));
|
|
2641
|
+
iter_test_backward();
|
|
2642
|
+
iter->SeekForPrev(Key(4));
|
|
2643
|
+
iter->Next();
|
|
2644
|
+
iter_test_backward();
|
|
2645
|
+
|
|
2646
|
+
iter->Seek(Key(4));
|
|
2647
|
+
iter->Prev();
|
|
2648
|
+
iter_test_forward();
|
|
2649
|
+
iter->SeekForPrev(Key(4));
|
|
2650
|
+
iter_test_forward();
|
|
2651
|
+
|
|
2652
|
+
iter->SeekToFirst();
|
|
2653
|
+
iter_test_forward();
|
|
2654
|
+
iter->SeekToLast();
|
|
2655
|
+
iter_test_backward();
|
|
2656
|
+
|
|
2657
|
+
delete iter;
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
TEST_F(DBRangeDelTest, TombstoneSentinelDirectionChange) {
|
|
2661
|
+
// L1: 7
|
|
2662
|
+
// L2: [4, 6)
|
|
2663
|
+
// L3: 4
|
|
2664
|
+
// Seek(5) will have sentinel key 6 at the top of minHeap in merging iterator.
|
|
2665
|
+
// then do a prev, how would sentinel work?
|
|
2666
|
+
// Redo the test after Put(5) into L1 so that there is a visible key in range
|
|
2667
|
+
// [4, 6).
|
|
2668
|
+
Options options = CurrentOptions();
|
|
2669
|
+
options.compression = kNoCompression;
|
|
2670
|
+
options.disable_auto_compactions = true;
|
|
2671
|
+
options.target_file_size_base = 3 * 1024;
|
|
2672
|
+
|
|
2673
|
+
DestroyAndReopen(options);
|
|
2674
|
+
// L3
|
|
2675
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(4), "bar"));
|
|
2676
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2677
|
+
MoveFilesToLevel(3);
|
|
2678
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(3));
|
|
2679
|
+
// L2
|
|
2680
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(4),
|
|
2681
|
+
Key(6)));
|
|
2682
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2683
|
+
MoveFilesToLevel(2);
|
|
2684
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2685
|
+
|
|
2686
|
+
// L1
|
|
2687
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(7), "foobar"));
|
|
2688
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2689
|
+
MoveFilesToLevel(1);
|
|
2690
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2691
|
+
|
|
2692
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2693
|
+
iter->Seek(Key(5));
|
|
2694
|
+
ASSERT_TRUE(iter->Valid());
|
|
2695
|
+
ASSERT_EQ(iter->key(), Key(7));
|
|
2696
|
+
iter->Prev();
|
|
2697
|
+
ASSERT_TRUE(!iter->Valid() && iter->status().ok());
|
|
2698
|
+
delete iter;
|
|
2699
|
+
|
|
2700
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(5), "foobar"));
|
|
2701
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2702
|
+
MoveFilesToLevel(1);
|
|
2703
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
2704
|
+
|
|
2705
|
+
iter = db_->NewIterator(ReadOptions());
|
|
2706
|
+
iter->Seek(Key(5));
|
|
2707
|
+
ASSERT_TRUE(iter->Valid());
|
|
2708
|
+
ASSERT_EQ(iter->key(), Key(5));
|
|
2709
|
+
iter->Prev();
|
|
2710
|
+
ASSERT_TRUE(!iter->Valid() && iter->status().ok());
|
|
2711
|
+
delete iter;
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
// Right sentinel tested in many test cases above
|
|
2715
|
+
TEST_F(DBRangeDelTest, LeftSentinelKeyTest) {
|
|
2716
|
+
// L1_0: 0, 1 L1_1: [2, 3), 5
|
|
2717
|
+
// L2: 2
|
|
2718
|
+
// SeekForPrev(4) should give 1 due to sentinel key keeping [2, 3) alive.
|
|
2719
|
+
Options options = CurrentOptions();
|
|
2720
|
+
options.compression = kNoCompression;
|
|
2721
|
+
options.disable_auto_compactions = true;
|
|
2722
|
+
options.target_file_size_base = 3 * 1024;
|
|
2723
|
+
options.max_compaction_bytes = 2048;
|
|
2724
|
+
|
|
2725
|
+
DestroyAndReopen(options);
|
|
2726
|
+
// L2
|
|
2727
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(2), "foo"));
|
|
2728
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2729
|
+
MoveFilesToLevel(2);
|
|
2730
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2731
|
+
|
|
2732
|
+
// L1_0
|
|
2733
|
+
Random rnd(301);
|
|
2734
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(0), rnd.RandomString(4 << 10)));
|
|
2735
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(1), rnd.RandomString(4 << 10)));
|
|
2736
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2737
|
+
MoveFilesToLevel(1);
|
|
2738
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2739
|
+
|
|
2740
|
+
// L1_1
|
|
2741
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(5), "bar"));
|
|
2742
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(2),
|
|
2743
|
+
Key(3)));
|
|
2744
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2745
|
+
MoveFilesToLevel(1);
|
|
2746
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
2747
|
+
|
|
2748
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2749
|
+
iter->SeekForPrev(Key(4));
|
|
2750
|
+
ASSERT_TRUE(iter->Valid());
|
|
2751
|
+
ASSERT_EQ(iter->key(), Key(1));
|
|
2752
|
+
iter->Prev();
|
|
2753
|
+
ASSERT_TRUE(iter->Valid());
|
|
2754
|
+
ASSERT_EQ(iter->key(), Key(0));
|
|
2755
|
+
iter->Prev();
|
|
2756
|
+
ASSERT_TRUE(!iter->Valid());
|
|
2757
|
+
ASSERT_OK(iter->status());
|
|
2758
|
+
delete iter;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
TEST_F(DBRangeDelTest, LeftSentinelKeyTestWithNewerKey) {
|
|
2762
|
+
// L1_0: 1, 2 newer than L1_1, L1_1: [2, 4), 5
|
|
2763
|
+
// L2: 3
|
|
2764
|
+
// SeekForPrev(4) then Prev() should give 2 and then 1.
|
|
2765
|
+
Options options = CurrentOptions();
|
|
2766
|
+
options.compression = kNoCompression;
|
|
2767
|
+
options.disable_auto_compactions = true;
|
|
2768
|
+
options.target_file_size_base = 3 * 1024;
|
|
2769
|
+
options.max_compaction_bytes = 3 * 1024;
|
|
2770
|
+
|
|
2771
|
+
DestroyAndReopen(options);
|
|
2772
|
+
// L2
|
|
2773
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(3), "foo"));
|
|
2774
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2775
|
+
MoveFilesToLevel(2);
|
|
2776
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2777
|
+
|
|
2778
|
+
// L1_1
|
|
2779
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(5), "bar"));
|
|
2780
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(2),
|
|
2781
|
+
Key(4)));
|
|
2782
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2783
|
+
MoveFilesToLevel(1);
|
|
2784
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2785
|
+
|
|
2786
|
+
// L1_0
|
|
2787
|
+
Random rnd(301);
|
|
2788
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(1), rnd.RandomString(4 << 10)));
|
|
2789
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(2), rnd.RandomString(4 << 10)));
|
|
2790
|
+
// Used to verify sequence number of iterator key later.
|
|
2791
|
+
auto seq = dbfull()->TEST_GetLastVisibleSequence();
|
|
2792
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2793
|
+
MoveFilesToLevel(1);
|
|
2794
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
2795
|
+
|
|
2796
|
+
Arena arena;
|
|
2797
|
+
InternalKeyComparator icmp(options.comparator);
|
|
2798
|
+
ReadOptions read_options;
|
|
2799
|
+
ScopedArenaIterator iter;
|
|
2800
|
+
iter.set(
|
|
2801
|
+
dbfull()->NewInternalIterator(read_options, &arena, kMaxSequenceNumber));
|
|
2802
|
+
|
|
2803
|
+
auto k = Key(4);
|
|
2804
|
+
IterKey target;
|
|
2805
|
+
target.SetInternalKey(k, 0 /* sequence_number */, kValueTypeForSeekForPrev);
|
|
2806
|
+
iter->SeekForPrev(target.GetInternalKey());
|
|
2807
|
+
ASSERT_TRUE(iter->Valid());
|
|
2808
|
+
ASSERT_EQ(iter->user_key(), Key(2));
|
|
2809
|
+
SequenceNumber actual_seq;
|
|
2810
|
+
ValueType type;
|
|
2811
|
+
UnPackSequenceAndType(ExtractInternalKeyFooter(iter->key()), &actual_seq,
|
|
2812
|
+
&type);
|
|
2813
|
+
ASSERT_EQ(seq, actual_seq);
|
|
2814
|
+
// might as well check type
|
|
2815
|
+
ASSERT_EQ(type, kTypeValue);
|
|
2816
|
+
|
|
2817
|
+
iter->Prev();
|
|
2818
|
+
ASSERT_TRUE(iter->Valid());
|
|
2819
|
+
ASSERT_EQ(iter->user_key(), Key(1));
|
|
2820
|
+
iter->Prev();
|
|
2821
|
+
ASSERT_TRUE(!iter->Valid());
|
|
2822
|
+
ASSERT_OK(iter->status());
|
|
2823
|
+
}
|
|
2824
|
+
|
|
2825
|
+
TEST_F(DBRangeDelTest, SentinelKeyCommonCaseTest) {
|
|
2826
|
+
// L1 has 3 files
|
|
2827
|
+
// L1_0: 1, 2 L1_1: [3, 4) 5, 6, [7, 8) L1_2: 9
|
|
2828
|
+
// Check iterator operations on LevelIterator.
|
|
2829
|
+
Options options = CurrentOptions();
|
|
2830
|
+
options.compression = kNoCompression;
|
|
2831
|
+
options.disable_auto_compactions = true;
|
|
2832
|
+
options.target_file_size_base = 3 * 1024;
|
|
2833
|
+
|
|
2834
|
+
DestroyAndReopen(options);
|
|
2835
|
+
Random rnd(301);
|
|
2836
|
+
// L1_0
|
|
2837
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(1), rnd.RandomString(4 << 10)));
|
|
2838
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(2), rnd.RandomString(4 << 10)));
|
|
2839
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2840
|
+
MoveFilesToLevel(1);
|
|
2841
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2842
|
+
|
|
2843
|
+
// L1_1
|
|
2844
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(3),
|
|
2845
|
+
Key(4)));
|
|
2846
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(5), rnd.RandomString(4 << 10)));
|
|
2847
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(6), rnd.RandomString(4 << 10)));
|
|
2848
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(7),
|
|
2849
|
+
Key(8)));
|
|
2850
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2851
|
+
MoveFilesToLevel(1);
|
|
2852
|
+
ASSERT_EQ(2, NumTableFilesAtLevel(1));
|
|
2853
|
+
|
|
2854
|
+
// L1_2
|
|
2855
|
+
ASSERT_OK(db_->Put(WriteOptions(), Key(9), rnd.RandomString(4 << 10)));
|
|
2856
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2857
|
+
MoveFilesToLevel(1);
|
|
2858
|
+
ASSERT_EQ(3, NumTableFilesAtLevel(1));
|
|
2859
|
+
|
|
2860
|
+
ColumnFamilyData* cfd =
|
|
2861
|
+
static_cast_with_check<ColumnFamilyHandleImpl>(db_->DefaultColumnFamily())
|
|
2862
|
+
->cfd();
|
|
2863
|
+
SuperVersion* sv = cfd->GetSuperVersion();
|
|
2864
|
+
Arena arena;
|
|
2865
|
+
ReadOptions read_options;
|
|
2866
|
+
MergeIteratorBuilder merge_iter_builder(&cfd->internal_comparator(), &arena,
|
|
2867
|
+
false /* prefix seek */);
|
|
2868
|
+
InternalIterator* level_iter = sv->current->TEST_GetLevelIterator(
|
|
2869
|
+
read_options, &merge_iter_builder, 1 /* level */, true);
|
|
2870
|
+
// This is needed to make LevelIterator range tombstone aware
|
|
2871
|
+
auto miter = merge_iter_builder.Finish();
|
|
2872
|
+
auto k = Key(7);
|
|
2873
|
+
IterKey target;
|
|
2874
|
+
target.SetInternalKey(k, kMaxSequenceNumber, kValueTypeForSeek);
|
|
2875
|
+
level_iter->Seek(target.GetInternalKey());
|
|
2876
|
+
// The last Key(9) is a sentinel key.
|
|
2877
|
+
VerifyIteratorKey(level_iter, {Key(8), Key(9), Key(9)});
|
|
2878
|
+
ASSERT_TRUE(!level_iter->Valid() && level_iter->status().ok());
|
|
2879
|
+
|
|
2880
|
+
k = Key(6);
|
|
2881
|
+
target.SetInternalKey(k, kMaxSequenceNumber, kValueTypeForSeek);
|
|
2882
|
+
level_iter->Seek(target.GetInternalKey());
|
|
2883
|
+
VerifyIteratorKey(level_iter, {Key(6), Key(8), Key(9), Key(9)});
|
|
2884
|
+
ASSERT_TRUE(!level_iter->Valid() && level_iter->status().ok());
|
|
2885
|
+
|
|
2886
|
+
k = Key(4);
|
|
2887
|
+
target.SetInternalKey(k, 0, kValueTypeForSeekForPrev);
|
|
2888
|
+
level_iter->SeekForPrev(target.GetInternalKey());
|
|
2889
|
+
VerifyIteratorKey(level_iter, {Key(3), Key(2), Key(1), Key(1)}, false);
|
|
2890
|
+
ASSERT_TRUE(!level_iter->Valid() && level_iter->status().ok());
|
|
2891
|
+
|
|
2892
|
+
k = Key(5);
|
|
2893
|
+
target.SetInternalKey(k, 0, kValueTypeForSeekForPrev);
|
|
2894
|
+
level_iter->SeekForPrev(target.GetInternalKey());
|
|
2895
|
+
VerifyIteratorKey(level_iter, {Key(5), Key(3), Key(2), Key(1), Key(1)},
|
|
2896
|
+
false);
|
|
2897
|
+
|
|
2898
|
+
level_iter->SeekToFirst();
|
|
2899
|
+
VerifyIteratorKey(level_iter, {Key(1), Key(2), Key(2), Key(5), Key(6), Key(8),
|
|
2900
|
+
Key(9), Key(9)});
|
|
2901
|
+
ASSERT_TRUE(!level_iter->Valid() && level_iter->status().ok());
|
|
2902
|
+
|
|
2903
|
+
level_iter->SeekToLast();
|
|
2904
|
+
VerifyIteratorKey(
|
|
2905
|
+
level_iter,
|
|
2906
|
+
{Key(9), Key(9), Key(6), Key(5), Key(3), Key(2), Key(1), Key(1)}, false);
|
|
2907
|
+
ASSERT_TRUE(!level_iter->Valid() && level_iter->status().ok());
|
|
2908
|
+
|
|
2909
|
+
miter->~InternalIterator();
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
TEST_F(DBRangeDelTest, PrefixSentinelKey) {
|
|
2913
|
+
// L1: ['aaaa', 'aaad'), 'bbbb'
|
|
2914
|
+
// L2: 'aaac', 'aaae'
|
|
2915
|
+
// Prefix extracts first 3 chars
|
|
2916
|
+
// Seek('aaab') should give 'aaae' as first key.
|
|
2917
|
+
// This is to test a previous bug where prefix seek sees there is no prefix in
|
|
2918
|
+
// the SST file, and will just set file iter to null in LevelIterator and may
|
|
2919
|
+
// just skip to the next SST file. But in this case, we should keep the file's
|
|
2920
|
+
// tombstone alive.
|
|
2921
|
+
Options options = CurrentOptions();
|
|
2922
|
+
options.compression = kNoCompression;
|
|
2923
|
+
options.disable_auto_compactions = true;
|
|
2924
|
+
options.prefix_extractor.reset(NewFixedPrefixTransform(3));
|
|
2925
|
+
BlockBasedTableOptions table_options;
|
|
2926
|
+
table_options.filter_policy.reset(NewBloomFilterPolicy(10, false));
|
|
2927
|
+
table_options.whole_key_filtering = false;
|
|
2928
|
+
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
|
2929
|
+
DestroyAndReopen(options);
|
|
2930
|
+
Random rnd(301);
|
|
2931
|
+
|
|
2932
|
+
// L2:
|
|
2933
|
+
ASSERT_OK(db_->Put(WriteOptions(), "aaac", rnd.RandomString(10)));
|
|
2934
|
+
ASSERT_OK(db_->Put(WriteOptions(), "aaae", rnd.RandomString(10)));
|
|
2935
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2936
|
+
MoveFilesToLevel(2);
|
|
2937
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(2));
|
|
2938
|
+
|
|
2939
|
+
// L1
|
|
2940
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "aaaa",
|
|
2941
|
+
"aaad"));
|
|
2942
|
+
ASSERT_OK(db_->Put(WriteOptions(), "bbbb", rnd.RandomString(10)));
|
|
2943
|
+
ASSERT_OK(db_->Flush(FlushOptions()));
|
|
2944
|
+
MoveFilesToLevel(1);
|
|
2945
|
+
ASSERT_EQ(1, NumTableFilesAtLevel(1));
|
|
2946
|
+
|
|
2947
|
+
auto iter = db_->NewIterator(ReadOptions());
|
|
2948
|
+
iter->Seek("aaab");
|
|
2949
|
+
ASSERT_TRUE(iter->Valid());
|
|
2950
|
+
ASSERT_EQ(iter->key(), "aaae");
|
|
2951
|
+
delete iter;
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2954
|
+
TEST_F(DBRangeDelTest, RefreshMemtableIter) {
|
|
2955
|
+
Options options = CurrentOptions();
|
|
2956
|
+
options.disable_auto_compactions = true;
|
|
2957
|
+
DestroyAndReopen(options);
|
|
2958
|
+
ASSERT_OK(
|
|
2959
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
2960
|
+
ReadOptions ro;
|
|
2961
|
+
ro.read_tier = kMemtableTier;
|
|
2962
|
+
std::unique_ptr<Iterator> iter{db_->NewIterator(ro)};
|
|
2963
|
+
ASSERT_OK(Flush());
|
|
2964
|
+
// First refresh reinits iter, which had a bug where
|
|
2965
|
+
// iter.memtable_range_tombstone_iter_ was not set to nullptr, and caused
|
|
2966
|
+
// subsequent refresh to double free.
|
|
2967
|
+
ASSERT_OK(iter->Refresh());
|
|
2968
|
+
ASSERT_OK(iter->Refresh());
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
TEST_F(DBRangeDelTest, RangeTombstoneRespectIterateUpperBound) {
|
|
2972
|
+
// Memtable: a, [b, bz)
|
|
2973
|
+
// Do a Seek on `a` with iterate_upper_bound being az
|
|
2974
|
+
// range tombstone [b, bz) should not be processed (added to and
|
|
2975
|
+
// popped from the min_heap in MergingIterator).
|
|
2976
|
+
Options options = CurrentOptions();
|
|
2977
|
+
options.disable_auto_compactions = true;
|
|
2978
|
+
DestroyAndReopen(options);
|
|
2979
|
+
|
|
2980
|
+
ASSERT_OK(Put("a", "bar"));
|
|
2981
|
+
ASSERT_OK(
|
|
2982
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "b", "bz"));
|
|
2983
|
+
|
|
2984
|
+
// I could not find a cleaner way to test this without relying on
|
|
2985
|
+
// implementation detail. Tried to test the value of
|
|
2986
|
+
// `internal_range_del_reseek_count` but that did not work
|
|
2987
|
+
// since BlockBasedTable iterator becomes !Valid() when point key
|
|
2988
|
+
// is out of bound and that reseek only happens when a point key
|
|
2989
|
+
// is covered by some range tombstone.
|
|
2990
|
+
SyncPoint::GetInstance()->SetCallBack("MergeIterator::PopDeleteRangeStart",
|
|
2991
|
+
[](void*) {
|
|
2992
|
+
// there should not be any range
|
|
2993
|
+
// tombstone in the heap.
|
|
2994
|
+
FAIL();
|
|
2995
|
+
});
|
|
2996
|
+
SyncPoint::GetInstance()->EnableProcessing();
|
|
2997
|
+
|
|
2998
|
+
ReadOptions read_opts;
|
|
2999
|
+
std::string upper_bound = "az";
|
|
3000
|
+
Slice upper_bound_slice = upper_bound;
|
|
3001
|
+
read_opts.iterate_upper_bound = &upper_bound_slice;
|
|
3002
|
+
std::unique_ptr<Iterator> iter{db_->NewIterator(read_opts)};
|
|
3003
|
+
iter->Seek("a");
|
|
3004
|
+
ASSERT_TRUE(iter->Valid());
|
|
3005
|
+
ASSERT_EQ(iter->key(), "a");
|
|
3006
|
+
iter->Next();
|
|
3007
|
+
ASSERT_FALSE(iter->Valid());
|
|
3008
|
+
ASSERT_OK(iter->status());
|
|
3009
|
+
}
|
|
3010
|
+
|
|
3011
|
+
TEST_F(DBRangeDelTest, RangetombesoneCompensateFilesize) {
|
|
3012
|
+
Options opts = CurrentOptions();
|
|
3013
|
+
opts.disable_auto_compactions = true;
|
|
3014
|
+
DestroyAndReopen(opts);
|
|
3015
|
+
|
|
3016
|
+
std::vector<std::string> values;
|
|
3017
|
+
Random rnd(301);
|
|
3018
|
+
// file in L2
|
|
3019
|
+
values.push_back(rnd.RandomString(1 << 10));
|
|
3020
|
+
ASSERT_OK(Put("a", values.back()));
|
|
3021
|
+
values.push_back(rnd.RandomString(1 << 10));
|
|
3022
|
+
ASSERT_OK(Put("b", values.back()));
|
|
3023
|
+
ASSERT_OK(Flush());
|
|
3024
|
+
MoveFilesToLevel(2);
|
|
3025
|
+
uint64_t l2_size = 0;
|
|
3026
|
+
ASSERT_OK(Size("a", "c", 0 /* cf */, &l2_size));
|
|
3027
|
+
ASSERT_GT(l2_size, 0);
|
|
3028
|
+
// file in L1
|
|
3029
|
+
values.push_back(rnd.RandomString(1 << 10));
|
|
3030
|
+
ASSERT_OK(Put("d", values.back()));
|
|
3031
|
+
values.push_back(rnd.RandomString(1 << 10));
|
|
3032
|
+
ASSERT_OK(Put("e", values.back()));
|
|
3033
|
+
ASSERT_OK(Flush());
|
|
3034
|
+
MoveFilesToLevel(1);
|
|
3035
|
+
uint64_t l1_size = 0;
|
|
3036
|
+
ASSERT_OK(Size("d", "f", 0 /* cf */, &l1_size));
|
|
3037
|
+
ASSERT_GT(l1_size, 0);
|
|
3038
|
+
|
|
3039
|
+
ASSERT_OK(
|
|
3040
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "f"));
|
|
3041
|
+
ASSERT_OK(Flush());
|
|
3042
|
+
// Range deletion compensated size computed during flush time
|
|
3043
|
+
std::vector<std::vector<FileMetaData>> level_to_files;
|
|
3044
|
+
dbfull()->TEST_GetFilesMetaData(dbfull()->DefaultColumnFamily(),
|
|
3045
|
+
&level_to_files);
|
|
3046
|
+
ASSERT_EQ(level_to_files[0].size(), 1);
|
|
3047
|
+
ASSERT_EQ(level_to_files[0][0].compensated_range_deletion_size,
|
|
3048
|
+
l1_size + l2_size);
|
|
3049
|
+
ASSERT_EQ(level_to_files[1].size(), 1);
|
|
3050
|
+
ASSERT_EQ(level_to_files[1][0].compensated_range_deletion_size, 0);
|
|
3051
|
+
ASSERT_EQ(level_to_files[2].size(), 1);
|
|
3052
|
+
ASSERT_EQ(level_to_files[2][0].compensated_range_deletion_size, 0);
|
|
3053
|
+
|
|
3054
|
+
// Range deletion compensated size computed during compaction time
|
|
3055
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr, nullptr,
|
|
3056
|
+
true /* disallow_trivial_move */));
|
|
3057
|
+
ASSERT_EQ(NumTableFilesAtLevel(0), 0);
|
|
3058
|
+
ASSERT_EQ(NumTableFilesAtLevel(1), 1);
|
|
3059
|
+
ASSERT_EQ(NumTableFilesAtLevel(2), 1);
|
|
3060
|
+
dbfull()->TEST_GetFilesMetaData(dbfull()->DefaultColumnFamily(),
|
|
3061
|
+
&level_to_files);
|
|
3062
|
+
ASSERT_EQ(level_to_files[1].size(), 1);
|
|
3063
|
+
ASSERT_EQ(level_to_files[1][0].compensated_range_deletion_size, l2_size);
|
|
3064
|
+
ASSERT_EQ(level_to_files[2].size(), 1);
|
|
3065
|
+
ASSERT_EQ(level_to_files[2][0].compensated_range_deletion_size, 0);
|
|
3066
|
+
}
|
|
3067
|
+
|
|
3068
|
+
TEST_F(DBRangeDelTest, RangetombesoneCompensateFilesizePersistDuringReopen) {
|
|
3069
|
+
Options opts = CurrentOptions();
|
|
3070
|
+
opts.disable_auto_compactions = true;
|
|
3071
|
+
DestroyAndReopen(opts);
|
|
3072
|
+
|
|
3073
|
+
std::vector<std::string> values;
|
|
3074
|
+
Random rnd(301);
|
|
3075
|
+
values.push_back(rnd.RandomString(1 << 10));
|
|
3076
|
+
ASSERT_OK(Put("a", values.back()));
|
|
3077
|
+
values.push_back(rnd.RandomString(1 << 10));
|
|
3078
|
+
ASSERT_OK(Put("b", values.back()));
|
|
3079
|
+
ASSERT_OK(Flush());
|
|
3080
|
+
MoveFilesToLevel(2);
|
|
3081
|
+
|
|
3082
|
+
ASSERT_OK(
|
|
3083
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "c"));
|
|
3084
|
+
ASSERT_OK(Flush());
|
|
3085
|
+
MoveFilesToLevel(1);
|
|
3086
|
+
|
|
3087
|
+
ASSERT_OK(
|
|
3088
|
+
db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), "a", "z"));
|
|
3089
|
+
ASSERT_OK(Flush());
|
|
3090
|
+
|
|
3091
|
+
std::vector<std::vector<FileMetaData>> level_to_files;
|
|
3092
|
+
dbfull()->TEST_GetFilesMetaData(dbfull()->DefaultColumnFamily(),
|
|
3093
|
+
&level_to_files);
|
|
3094
|
+
ASSERT_EQ(level_to_files[0].size(), 1);
|
|
3095
|
+
ASSERT_EQ(level_to_files[1].size(), 1);
|
|
3096
|
+
ASSERT_EQ(level_to_files[2].size(), 1);
|
|
3097
|
+
uint64_t l2_size = level_to_files[2][0].fd.GetFileSize();
|
|
3098
|
+
uint64_t l1_size = level_to_files[1][0].fd.GetFileSize();
|
|
3099
|
+
ASSERT_GT(l2_size, 0);
|
|
3100
|
+
ASSERT_GT(l1_size, 0);
|
|
3101
|
+
ASSERT_EQ(level_to_files[0][0].compensated_range_deletion_size,
|
|
3102
|
+
l1_size + l2_size);
|
|
3103
|
+
ASSERT_EQ(level_to_files[1][0].compensated_range_deletion_size, l2_size);
|
|
3104
|
+
|
|
3105
|
+
Reopen(opts);
|
|
3106
|
+
dbfull()->TEST_GetFilesMetaData(dbfull()->DefaultColumnFamily(),
|
|
3107
|
+
&level_to_files);
|
|
3108
|
+
ASSERT_EQ(level_to_files[0].size(), 1);
|
|
3109
|
+
ASSERT_EQ(level_to_files[0][0].compensated_range_deletion_size,
|
|
3110
|
+
l1_size + l2_size);
|
|
3111
|
+
ASSERT_EQ(level_to_files[1].size(), 1);
|
|
3112
|
+
ASSERT_EQ(level_to_files[1][0].compensated_range_deletion_size, l2_size);
|
|
3113
|
+
}
|
|
3114
|
+
|
|
3115
|
+
TEST_F(DBRangeDelTest, SingleKeyFile) {
|
|
3116
|
+
// Test for a bug fix where a range tombstone could be added
|
|
3117
|
+
// to an SST file while is not within the file's key range.
|
|
3118
|
+
// Create 3 files in L0 and then L1 where all keys have the same user key
|
|
3119
|
+
// `Key(2)`. The middle file will contain Key(2)@6 and Key(2)@5. Before fix,
|
|
3120
|
+
// the range tombstone [Key(2), Key(5))@2 would be added to this file during
|
|
3121
|
+
// compaction, but it is not in this file's key range.
|
|
3122
|
+
Options opts = CurrentOptions();
|
|
3123
|
+
opts.disable_auto_compactions = true;
|
|
3124
|
+
opts.target_file_size_base = 1 << 10;
|
|
3125
|
+
opts.level_compaction_dynamic_file_size = false;
|
|
3126
|
+
DestroyAndReopen(opts);
|
|
3127
|
+
|
|
3128
|
+
// prevent range tombstone drop
|
|
3129
|
+
std::vector<const Snapshot*> snapshots;
|
|
3130
|
+
snapshots.push_back(db_->GetSnapshot());
|
|
3131
|
+
|
|
3132
|
+
// write a key to bottommost file so the compactions below
|
|
3133
|
+
// are not bottommost compactions and will calculate
|
|
3134
|
+
// compensated range tombstone size. Before bug fix, an assert would fail
|
|
3135
|
+
// during this process.
|
|
3136
|
+
Random rnd(301);
|
|
3137
|
+
ASSERT_OK(Put(Key(2), rnd.RandomString(8 << 10)));
|
|
3138
|
+
ASSERT_OK(Flush());
|
|
3139
|
+
MoveFilesToLevel(6);
|
|
3140
|
+
|
|
3141
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(2),
|
|
3142
|
+
Key(5)));
|
|
3143
|
+
snapshots.push_back(db_->GetSnapshot());
|
|
3144
|
+
std::vector<std::string> values;
|
|
3145
|
+
|
|
3146
|
+
values.push_back(rnd.RandomString(8 << 10));
|
|
3147
|
+
ASSERT_OK(Put(Key(2), rnd.RandomString(8 << 10)));
|
|
3148
|
+
snapshots.push_back(db_->GetSnapshot());
|
|
3149
|
+
ASSERT_OK(Flush());
|
|
3150
|
+
|
|
3151
|
+
ASSERT_OK(Put(Key(2), rnd.RandomString(8 << 10)));
|
|
3152
|
+
snapshots.push_back(db_->GetSnapshot());
|
|
3153
|
+
ASSERT_OK(Flush());
|
|
3154
|
+
|
|
3155
|
+
ASSERT_OK(Put(Key(2), rnd.RandomString(8 << 10)));
|
|
3156
|
+
snapshots.push_back(db_->GetSnapshot());
|
|
3157
|
+
ASSERT_OK(Flush());
|
|
3158
|
+
|
|
3159
|
+
ASSERT_EQ(NumTableFilesAtLevel(0), 3);
|
|
3160
|
+
CompactRangeOptions co;
|
|
3161
|
+
co.bottommost_level_compaction = BottommostLevelCompaction::kForce;
|
|
3162
|
+
|
|
3163
|
+
ASSERT_OK(dbfull()->RunManualCompaction(
|
|
3164
|
+
static_cast_with_check<ColumnFamilyHandleImpl>(db_->DefaultColumnFamily())
|
|
3165
|
+
->cfd(),
|
|
3166
|
+
0, 1, co, nullptr, nullptr, true, true,
|
|
3167
|
+
std::numeric_limits<uint64_t>::max() /*max_file_num_to_ignore*/,
|
|
3168
|
+
"" /*trim_ts*/));
|
|
3169
|
+
|
|
3170
|
+
for (const auto s : snapshots) {
|
|
3171
|
+
db_->ReleaseSnapshot(s);
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
|
|
3175
|
+
TEST_F(DBRangeDelTest, DoubleCountRangeTombstoneCompensatedSize) {
|
|
3176
|
+
// Test for a bug fix if a file has multiple range tombstones
|
|
3177
|
+
// with same start and end key but with different sequence numbers,
|
|
3178
|
+
// we should only calculate compensated range tombstone size
|
|
3179
|
+
// for one of them.
|
|
3180
|
+
Options opts = CurrentOptions();
|
|
3181
|
+
opts.disable_auto_compactions = true;
|
|
3182
|
+
DestroyAndReopen(opts);
|
|
3183
|
+
|
|
3184
|
+
std::vector<std::string> values;
|
|
3185
|
+
Random rnd(301);
|
|
3186
|
+
// file in L2
|
|
3187
|
+
ASSERT_OK(Put(Key(1), rnd.RandomString(1 << 10)));
|
|
3188
|
+
ASSERT_OK(Put(Key(2), rnd.RandomString(1 << 10)));
|
|
3189
|
+
ASSERT_OK(Flush());
|
|
3190
|
+
MoveFilesToLevel(2);
|
|
3191
|
+
uint64_t l2_size = 0;
|
|
3192
|
+
ASSERT_OK(Size(Key(1), Key(3), 0 /* cf */, &l2_size));
|
|
3193
|
+
ASSERT_GT(l2_size, 0);
|
|
3194
|
+
|
|
3195
|
+
// file in L1
|
|
3196
|
+
ASSERT_OK(Put(Key(3), rnd.RandomString(1 << 10)));
|
|
3197
|
+
ASSERT_OK(Put(Key(4), rnd.RandomString(1 << 10)));
|
|
3198
|
+
ASSERT_OK(Flush());
|
|
3199
|
+
MoveFilesToLevel(1);
|
|
3200
|
+
uint64_t l1_size = 0;
|
|
3201
|
+
ASSERT_OK(Size(Key(3), Key(5), 0 /* cf */, &l1_size));
|
|
3202
|
+
ASSERT_GT(l1_size, 0);
|
|
3203
|
+
|
|
3204
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(1),
|
|
3205
|
+
Key(5)));
|
|
3206
|
+
// so that the range tombstone above is not dropped
|
|
3207
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
3208
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(1),
|
|
3209
|
+
Key(5)));
|
|
3210
|
+
ASSERT_OK(Flush());
|
|
3211
|
+
// Range deletion compensated size computed during flush time
|
|
3212
|
+
std::vector<std::vector<FileMetaData>> level_to_files;
|
|
3213
|
+
dbfull()->TEST_GetFilesMetaData(dbfull()->DefaultColumnFamily(),
|
|
3214
|
+
&level_to_files);
|
|
3215
|
+
ASSERT_EQ(level_to_files[0].size(), 1);
|
|
3216
|
+
// instead of 2 * (l1_size + l2_size)
|
|
3217
|
+
ASSERT_EQ(level_to_files[0][0].compensated_range_deletion_size,
|
|
3218
|
+
l1_size + l2_size);
|
|
3219
|
+
|
|
3220
|
+
// Range deletion compensated size computed during compaction time
|
|
3221
|
+
ASSERT_OK(dbfull()->TEST_CompactRange(0, nullptr, nullptr, nullptr,
|
|
3222
|
+
true /* disallow_trivial_move */));
|
|
3223
|
+
dbfull()->TEST_GetFilesMetaData(dbfull()->DefaultColumnFamily(),
|
|
3224
|
+
&level_to_files);
|
|
3225
|
+
ASSERT_EQ(level_to_files[1].size(), 1);
|
|
3226
|
+
ASSERT_EQ(level_to_files[1][0].compensated_range_deletion_size, l2_size);
|
|
3227
|
+
db_->ReleaseSnapshot(snapshot);
|
|
3228
|
+
}
|
|
3229
|
+
|
|
3230
|
+
TEST_F(DBRangeDelTest, AddRangeDelsSameLowerAndUpperBound) {
|
|
3231
|
+
// Test for an edge case where CompactionOutputs::AddRangeDels()
|
|
3232
|
+
// is called with an empty range: `range_tombstone_lower_bound_` is not empty
|
|
3233
|
+
// and have the same user_key and sequence number as `next_table_min_key.
|
|
3234
|
+
// This used to cause file's smallest and largest key to be incorrectly set
|
|
3235
|
+
// such that smallest > largest, and fail some assertions in iterator and/or
|
|
3236
|
+
// assertion in VersionSet::ApproximateSize().
|
|
3237
|
+
Options opts = CurrentOptions();
|
|
3238
|
+
opts.disable_auto_compactions = true;
|
|
3239
|
+
opts.target_file_size_base = 1 << 10;
|
|
3240
|
+
opts.level_compaction_dynamic_file_size = false;
|
|
3241
|
+
DestroyAndReopen(opts);
|
|
3242
|
+
|
|
3243
|
+
Random rnd(301);
|
|
3244
|
+
// Create file at bottommost level so the manual compaction below is
|
|
3245
|
+
// non-bottommost level and goes through code path like compensate range
|
|
3246
|
+
// tombstone size.
|
|
3247
|
+
ASSERT_OK(Put(Key(1), "v1"));
|
|
3248
|
+
ASSERT_OK(Put(Key(4), "v2"));
|
|
3249
|
+
ASSERT_OK(Flush());
|
|
3250
|
+
MoveFilesToLevel(6);
|
|
3251
|
+
|
|
3252
|
+
ASSERT_OK(Put(Key(1), rnd.RandomString(4 << 10)));
|
|
3253
|
+
ASSERT_OK(Put(Key(3), rnd.RandomString(4 << 10)));
|
|
3254
|
+
// So Key(3) does not get dropped.
|
|
3255
|
+
const Snapshot* snapshot = db_->GetSnapshot();
|
|
3256
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(2),
|
|
3257
|
+
Key(4)));
|
|
3258
|
+
ASSERT_OK(Flush());
|
|
3259
|
+
|
|
3260
|
+
ASSERT_OK(Put(Key(3), rnd.RandomString(4 << 10)));
|
|
3261
|
+
ASSERT_OK(Put(Key(4), rnd.RandomString(4 << 10)));
|
|
3262
|
+
ASSERT_OK(Flush());
|
|
3263
|
+
|
|
3264
|
+
MoveFilesToLevel(1);
|
|
3265
|
+
// Each file will have two keys, with Key(3) straddle between two files.
|
|
3266
|
+
// File 1: Key(1)@1, Key(3)@6, DeleteRange ends at Key(3)@6
|
|
3267
|
+
// File 2: Key(3)@4, Key(4)@7, DeleteRange start from Key(3)@4
|
|
3268
|
+
ASSERT_EQ(NumTableFilesAtLevel(1), 2);
|
|
3269
|
+
|
|
3270
|
+
// Manually update compaction output file cutting decisions
|
|
3271
|
+
// to cut before range tombstone sentinel Key(3)@4
|
|
3272
|
+
// and the point key Key(3)@4 itself
|
|
3273
|
+
SyncPoint::GetInstance()->SetCallBack(
|
|
3274
|
+
"CompactionOutputs::ShouldStopBefore::manual_decision", [opts](void* p) {
|
|
3275
|
+
auto* pair = (std::pair<bool*, const Slice>*)p;
|
|
3276
|
+
if ((opts.comparator->Compare(ExtractUserKey(pair->second), Key(3)) ==
|
|
3277
|
+
0) &&
|
|
3278
|
+
(GetInternalKeySeqno(pair->second) <= 4)) {
|
|
3279
|
+
*(pair->first) = true;
|
|
3280
|
+
}
|
|
3281
|
+
});
|
|
3282
|
+
SyncPoint::GetInstance()->EnableProcessing();
|
|
3283
|
+
std::string begin_key = Key(0);
|
|
3284
|
+
std::string end_key = Key(5);
|
|
3285
|
+
Slice begin_slice{begin_key};
|
|
3286
|
+
Slice end_slice{end_key};
|
|
3287
|
+
ASSERT_OK(dbfull()->RunManualCompaction(
|
|
3288
|
+
static_cast_with_check<ColumnFamilyHandleImpl>(db_->DefaultColumnFamily())
|
|
3289
|
+
->cfd(),
|
|
3290
|
+
1, 2, CompactRangeOptions(), &begin_slice, &end_slice, true,
|
|
3291
|
+
true /* disallow_trivial_move */,
|
|
3292
|
+
std::numeric_limits<uint64_t>::max() /*max_file_num_to_ignore*/,
|
|
3293
|
+
"" /*trim_ts*/));
|
|
3294
|
+
// iterate through to check if any assertion breaks
|
|
3295
|
+
std::unique_ptr<Iterator> iter{db_->NewIterator(ReadOptions())};
|
|
3296
|
+
iter->SeekToFirst();
|
|
3297
|
+
std::vector<int> expected{1, 3, 4};
|
|
3298
|
+
for (auto i : expected) {
|
|
3299
|
+
ASSERT_TRUE(iter->Valid());
|
|
3300
|
+
ASSERT_EQ(iter->key(), Key(i));
|
|
3301
|
+
iter->Next();
|
|
3302
|
+
}
|
|
3303
|
+
ASSERT_TRUE(iter->status().ok() && !iter->Valid());
|
|
3304
|
+
db_->ReleaseSnapshot(snapshot);
|
|
3305
|
+
}
|
|
3306
|
+
|
|
3307
|
+
TEST_F(DBRangeDelTest, AddRangeDelsSingleUserKeyTombstoneOnlyFile) {
|
|
3308
|
+
// Test for an edge case where CompactionOutputs::AddRangeDels()
|
|
3309
|
+
// is called with an SST file that has no point keys, and that
|
|
3310
|
+
// the lower bound and upper bound have the same user key.
|
|
3311
|
+
// This could cause a file's smallest and largest key to be incorrectly set
|
|
3312
|
+
// such that smallest > largest, and fail some assertions in iterator and/or
|
|
3313
|
+
// assertion in VersionSet::ApproximateSize().
|
|
3314
|
+
Options opts = CurrentOptions();
|
|
3315
|
+
opts.disable_auto_compactions = true;
|
|
3316
|
+
opts.target_file_size_base = 1 << 10;
|
|
3317
|
+
opts.level_compaction_dynamic_file_size = false;
|
|
3318
|
+
DestroyAndReopen(opts);
|
|
3319
|
+
|
|
3320
|
+
Random rnd(301);
|
|
3321
|
+
// Create file at bottommost level so the manual compaction below is
|
|
3322
|
+
// non-bottommost level and goes through code path like compensate range
|
|
3323
|
+
// tombstone size.
|
|
3324
|
+
ASSERT_OK(Put(Key(1), "v1"));
|
|
3325
|
+
ASSERT_OK(Put(Key(4), "v2"));
|
|
3326
|
+
ASSERT_OK(Flush());
|
|
3327
|
+
MoveFilesToLevel(6);
|
|
3328
|
+
|
|
3329
|
+
ASSERT_OK(Put(Key(1), rnd.RandomString(10)));
|
|
3330
|
+
// Key(3)@4
|
|
3331
|
+
ASSERT_OK(Put(Key(3), rnd.RandomString(10)));
|
|
3332
|
+
const Snapshot* snapshot1 = db_->GetSnapshot();
|
|
3333
|
+
// Key(3)@5
|
|
3334
|
+
ASSERT_OK(Put(Key(3), rnd.RandomString(10)));
|
|
3335
|
+
const Snapshot* snapshot2 = db_->GetSnapshot();
|
|
3336
|
+
ASSERT_OK(db_->DeleteRange(WriteOptions(), db_->DefaultColumnFamily(), Key(2),
|
|
3337
|
+
Key(4)));
|
|
3338
|
+
// Key(3)@7
|
|
3339
|
+
ASSERT_OK(Put(Key(3), rnd.RandomString(10)));
|
|
3340
|
+
ASSERT_OK(Flush());
|
|
3341
|
+
|
|
3342
|
+
// L0 -> L1 compaction: cut output into two files:
|
|
3343
|
+
// File 1: Key(1), Key(3)@7, Range tombstone ends at Key(3)@7
|
|
3344
|
+
// File 2: Key(3)@5, Key(3)@4, Range tombstone starts from Key(3)@5
|
|
3345
|
+
SyncPoint::GetInstance()->SetCallBack(
|
|
3346
|
+
"CompactionOutputs::ShouldStopBefore::manual_decision", [opts](void* p) {
|
|
3347
|
+
auto* pair = (std::pair<bool*, const Slice>*)p;
|
|
3348
|
+
if ((opts.comparator->Compare(ExtractUserKey(pair->second), Key(3)) ==
|
|
3349
|
+
0) &&
|
|
3350
|
+
(GetInternalKeySeqno(pair->second) <= 6)) {
|
|
3351
|
+
*(pair->first) = true;
|
|
3352
|
+
SyncPoint::GetInstance()->DisableProcessing();
|
|
3353
|
+
}
|
|
3354
|
+
});
|
|
3355
|
+
SyncPoint::GetInstance()->EnableProcessing();
|
|
3356
|
+
std::string begin_key = Key(0);
|
|
3357
|
+
std::string end_key = Key(5);
|
|
3358
|
+
Slice begin_slice{begin_key};
|
|
3359
|
+
Slice end_slice{end_key};
|
|
3360
|
+
ASSERT_OK(dbfull()->RunManualCompaction(
|
|
3361
|
+
static_cast_with_check<ColumnFamilyHandleImpl>(db_->DefaultColumnFamily())
|
|
3362
|
+
->cfd(),
|
|
3363
|
+
0, 1, CompactRangeOptions(), &begin_slice, &end_slice, true,
|
|
3364
|
+
true /* disallow_trivial_move */,
|
|
3365
|
+
std::numeric_limits<uint64_t>::max() /*max_file_num_to_ignore*/,
|
|
3366
|
+
"" /*trim_ts*/));
|
|
3367
|
+
ASSERT_EQ(NumTableFilesAtLevel(1), 2);
|
|
3368
|
+
|
|
3369
|
+
// L1 -> L2 compaction, drop the snapshot protecting Key(3)@5.
|
|
3370
|
+
// Let ShouldStopBefore() return true for Key(3)@5 (delete range sentinel)
|
|
3371
|
+
// and Key(3)@4.
|
|
3372
|
+
// Output should have two files:
|
|
3373
|
+
// File 1: Key(1), Key(3)@7, range tombstone ends at Key(3)@7
|
|
3374
|
+
// File dropped: range tombstone only file (from Key(3)@5 to Key(3)@4)
|
|
3375
|
+
// File 2: Range tombstone starting from Key(3)@4, Key(3)@4
|
|
3376
|
+
db_->ReleaseSnapshot(snapshot2);
|
|
3377
|
+
SyncPoint::GetInstance()->SetCallBack(
|
|
3378
|
+
"CompactionOutputs::ShouldStopBefore::manual_decision", [opts](void* p) {
|
|
3379
|
+
auto* pair = (std::pair<bool*, const Slice>*)p;
|
|
3380
|
+
if ((opts.comparator->Compare(ExtractUserKey(pair->second), Key(3)) ==
|
|
3381
|
+
0) &&
|
|
3382
|
+
(GetInternalKeySeqno(pair->second) <= 6)) {
|
|
3383
|
+
*(pair->first) = true;
|
|
3384
|
+
}
|
|
3385
|
+
});
|
|
3386
|
+
SyncPoint::GetInstance()->EnableProcessing();
|
|
3387
|
+
ASSERT_OK(dbfull()->RunManualCompaction(
|
|
3388
|
+
static_cast_with_check<ColumnFamilyHandleImpl>(db_->DefaultColumnFamily())
|
|
3389
|
+
->cfd(),
|
|
3390
|
+
1, 2, CompactRangeOptions(), &begin_slice, &end_slice, true,
|
|
3391
|
+
true /* disallow_trivial_move */,
|
|
3392
|
+
std::numeric_limits<uint64_t>::max() /*max_file_num_to_ignore*/,
|
|
3393
|
+
"" /*trim_ts*/));
|
|
3394
|
+
ASSERT_EQ(NumTableFilesAtLevel(2), 2);
|
|
3395
|
+
// iterate through to check if any assertion breaks
|
|
3396
|
+
std::unique_ptr<Iterator> iter{db_->NewIterator(ReadOptions())};
|
|
3397
|
+
iter->SeekToFirst();
|
|
3398
|
+
std::vector<int> expected{1, 3, 4};
|
|
3399
|
+
for (auto i : expected) {
|
|
3400
|
+
ASSERT_TRUE(iter->Valid());
|
|
3401
|
+
ASSERT_EQ(iter->key(), Key(i));
|
|
3402
|
+
iter->Next();
|
|
3403
|
+
}
|
|
3404
|
+
ASSERT_TRUE(iter->status().ok() && !iter->Valid());
|
|
3405
|
+
db_->ReleaseSnapshot(snapshot1);
|
|
3406
|
+
}
|
|
3407
|
+
|
|
3408
|
+
} // namespace ROCKSDB_NAMESPACE
|
|
3409
|
+
|
|
3410
|
+
int main(int argc, char** argv) {
|
|
3411
|
+
ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
|
|
3412
|
+
::testing::InitGoogleTest(&argc, argv);
|
|
3413
|
+
return RUN_ALL_TESTS();
|
|
3414
|
+
}
|