rocksdb-native 2.2.0 → 2.3.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/binding.c +92 -10
- package/index.js +9 -0
- package/lib/batch.js +11 -1
- package/lib/iterator.js +3 -1
- package/lib/snapshot.js +21 -0
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/rocksdb-native.bare +0 -0
- package/prebuilds/darwin-arm64/rocksdb-native.node +0 -0
- package/prebuilds/darwin-x64/rocksdb-native.bare +0 -0
- package/prebuilds/darwin-x64/rocksdb-native.node +0 -0
- package/prebuilds/linux-arm64/rocksdb-native.bare +0 -0
- package/prebuilds/linux-arm64/rocksdb-native.node +0 -0
- package/prebuilds/linux-x64/rocksdb-native.bare +0 -0
- package/prebuilds/linux-x64/rocksdb-native.node +0 -0
- package/prebuilds/win32-x64/rocksdb-native.bare +0 -0
- package/prebuilds/win32-x64/rocksdb-native.node +0 -0
- package/vendor/librocksdb/include/rocksdb.h +38 -4
- package/vendor/librocksdb/src/rocksdb.cc +114 -14
- package/vendor/librocksdb/vendor/rocksdb/CMakeLists.txt +21 -4
- package/vendor/librocksdb/vendor/rocksdb/cache/secondary_cache_adapter.cc +6 -3
- package/vendor/librocksdb/vendor/rocksdb/db/arena_wrapped_db_iter.cc +4 -4
- package/vendor/librocksdb/vendor/rocksdb/db/arena_wrapped_db_iter.h +4 -2
- package/vendor/librocksdb/vendor/rocksdb/db/attribute_group_iterator_impl.cc +20 -0
- package/vendor/librocksdb/vendor/rocksdb/db/attribute_group_iterator_impl.h +83 -0
- package/vendor/librocksdb/vendor/rocksdb/db/builder.cc +9 -5
- package/vendor/librocksdb/vendor/rocksdb/db/builder.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/db/c.cc +231 -6
- package/vendor/librocksdb/vendor/rocksdb/db/c_test.c +202 -2
- package/vendor/librocksdb/vendor/rocksdb/db/coalescing_iterator.cc +47 -0
- package/vendor/librocksdb/vendor/rocksdb/db/coalescing_iterator.h +79 -0
- package/vendor/librocksdb/vendor/rocksdb/db/column_family.cc +28 -0
- package/vendor/librocksdb/vendor/rocksdb/db/column_family.h +17 -0
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction.cc +8 -1
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction.h +11 -9
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_iterator.cc +50 -23
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_iterator.h +13 -0
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_job.cc +22 -25
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_job.h +2 -0
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_outputs.cc +8 -1
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_outputs.h +1 -0
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker.cc +40 -17
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker.h +20 -14
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker_level.cc +11 -6
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker_universal.cc +77 -24
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_service_job.cc +2 -0
- package/vendor/librocksdb/vendor/rocksdb/db/convenience.cc +3 -0
- package/vendor/librocksdb/vendor/rocksdb/db/db_filesnapshot.cc +125 -31
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl.cc +457 -231
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl.h +172 -73
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_compaction_flush.cc +152 -133
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_debug.cc +5 -0
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_files.cc +58 -52
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_follower.cc +348 -0
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_follower.h +54 -0
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_open.cc +136 -117
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_secondary.cc +4 -3
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_secondary.h +7 -6
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_write.cc +134 -80
- package/vendor/librocksdb/vendor/rocksdb/db/db_iter.cc +11 -0
- package/vendor/librocksdb/vendor/rocksdb/db/db_test2.cc +1 -1
- package/vendor/librocksdb/vendor/rocksdb/db/db_test_util.cc +11 -1
- package/vendor/librocksdb/vendor/rocksdb/db/db_test_util.h +11 -7
- package/vendor/librocksdb/vendor/rocksdb/db/dbformat.cc +19 -4
- package/vendor/librocksdb/vendor/rocksdb/db/dbformat.h +3 -2
- package/vendor/librocksdb/vendor/rocksdb/db/error_handler.cc +34 -39
- package/vendor/librocksdb/vendor/rocksdb/db/error_handler.h +3 -4
- package/vendor/librocksdb/vendor/rocksdb/db/event_helpers.cc +6 -3
- package/vendor/librocksdb/vendor/rocksdb/db/experimental.cc +3 -2
- package/vendor/librocksdb/vendor/rocksdb/db/external_sst_file_ingestion_job.cc +76 -18
- package/vendor/librocksdb/vendor/rocksdb/db/external_sst_file_ingestion_job.h +11 -0
- package/vendor/librocksdb/vendor/rocksdb/db/flush_job.cc +37 -5
- package/vendor/librocksdb/vendor/rocksdb/db/flush_job.h +14 -0
- package/vendor/librocksdb/vendor/rocksdb/db/import_column_family_job.cc +49 -45
- package/vendor/librocksdb/vendor/rocksdb/db/internal_stats.cc +60 -1
- package/vendor/librocksdb/vendor/rocksdb/db/internal_stats.h +20 -1
- package/vendor/librocksdb/vendor/rocksdb/db/log_reader.cc +15 -6
- package/vendor/librocksdb/vendor/rocksdb/db/log_writer.cc +59 -10
- package/vendor/librocksdb/vendor/rocksdb/db/log_writer.h +8 -0
- package/vendor/librocksdb/vendor/rocksdb/db/memtable.cc +24 -40
- package/vendor/librocksdb/vendor/rocksdb/db/memtable.h +10 -10
- package/vendor/librocksdb/vendor/rocksdb/db/memtable_list.cc +9 -8
- package/vendor/librocksdb/vendor/rocksdb/db/multi_cf_iterator_impl.h +296 -0
- package/vendor/librocksdb/vendor/rocksdb/db/range_tombstone_fragmenter.h +8 -10
- package/vendor/librocksdb/vendor/rocksdb/db/repair.cc +4 -3
- package/vendor/librocksdb/vendor/rocksdb/db/seqno_to_time_mapping.cc +30 -0
- package/vendor/librocksdb/vendor/rocksdb/db/seqno_to_time_mapping.h +9 -0
- package/vendor/librocksdb/vendor/rocksdb/db/table_cache.cc +17 -2
- package/vendor/librocksdb/vendor/rocksdb/db/table_cache.h +9 -1
- package/vendor/librocksdb/vendor/rocksdb/db/table_properties_collector.h +9 -2
- package/vendor/librocksdb/vendor/rocksdb/db/transaction_log_impl.cc +3 -3
- package/vendor/librocksdb/vendor/rocksdb/db/transaction_log_impl.h +7 -7
- package/vendor/librocksdb/vendor/rocksdb/db/version_edit.cc +0 -1
- package/vendor/librocksdb/vendor/rocksdb/db/version_edit_handler.cc +39 -5
- package/vendor/librocksdb/vendor/rocksdb/db/version_edit_handler.h +24 -15
- package/vendor/librocksdb/vendor/rocksdb/db/version_set.cc +117 -64
- package/vendor/librocksdb/vendor/rocksdb/db/version_set.h +27 -10
- package/vendor/librocksdb/vendor/rocksdb/db/wal_manager.cc +37 -29
- package/vendor/librocksdb/vendor/rocksdb/db/wal_manager.h +6 -5
- package/vendor/librocksdb/vendor/rocksdb/db/wide/wide_columns.cc +2 -3
- package/vendor/librocksdb/vendor/rocksdb/db/wide/wide_columns_helper.cc +6 -0
- package/vendor/librocksdb/vendor/rocksdb/db/write_batch.cc +89 -31
- package/vendor/librocksdb/vendor/rocksdb/db/write_thread.cc +53 -5
- package/vendor/librocksdb/vendor/rocksdb/db/write_thread.h +36 -4
- package/vendor/librocksdb/vendor/rocksdb/env/composite_env_wrapper.h +21 -0
- package/vendor/librocksdb/vendor/rocksdb/env/env.cc +15 -0
- package/vendor/librocksdb/vendor/rocksdb/env/fs_on_demand.cc +331 -0
- package/vendor/librocksdb/vendor/rocksdb/env/fs_on_demand.h +139 -0
- package/vendor/librocksdb/vendor/rocksdb/env/io_posix.cc +8 -6
- package/vendor/librocksdb/vendor/rocksdb/env/io_posix.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/file/delete_scheduler.cc +130 -27
- package/vendor/librocksdb/vendor/rocksdb/file/delete_scheduler.h +61 -8
- package/vendor/librocksdb/vendor/rocksdb/file/file_util.cc +25 -4
- package/vendor/librocksdb/vendor/rocksdb/file/file_util.h +15 -0
- package/vendor/librocksdb/vendor/rocksdb/file/sequence_file_reader.cc +1 -0
- package/vendor/librocksdb/vendor/rocksdb/file/sequence_file_reader.h +9 -4
- package/vendor/librocksdb/vendor/rocksdb/file/sst_file_manager_impl.cc +18 -0
- package/vendor/librocksdb/vendor/rocksdb/file/sst_file_manager_impl.h +31 -4
- package/vendor/librocksdb/vendor/rocksdb/file/writable_file_writer.cc +40 -38
- package/vendor/librocksdb/vendor/rocksdb/file/writable_file_writer.h +48 -15
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/advanced_options.h +12 -3
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/attribute_groups.h +114 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/c.h +90 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/cache.h +5 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/comparator.h +27 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/db.h +71 -12
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/env.h +9 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/experimental.h +5 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/file_system.h +14 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/iterator.h +9 -71
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/iterator_base.h +90 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/listener.h +21 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/options.h +125 -12
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/perf_context.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/sst_file_reader.h +11 -1
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/table.h +6 -6
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/table_properties.h +19 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/transaction_log.h +12 -6
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/types.h +12 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/universal_compaction.h +31 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/user_write_callback.h +29 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/cache_dump_load.h +4 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/checkpoint.h +4 -2
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/customizable_util.h +0 -1
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/env_mirror.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/ldb_cmd.h +24 -7
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/option_change_migration.h +4 -4
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/stackable_db.h +24 -5
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/table_properties_collectors.h +46 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/transaction.h +42 -17
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/transaction_db.h +5 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/types_util.h +36 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/write_batch_with_index.h +71 -3
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/version.h +2 -2
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/wide_columns.h +87 -72
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/write_batch_base.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/memory/memory_allocator.cc +1 -0
- package/vendor/librocksdb/vendor/rocksdb/options/cf_options.cc +13 -2
- package/vendor/librocksdb/vendor/rocksdb/options/cf_options.h +6 -2
- package/vendor/librocksdb/vendor/rocksdb/options/db_options.cc +27 -1
- package/vendor/librocksdb/vendor/rocksdb/options/db_options.h +10 -3
- package/vendor/librocksdb/vendor/rocksdb/options/options.cc +3 -0
- package/vendor/librocksdb/vendor/rocksdb/options/options_helper.cc +1 -0
- package/vendor/librocksdb/vendor/rocksdb/port/jemalloc_helper.h +2 -2
- package/vendor/librocksdb/vendor/rocksdb/port/stack_trace.cc +1 -0
- package/vendor/librocksdb/vendor/rocksdb/port/win/port_win.cc +3 -2
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/binary_search_index_reader.cc +1 -2
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_builder.cc +47 -31
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_factory.cc +15 -0
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_iterator.cc +37 -18
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_iterator.h +10 -3
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader.cc +102 -41
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader.h +15 -7
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader_impl.h +1 -3
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader_sync_and_async.h +5 -6
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_cache.h +31 -0
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_prefetcher.cc +6 -0
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/cachable_entry.h +10 -5
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_block.h +34 -28
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_block_reader_common.cc +17 -11
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_block_reader_common.h +5 -2
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_policy.cc +12 -3
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/full_filter_block.cc +37 -30
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/full_filter_block.h +11 -13
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/hash_index_reader.cc +1 -2
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_builder.cc +62 -53
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_builder.h +60 -38
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_reader_common.cc +14 -9
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_reader_common.h +4 -1
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_filter_block.cc +135 -94
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_filter_block.h +52 -46
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_index_reader.cc +51 -13
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_index_reader.h +2 -0
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/uncompression_dict_reader.cc +3 -11
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/uncompression_dict_reader.h +2 -3
- package/vendor/librocksdb/vendor/rocksdb/table/block_fetcher.cc +8 -10
- package/vendor/librocksdb/vendor/rocksdb/table/block_fetcher.h +2 -1
- package/vendor/librocksdb/vendor/rocksdb/table/compaction_merging_iterator.cc +9 -10
- package/vendor/librocksdb/vendor/rocksdb/table/compaction_merging_iterator.h +3 -2
- package/vendor/librocksdb/vendor/rocksdb/table/format.cc +1 -2
- package/vendor/librocksdb/vendor/rocksdb/table/iterator.cc +4 -0
- package/vendor/librocksdb/vendor/rocksdb/table/merging_iterator.cc +18 -13
- package/vendor/librocksdb/vendor/rocksdb/table/merging_iterator.h +5 -3
- package/vendor/librocksdb/vendor/rocksdb/table/meta_blocks.cc +18 -4
- package/vendor/librocksdb/vendor/rocksdb/table/meta_blocks.h +4 -0
- package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_builder.cc +2 -2
- package/vendor/librocksdb/vendor/rocksdb/table/sst_file_dumper.cc +6 -6
- package/vendor/librocksdb/vendor/rocksdb/table/sst_file_reader.cc +24 -2
- package/vendor/librocksdb/vendor/rocksdb/table/sst_file_writer_collectors.h +3 -1
- package/vendor/librocksdb/vendor/rocksdb/table/table_builder.h +8 -7
- package/vendor/librocksdb/vendor/rocksdb/table/table_iterator.h +69 -0
- package/vendor/librocksdb/vendor/rocksdb/table/table_reader.h +9 -0
- package/vendor/librocksdb/vendor/rocksdb/test_util/testutil.cc +25 -0
- package/vendor/librocksdb/vendor/rocksdb/test_util/testutil.h +12 -0
- package/vendor/librocksdb/vendor/rocksdb/tools/db_bench_tool.cc +32 -0
- package/vendor/librocksdb/vendor/rocksdb/tools/ldb_cmd.cc +618 -124
- package/vendor/librocksdb/vendor/rocksdb/tools/ldb_cmd_impl.h +19 -1
- package/vendor/librocksdb/vendor/rocksdb/tools/ldb_tool.cc +9 -0
- package/vendor/librocksdb/vendor/rocksdb/util/aligned_storage.h +24 -0
- package/vendor/librocksdb/vendor/rocksdb/util/autovector.h +4 -0
- package/vendor/librocksdb/vendor/rocksdb/util/comparator.cc +12 -0
- package/vendor/librocksdb/vendor/rocksdb/util/filter_bench.cc +1 -1
- package/vendor/librocksdb/vendor/rocksdb/util/random.cc +2 -1
- package/vendor/librocksdb/vendor/rocksdb/util/stderr_logger.cc +3 -4
- package/vendor/librocksdb/vendor/rocksdb/util/stderr_logger.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/util/udt_util.cc +33 -0
- package/vendor/librocksdb/vendor/rocksdb/util/udt_util.h +7 -0
- package/vendor/librocksdb/vendor/rocksdb/util/write_batch_util.h +5 -0
- package/vendor/librocksdb/vendor/rocksdb/util/xxhash.h +36 -29
- package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db_impl.h +3 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db_impl_filesnapshot.cc +20 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/cache_dump_load_impl.cc +29 -9
- package/vendor/librocksdb/vendor/rocksdb/utilities/cache_dump_load_impl.h +14 -3
- package/vendor/librocksdb/vendor/rocksdb/utilities/debug.cc +16 -4
- package/vendor/librocksdb/vendor/rocksdb/utilities/fault_injection_fs.cc +677 -248
- package/vendor/librocksdb/vendor/rocksdb/utilities/fault_injection_fs.h +325 -158
- package/vendor/librocksdb/vendor/rocksdb/utilities/option_change_migration/option_change_migration.cc +1 -8
- package/vendor/librocksdb/vendor/rocksdb/utilities/table_properties_collectors/compact_for_tiering_collector.cc +144 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/table_properties_collectors/compact_for_tiering_collector.h +45 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.cc +12 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/growable_array.h +3 -3
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction.cc +116 -20
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction.h +33 -1
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.cc +78 -13
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.h +33 -1
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_base.cc +106 -7
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_base.h +68 -10
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_test.h +7 -3
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_util.cc +8 -5
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_util.h +7 -4
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_prepared_txn.cc +18 -12
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.cc +4 -4
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.h +17 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_unprepared_txn.cc +11 -9
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_unprepared_txn_db.cc +2 -1
- package/vendor/librocksdb/vendor/rocksdb/utilities/types_util.cc +88 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc +313 -14
- package/vendor/librocksdb/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc +7 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/db/multi_cf_iterator.cc +0 -102
- package/vendor/librocksdb/vendor/rocksdb/db/multi_cf_iterator.h +0 -159
|
@@ -199,6 +199,79 @@ static void CheckDel(void* ptr, const char* k, size_t klen) {
|
|
|
199
199
|
(*state)++;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
// Callback from rocksdb_writebatch_iterate_cf()
|
|
203
|
+
static void CheckPutCF(void* ptr, uint32_t cfid, const char* k, size_t klen,
|
|
204
|
+
const char* v, size_t vlen) {
|
|
205
|
+
int* state = (int*)ptr;
|
|
206
|
+
switch (*state) {
|
|
207
|
+
case 0:
|
|
208
|
+
CheckEqual("bar", k, klen);
|
|
209
|
+
CheckEqual("b", v, vlen);
|
|
210
|
+
CheckCondition(cfid == 1);
|
|
211
|
+
break;
|
|
212
|
+
case 1:
|
|
213
|
+
CheckEqual("box", k, klen);
|
|
214
|
+
CheckEqual("c", v, vlen);
|
|
215
|
+
CheckCondition(cfid == 1);
|
|
216
|
+
break;
|
|
217
|
+
case 4:
|
|
218
|
+
CheckEqual("foo", k, klen);
|
|
219
|
+
CheckEqual("f", v, vlen);
|
|
220
|
+
CheckCondition(cfid == 0);
|
|
221
|
+
break;
|
|
222
|
+
case 6:
|
|
223
|
+
CheckEqual("baz", k, klen);
|
|
224
|
+
CheckEqual("a", v, vlen);
|
|
225
|
+
CheckCondition(cfid == 0);
|
|
226
|
+
break;
|
|
227
|
+
default:
|
|
228
|
+
CheckCondition(false);
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
(*state)++;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Callback from rocksdb_writebatch_iterate_cf()
|
|
235
|
+
static void CheckDelCF(void* ptr, uint32_t cfid, const char* k, size_t klen) {
|
|
236
|
+
int* state = (int*)ptr;
|
|
237
|
+
switch (*state) {
|
|
238
|
+
case 2:
|
|
239
|
+
CheckEqual("bar", k, klen);
|
|
240
|
+
CheckCondition(cfid == 1);
|
|
241
|
+
break;
|
|
242
|
+
case 5:
|
|
243
|
+
CheckEqual("foo", k, klen);
|
|
244
|
+
CheckCondition(cfid == 0);
|
|
245
|
+
break;
|
|
246
|
+
default:
|
|
247
|
+
CheckCondition(false);
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
(*state)++;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Callback from rocksdb_writebatch_iterate_cf()
|
|
254
|
+
static void CheckMergeCF(void* ptr, uint32_t cfid, const char* k, size_t klen,
|
|
255
|
+
const char* v, size_t vlen) {
|
|
256
|
+
int* state = (int*)ptr;
|
|
257
|
+
switch (*state) {
|
|
258
|
+
case 3:
|
|
259
|
+
CheckEqual("box", k, klen);
|
|
260
|
+
CheckEqual("cc", v, vlen);
|
|
261
|
+
CheckCondition(cfid == 1);
|
|
262
|
+
break;
|
|
263
|
+
case 7:
|
|
264
|
+
CheckEqual("baz", k, klen);
|
|
265
|
+
CheckEqual("aa", v, vlen);
|
|
266
|
+
CheckCondition(cfid == 0);
|
|
267
|
+
break;
|
|
268
|
+
default:
|
|
269
|
+
CheckCondition(false);
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
(*state)++;
|
|
273
|
+
}
|
|
274
|
+
|
|
202
275
|
static void CmpDestroy(void* arg) { (void)arg; }
|
|
203
276
|
|
|
204
277
|
static int CmpCompare(void* arg, const char* a, size_t alen, const char* b,
|
|
@@ -704,6 +777,10 @@ int main(int argc, char** argv) {
|
|
|
704
777
|
rocksdb_block_based_options_set_block_cache(table_options, cache);
|
|
705
778
|
rocksdb_block_based_options_set_data_block_index_type(table_options, 1);
|
|
706
779
|
rocksdb_block_based_options_set_data_block_hash_ratio(table_options, 0.75);
|
|
780
|
+
rocksdb_block_based_options_set_top_level_index_pinning_tier(table_options,
|
|
781
|
+
1);
|
|
782
|
+
rocksdb_block_based_options_set_partition_pinning_tier(table_options, 2);
|
|
783
|
+
rocksdb_block_based_options_set_unpartitioned_pinning_tier(table_options, 3);
|
|
707
784
|
rocksdb_options_set_block_based_table_factory(options, table_options);
|
|
708
785
|
|
|
709
786
|
rocksdb_options_set_compression(options, rocksdb_no_compression);
|
|
@@ -794,6 +871,11 @@ int main(int argc, char** argv) {
|
|
|
794
871
|
rocksdb_delete(db, woptions, "foo", 3, &err);
|
|
795
872
|
CheckNoError(err);
|
|
796
873
|
|
|
874
|
+
// get the identity before the backup
|
|
875
|
+
size_t before_db_id_len = 0;
|
|
876
|
+
char* before_db_id = rocksdb_get_db_identity(db, &before_db_id_len);
|
|
877
|
+
CheckCondition(before_db_id_len == 36);
|
|
878
|
+
|
|
797
879
|
rocksdb_close(db);
|
|
798
880
|
|
|
799
881
|
rocksdb_destroy_db(options, dbname, &err);
|
|
@@ -814,6 +896,14 @@ int main(int argc, char** argv) {
|
|
|
814
896
|
|
|
815
897
|
CheckGet(db, roptions, "foo", "hello");
|
|
816
898
|
|
|
899
|
+
// the db_identity after the backup is different
|
|
900
|
+
size_t after_db_id_len = 0;
|
|
901
|
+
char* after_db_id = rocksdb_get_db_identity(db, &after_db_id_len);
|
|
902
|
+
CheckCondition(after_db_id_len == 36);
|
|
903
|
+
CheckCondition(memcmp(after_db_id, before_db_id, after_db_id_len) != 0);
|
|
904
|
+
Free(&before_db_id);
|
|
905
|
+
Free(&after_db_id);
|
|
906
|
+
|
|
817
907
|
rocksdb_backup_engine_close(be);
|
|
818
908
|
}
|
|
819
909
|
|
|
@@ -829,6 +919,14 @@ int main(int argc, char** argv) {
|
|
|
829
919
|
rocksdb_checkpoint_create(checkpoint, dbcheckpointname, 0, &err);
|
|
830
920
|
CheckNoError(err);
|
|
831
921
|
|
|
922
|
+
rocksdb_checkpoint_object_destroy(checkpoint);
|
|
923
|
+
checkpoint = NULL;
|
|
924
|
+
|
|
925
|
+
// get the identity before the checkpoint
|
|
926
|
+
size_t before_db_id_len = 0;
|
|
927
|
+
char* before_db_id = rocksdb_get_db_identity(db, &before_db_id_len);
|
|
928
|
+
CheckCondition(before_db_id_len == 36);
|
|
929
|
+
|
|
832
930
|
// start a new database from the checkpoint
|
|
833
931
|
rocksdb_close(db);
|
|
834
932
|
rocksdb_options_set_error_if_exists(options, 0);
|
|
@@ -837,7 +935,13 @@ int main(int argc, char** argv) {
|
|
|
837
935
|
|
|
838
936
|
CheckGet(db, roptions, "foo", "hello");
|
|
839
937
|
|
|
840
|
-
|
|
938
|
+
// the db_identity after the checkpoint is different
|
|
939
|
+
size_t after_db_id_len = 0;
|
|
940
|
+
char* after_db_id = rocksdb_get_db_identity(db, &after_db_id_len);
|
|
941
|
+
CheckCondition(after_db_id_len == 36);
|
|
942
|
+
CheckCondition(memcmp(after_db_id, before_db_id, after_db_id_len) != 0);
|
|
943
|
+
Free(&before_db_id);
|
|
944
|
+
Free(&after_db_id);
|
|
841
945
|
|
|
842
946
|
rocksdb_close(db);
|
|
843
947
|
rocksdb_destroy_db(options, dbcheckpointname, &err);
|
|
@@ -848,6 +952,73 @@ int main(int argc, char** argv) {
|
|
|
848
952
|
rocksdb_options_set_error_if_exists(options, 1);
|
|
849
953
|
}
|
|
850
954
|
|
|
955
|
+
StartPhase("checkpoint_db_id_in_manifest");
|
|
956
|
+
{
|
|
957
|
+
// create new DB with set_write_dbid_to_manifest=true
|
|
958
|
+
// db_identity is now the same across checkpoints
|
|
959
|
+
rocksdb_close(db);
|
|
960
|
+
db = NULL;
|
|
961
|
+
|
|
962
|
+
rocksdb_options_t* options_dbid_in_manifest = rocksdb_options_create();
|
|
963
|
+
rocksdb_options_set_create_if_missing(options_dbid_in_manifest, 1);
|
|
964
|
+
|
|
965
|
+
unsigned char write_to_manifest =
|
|
966
|
+
rocksdb_options_get_write_dbid_to_manifest(options_dbid_in_manifest);
|
|
967
|
+
CheckCondition(!write_to_manifest);
|
|
968
|
+
rocksdb_options_set_write_dbid_to_manifest(options_dbid_in_manifest, true);
|
|
969
|
+
CheckCondition(!write_to_manifest);
|
|
970
|
+
write_to_manifest =
|
|
971
|
+
rocksdb_options_get_write_dbid_to_manifest(options_dbid_in_manifest);
|
|
972
|
+
CheckCondition(write_to_manifest);
|
|
973
|
+
|
|
974
|
+
db = rocksdb_open(options_dbid_in_manifest, dbbackupname, &err);
|
|
975
|
+
CheckNoError(err);
|
|
976
|
+
|
|
977
|
+
rocksdb_checkpoint_t* checkpoint =
|
|
978
|
+
rocksdb_checkpoint_object_create(db, &err);
|
|
979
|
+
CheckNoError(err);
|
|
980
|
+
|
|
981
|
+
rocksdb_checkpoint_create(checkpoint, dbcheckpointname, 0, &err);
|
|
982
|
+
CheckNoError(err);
|
|
983
|
+
|
|
984
|
+
rocksdb_checkpoint_object_destroy(checkpoint);
|
|
985
|
+
checkpoint = NULL;
|
|
986
|
+
|
|
987
|
+
// get the identity before the backup
|
|
988
|
+
size_t before_db_id_len = 0;
|
|
989
|
+
char* before_db_id = rocksdb_get_db_identity(db, &before_db_id_len);
|
|
990
|
+
CheckCondition(before_db_id_len == 36);
|
|
991
|
+
|
|
992
|
+
// open the checkpoint
|
|
993
|
+
rocksdb_close(db);
|
|
994
|
+
rocksdb_destroy_db(options_dbid_in_manifest, dbbackupname, &err);
|
|
995
|
+
CheckNoError(err);
|
|
996
|
+
|
|
997
|
+
rocksdb_options_set_error_if_exists(options_dbid_in_manifest, 0);
|
|
998
|
+
db = rocksdb_open(options_dbid_in_manifest, dbcheckpointname, &err);
|
|
999
|
+
CheckNoError(err);
|
|
1000
|
+
|
|
1001
|
+
// the db_identity after the checkpoint is the same
|
|
1002
|
+
size_t after_db_id_len = 0;
|
|
1003
|
+
char* after_db_id = rocksdb_get_db_identity(db, &after_db_id_len);
|
|
1004
|
+
CheckCondition(after_db_id_len == 36);
|
|
1005
|
+
CheckCondition(memcmp(after_db_id, before_db_id, after_db_id_len) == 0);
|
|
1006
|
+
Free(&before_db_id);
|
|
1007
|
+
Free(&after_db_id);
|
|
1008
|
+
|
|
1009
|
+
rocksdb_close(db);
|
|
1010
|
+
rocksdb_destroy_db(options_dbid_in_manifest, dbcheckpointname, &err);
|
|
1011
|
+
CheckNoError(err);
|
|
1012
|
+
rocksdb_options_destroy(options_dbid_in_manifest);
|
|
1013
|
+
options_dbid_in_manifest = NULL;
|
|
1014
|
+
|
|
1015
|
+
// re-open the default database
|
|
1016
|
+
rocksdb_options_set_error_if_exists(options, 0);
|
|
1017
|
+
db = rocksdb_open(options, dbname, &err);
|
|
1018
|
+
CheckNoError(err);
|
|
1019
|
+
rocksdb_options_set_error_if_exists(options, 1);
|
|
1020
|
+
}
|
|
1021
|
+
|
|
851
1022
|
StartPhase("compactall");
|
|
852
1023
|
rocksdb_compact_range(db, NULL, 0, NULL, 0);
|
|
853
1024
|
CheckGet(db, roptions, "foo", "hello");
|
|
@@ -1318,6 +1489,8 @@ int main(int argc, char** argv) {
|
|
|
1318
1489
|
policy = rocksdb_filterpolicy_create_ribbon_hybrid(8.0, 1);
|
|
1319
1490
|
}
|
|
1320
1491
|
rocksdb_block_based_options_set_filter_policy(table_options, policy);
|
|
1492
|
+
rocksdb_block_based_options_set_optimize_filters_for_memory(table_options,
|
|
1493
|
+
0);
|
|
1321
1494
|
|
|
1322
1495
|
// Create new database
|
|
1323
1496
|
rocksdb_close(db);
|
|
@@ -1588,6 +1761,21 @@ int main(int argc, char** argv) {
|
|
|
1588
1761
|
CheckPinGetCF(db, roptions, handles[1], "bar", NULL);
|
|
1589
1762
|
CheckPinGetCF(db, roptions, handles[1], "box", "c");
|
|
1590
1763
|
CheckPinGetCF(db, roptions, handles[1], "buff", "rocksdb");
|
|
1764
|
+
rocksdb_writebatch_clear(wb);
|
|
1765
|
+
// Test WriteBatch iteration with Column Family
|
|
1766
|
+
int pos = 0;
|
|
1767
|
+
rocksdb_writebatch_put_cf(wb, handles[1], "bar", 3, "b", 1);
|
|
1768
|
+
rocksdb_writebatch_put_cf(wb, handles[1], "box", 3, "c", 1);
|
|
1769
|
+
rocksdb_writebatch_delete_cf(wb, handles[1], "bar", 3);
|
|
1770
|
+
rocksdb_writebatch_merge_cf(wb, handles[1], "box", 3, "cc", 2);
|
|
1771
|
+
rocksdb_writebatch_put(wb, "foo", 3, "f", 1);
|
|
1772
|
+
rocksdb_writebatch_delete(wb, "foo", 3);
|
|
1773
|
+
rocksdb_writebatch_put(wb, "baz", 3, "a", 1);
|
|
1774
|
+
rocksdb_writebatch_merge(wb, "baz", 3, "aa", 2);
|
|
1775
|
+
rocksdb_writebatch_iterate_cf(wb, &pos, CheckPutCF, CheckDelCF,
|
|
1776
|
+
CheckMergeCF);
|
|
1777
|
+
CheckCondition(pos == 8);
|
|
1778
|
+
rocksdb_writebatch_clear(wb);
|
|
1591
1779
|
rocksdb_writebatch_destroy(wb);
|
|
1592
1780
|
|
|
1593
1781
|
rocksdb_flush_wal(db, 1, &err);
|
|
@@ -2039,7 +2227,6 @@ int main(int argc, char** argv) {
|
|
|
2039
2227
|
rocksdb_options_set_advise_random_on_open(o, 1);
|
|
2040
2228
|
CheckCondition(1 == rocksdb_options_get_advise_random_on_open(o));
|
|
2041
2229
|
|
|
2042
|
-
|
|
2043
2230
|
rocksdb_options_set_use_adaptive_mutex(o, 1);
|
|
2044
2231
|
CheckCondition(1 == rocksdb_options_get_use_adaptive_mutex(o));
|
|
2045
2232
|
|
|
@@ -2110,6 +2297,9 @@ int main(int argc, char** argv) {
|
|
|
2110
2297
|
rocksdb_options_set_compaction_style(o, 2);
|
|
2111
2298
|
CheckCondition(2 == rocksdb_options_get_compaction_style(o));
|
|
2112
2299
|
|
|
2300
|
+
rocksdb_options_set_compaction_pri(o, 4);
|
|
2301
|
+
CheckCondition(4 == rocksdb_options_get_compaction_pri(o));
|
|
2302
|
+
|
|
2113
2303
|
rocksdb_options_set_atomic_flush(o, 1);
|
|
2114
2304
|
CheckCondition(1 == rocksdb_options_get_atomic_flush(o));
|
|
2115
2305
|
|
|
@@ -2132,6 +2322,12 @@ int main(int argc, char** argv) {
|
|
|
2132
2322
|
CheckCondition(rocksdb_statistics_level_all ==
|
|
2133
2323
|
rocksdb_options_get_statistics_level(o));
|
|
2134
2324
|
|
|
2325
|
+
CheckCondition(0 ==
|
|
2326
|
+
rocksdb_options_get_track_and_verify_wals_in_manifest(o));
|
|
2327
|
+
rocksdb_options_set_track_and_verify_wals_in_manifest(o, 42);
|
|
2328
|
+
CheckCondition(1 ==
|
|
2329
|
+
rocksdb_options_get_track_and_verify_wals_in_manifest(o));
|
|
2330
|
+
|
|
2135
2331
|
/* Blob Options */
|
|
2136
2332
|
rocksdb_options_set_enable_blob_files(o, 1);
|
|
2137
2333
|
CheckCondition(1 == rocksdb_options_get_enable_blob_files(o));
|
|
@@ -2614,6 +2810,10 @@ int main(int argc, char** argv) {
|
|
|
2614
2810
|
CheckCondition(1 == rocksdb_options_get_compaction_style(copy));
|
|
2615
2811
|
CheckCondition(2 == rocksdb_options_get_compaction_style(o));
|
|
2616
2812
|
|
|
2813
|
+
rocksdb_options_set_compaction_pri(copy, 1);
|
|
2814
|
+
CheckCondition(1 == rocksdb_options_get_compaction_pri(copy));
|
|
2815
|
+
CheckCondition(4 == rocksdb_options_get_compaction_pri(o));
|
|
2816
|
+
|
|
2617
2817
|
rocksdb_options_set_atomic_flush(copy, 0);
|
|
2618
2818
|
CheckCondition(0 == rocksdb_options_get_atomic_flush(copy));
|
|
2619
2819
|
CheckCondition(1 == rocksdb_options_get_atomic_flush(o));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
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/coalescing_iterator.h"
|
|
7
|
+
|
|
8
|
+
#include "db/wide/wide_columns_helper.h"
|
|
9
|
+
|
|
10
|
+
namespace ROCKSDB_NAMESPACE {
|
|
11
|
+
|
|
12
|
+
void CoalescingIterator::Coalesce(
|
|
13
|
+
const autovector<MultiCfIteratorInfo>& items) {
|
|
14
|
+
assert(wide_columns_.empty());
|
|
15
|
+
MinHeap heap;
|
|
16
|
+
for (const auto& item : items) {
|
|
17
|
+
assert(item.iterator);
|
|
18
|
+
for (auto& column : item.iterator->columns()) {
|
|
19
|
+
heap.push(WideColumnWithOrder{&column, item.order});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (heap.empty()) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
wide_columns_.reserve(heap.size());
|
|
26
|
+
auto current = heap.top();
|
|
27
|
+
heap.pop();
|
|
28
|
+
while (!heap.empty()) {
|
|
29
|
+
int comparison = current.column->name().compare(heap.top().column->name());
|
|
30
|
+
if (comparison < 0) {
|
|
31
|
+
wide_columns_.push_back(*current.column);
|
|
32
|
+
} else if (comparison > 0) {
|
|
33
|
+
// Shouldn't reach here.
|
|
34
|
+
// Current item in the heap is greater than the top item in the min heap
|
|
35
|
+
assert(false);
|
|
36
|
+
}
|
|
37
|
+
current = heap.top();
|
|
38
|
+
heap.pop();
|
|
39
|
+
}
|
|
40
|
+
wide_columns_.push_back(*current.column);
|
|
41
|
+
|
|
42
|
+
if (WideColumnsHelper::HasDefaultColumn(wide_columns_)) {
|
|
43
|
+
value_ = WideColumnsHelper::GetDefaultColumn(wide_columns_);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
} // namespace ROCKSDB_NAMESPACE
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
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
|
+
#pragma once
|
|
7
|
+
|
|
8
|
+
#include "db/multi_cf_iterator_impl.h"
|
|
9
|
+
|
|
10
|
+
namespace ROCKSDB_NAMESPACE {
|
|
11
|
+
|
|
12
|
+
// EXPERIMENTAL
|
|
13
|
+
class CoalescingIterator : public Iterator {
|
|
14
|
+
public:
|
|
15
|
+
CoalescingIterator(const Comparator* comparator,
|
|
16
|
+
const std::vector<ColumnFamilyHandle*>& column_families,
|
|
17
|
+
const std::vector<Iterator*>& child_iterators)
|
|
18
|
+
: impl_(
|
|
19
|
+
comparator, column_families, child_iterators, [this]() { Reset(); },
|
|
20
|
+
[this](const autovector<MultiCfIteratorInfo>& items) {
|
|
21
|
+
Coalesce(items);
|
|
22
|
+
}) {}
|
|
23
|
+
~CoalescingIterator() override {}
|
|
24
|
+
|
|
25
|
+
// No copy allowed
|
|
26
|
+
CoalescingIterator(const CoalescingIterator&) = delete;
|
|
27
|
+
CoalescingIterator& operator=(const CoalescingIterator&) = delete;
|
|
28
|
+
|
|
29
|
+
bool Valid() const override { return impl_.Valid(); }
|
|
30
|
+
void SeekToFirst() override { impl_.SeekToFirst(); }
|
|
31
|
+
void SeekToLast() override { impl_.SeekToLast(); }
|
|
32
|
+
void Seek(const Slice& target) override { impl_.Seek(target); }
|
|
33
|
+
void SeekForPrev(const Slice& target) override { impl_.SeekForPrev(target); }
|
|
34
|
+
void Next() override { impl_.Next(); }
|
|
35
|
+
void Prev() override { impl_.Prev(); }
|
|
36
|
+
Slice key() const override { return impl_.key(); }
|
|
37
|
+
Status status() const override { return impl_.status(); }
|
|
38
|
+
|
|
39
|
+
Slice value() const override {
|
|
40
|
+
assert(Valid());
|
|
41
|
+
return value_;
|
|
42
|
+
}
|
|
43
|
+
const WideColumns& columns() const override {
|
|
44
|
+
assert(Valid());
|
|
45
|
+
return wide_columns_;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
void Reset() {
|
|
49
|
+
value_.clear();
|
|
50
|
+
wide_columns_.clear();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private:
|
|
54
|
+
MultiCfIteratorImpl impl_;
|
|
55
|
+
Slice value_;
|
|
56
|
+
WideColumns wide_columns_;
|
|
57
|
+
|
|
58
|
+
struct WideColumnWithOrder {
|
|
59
|
+
const WideColumn* column;
|
|
60
|
+
int order;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
class WideColumnWithOrderComparator {
|
|
64
|
+
public:
|
|
65
|
+
explicit WideColumnWithOrderComparator() {}
|
|
66
|
+
bool operator()(const WideColumnWithOrder& a,
|
|
67
|
+
const WideColumnWithOrder& b) const {
|
|
68
|
+
int c = a.column->name().compare(b.column->name());
|
|
69
|
+
return c == 0 ? a.order - b.order > 0 : c > 0;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
using MinHeap =
|
|
74
|
+
BinaryHeap<WideColumnWithOrder, WideColumnWithOrderComparator>;
|
|
75
|
+
|
|
76
|
+
void Coalesce(const autovector<MultiCfIteratorInfo>& items);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
} // namespace ROCKSDB_NAMESPACE
|
|
@@ -538,6 +538,7 @@ ColumnFamilyData::ColumnFamilyData(
|
|
|
538
538
|
refs_(0),
|
|
539
539
|
initialized_(false),
|
|
540
540
|
dropped_(false),
|
|
541
|
+
flush_skip_reschedule_(false),
|
|
541
542
|
internal_comparator_(cf_options.comparator),
|
|
542
543
|
initial_cf_options_(SanitizeOptions(db_options, cf_options)),
|
|
543
544
|
ioptions_(db_options, initial_cf_options_),
|
|
@@ -1528,6 +1529,20 @@ Status ColumnFamilyData::ValidateOptions(
|
|
|
1528
1529
|
}
|
|
1529
1530
|
}
|
|
1530
1531
|
}
|
|
1532
|
+
|
|
1533
|
+
if (cf_options.compaction_style == kCompactionStyleUniversal) {
|
|
1534
|
+
int max_read_amp = cf_options.compaction_options_universal.max_read_amp;
|
|
1535
|
+
if (max_read_amp < -1) {
|
|
1536
|
+
return Status::NotSupported(
|
|
1537
|
+
"CompactionOptionsUniversal::max_read_amp should be at least -1.");
|
|
1538
|
+
} else if (0 < max_read_amp &&
|
|
1539
|
+
max_read_amp < cf_options.level0_file_num_compaction_trigger) {
|
|
1540
|
+
return Status::NotSupported(
|
|
1541
|
+
"CompactionOptionsUniversal::max_read_amp limits the number of sorted"
|
|
1542
|
+
" runs but is smaller than the compaction trigger "
|
|
1543
|
+
"level0_file_num_compaction_trigger.");
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1531
1546
|
return s;
|
|
1532
1547
|
}
|
|
1533
1548
|
|
|
@@ -1607,6 +1622,19 @@ FSDirectory* ColumnFamilyData::GetDataDir(size_t path_id) const {
|
|
|
1607
1622
|
return data_dirs_[path_id].get();
|
|
1608
1623
|
}
|
|
1609
1624
|
|
|
1625
|
+
void ColumnFamilyData::SetFlushSkipReschedule() {
|
|
1626
|
+
const Comparator* ucmp = user_comparator();
|
|
1627
|
+
const size_t ts_sz = ucmp->timestamp_size();
|
|
1628
|
+
if (ts_sz == 0 || ioptions_.persist_user_defined_timestamps) {
|
|
1629
|
+
return;
|
|
1630
|
+
}
|
|
1631
|
+
flush_skip_reschedule_.store(true);
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
bool ColumnFamilyData::GetAndClearFlushSkipReschedule() {
|
|
1635
|
+
return flush_skip_reschedule_.exchange(false);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1610
1638
|
bool ColumnFamilyData::ShouldPostponeFlushToRetainUDT(
|
|
1611
1639
|
uint64_t max_memtable_id) {
|
|
1612
1640
|
const Comparator* ucmp = user_comparator();
|
|
@@ -329,6 +329,10 @@ class ColumnFamilyData {
|
|
|
329
329
|
void SetDropped();
|
|
330
330
|
bool IsDropped() const { return dropped_.load(std::memory_order_relaxed); }
|
|
331
331
|
|
|
332
|
+
void SetFlushSkipReschedule();
|
|
333
|
+
|
|
334
|
+
bool GetAndClearFlushSkipReschedule();
|
|
335
|
+
|
|
332
336
|
// thread-safe
|
|
333
337
|
int NumberLevels() const { return ioptions_.num_levels; }
|
|
334
338
|
|
|
@@ -568,6 +572,10 @@ class ColumnFamilyData {
|
|
|
568
572
|
// of its files (if missing)
|
|
569
573
|
void RecoverEpochNumbers();
|
|
570
574
|
|
|
575
|
+
int GetUnflushedMemTableCountForWriteStallCheck() const {
|
|
576
|
+
return (mem_->IsEmpty() ? 0 : 1) + imm_.NumNotFlushed();
|
|
577
|
+
}
|
|
578
|
+
|
|
571
579
|
private:
|
|
572
580
|
friend class ColumnFamilySet;
|
|
573
581
|
ColumnFamilyData(uint32_t id, const std::string& name,
|
|
@@ -592,6 +600,15 @@ class ColumnFamilyData {
|
|
|
592
600
|
std::atomic<bool> initialized_;
|
|
593
601
|
std::atomic<bool> dropped_; // true if client dropped it
|
|
594
602
|
|
|
603
|
+
// When user-defined timestamps in memtable only feature is enabled, this
|
|
604
|
+
// flag indicates a successfully requested flush that should
|
|
605
|
+
// skip being rescheduled and haven't undergone the rescheduling check yet.
|
|
606
|
+
// This flag is cleared when a check skips rescheduling a FlushRequest.
|
|
607
|
+
// With this flag, automatic flushes in regular cases can continue to
|
|
608
|
+
// retain UDTs by getting rescheduled as usual while manual flushes and
|
|
609
|
+
// error recovery flushes will proceed without getting rescheduled.
|
|
610
|
+
std::atomic<bool> flush_skip_reschedule_;
|
|
611
|
+
|
|
595
612
|
const InternalKeyComparator internal_comparator_;
|
|
596
613
|
InternalTblPropCollFactories internal_tbl_prop_coll_factories_;
|
|
597
614
|
|
|
@@ -63,7 +63,9 @@ uint64_t TotalFileSize(const std::vector<FileMetaData*>& files) {
|
|
|
63
63
|
return sum;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
// TODO(hx235): consider making this function part of the construction so we
|
|
67
|
+
// don't forget to call it
|
|
68
|
+
void Compaction::FinalizeInputInfo(Version* _input_version) {
|
|
67
69
|
input_version_ = _input_version;
|
|
68
70
|
cfd_ = input_version_->cfd();
|
|
69
71
|
|
|
@@ -864,6 +866,11 @@ bool Compaction::ShouldFormSubcompactions() const {
|
|
|
864
866
|
return false;
|
|
865
867
|
}
|
|
866
868
|
|
|
869
|
+
if (cfd_->ioptions()->table_factory->Name() ==
|
|
870
|
+
TableFactory::kPlainTableName()) {
|
|
871
|
+
return false;
|
|
872
|
+
}
|
|
873
|
+
|
|
867
874
|
// Round-Robin pri under leveled compaction allows subcompactions by default
|
|
868
875
|
// and the number of subcompactions can be larger than max_subcompactions_
|
|
869
876
|
if (cfd_->ioptions()->compaction_pri == kRoundRobin &&
|
|
@@ -289,14 +289,7 @@ class Compaction {
|
|
|
289
289
|
// is the sum of all input file sizes.
|
|
290
290
|
uint64_t OutputFilePreallocationSize() const;
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
// status and fail the compaction if needed
|
|
294
|
-
// TODO(hx235): consider making this function part of the construction so we
|
|
295
|
-
// don't forget to call it
|
|
296
|
-
void FinalizeInputInfo(Version* input_version) {
|
|
297
|
-
SetInputVersion(input_version);
|
|
298
|
-
InitInputTableProperties().PermitUncheckedError();
|
|
299
|
-
}
|
|
292
|
+
void FinalizeInputInfo(Version* input_version);
|
|
300
293
|
|
|
301
294
|
struct InputLevelSummaryBuffer {
|
|
302
295
|
char buffer[128];
|
|
@@ -333,6 +326,16 @@ class Compaction {
|
|
|
333
326
|
int output_level, VersionStorageInfo* vstorage,
|
|
334
327
|
const std::vector<CompactionInputFiles>& inputs);
|
|
335
328
|
|
|
329
|
+
// TODO(hx235): eventually we should consider `InitInputTableProperties()`'s
|
|
330
|
+
// status and fail the compaction if needed
|
|
331
|
+
//
|
|
332
|
+
// May open and read table files for table property.
|
|
333
|
+
// Should not be called while holding mutex_.
|
|
334
|
+
const TablePropertiesCollection& GetOrInitInputTableProperties() {
|
|
335
|
+
InitInputTableProperties().PermitUncheckedError();
|
|
336
|
+
return input_table_properties_;
|
|
337
|
+
}
|
|
338
|
+
|
|
336
339
|
const TablePropertiesCollection& GetInputTableProperties() const {
|
|
337
340
|
return input_table_properties_;
|
|
338
341
|
}
|
|
@@ -433,7 +436,6 @@ class Compaction {
|
|
|
433
436
|
const int output_level);
|
|
434
437
|
|
|
435
438
|
private:
|
|
436
|
-
void SetInputVersion(Version* input_version);
|
|
437
439
|
|
|
438
440
|
Status InitInputTableProperties();
|
|
439
441
|
|