@nxtedition/rocksdb 7.1.20 → 7.1.21

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.
Files changed (262) hide show
  1. package/deps/rocksdb/rocksdb/CMakeLists.txt +13 -6
  2. package/deps/rocksdb/rocksdb/Makefile +1 -1
  3. package/deps/rocksdb/rocksdb/TARGETS +2 -0
  4. package/deps/rocksdb/rocksdb/cache/cache_reservation_manager_test.cc +1 -0
  5. package/deps/rocksdb/rocksdb/cache/cache_test.cc +4 -4
  6. package/deps/rocksdb/rocksdb/cache/clock_cache.cc +139 -161
  7. package/deps/rocksdb/rocksdb/cache/clock_cache.h +92 -82
  8. package/deps/rocksdb/rocksdb/cache/compressed_secondary_cache.cc +16 -3
  9. package/deps/rocksdb/rocksdb/cache/compressed_secondary_cache.h +9 -3
  10. package/deps/rocksdb/rocksdb/cache/compressed_secondary_cache_test.cc +73 -30
  11. package/deps/rocksdb/rocksdb/cache/fast_lru_cache.cc +25 -67
  12. package/deps/rocksdb/rocksdb/cache/fast_lru_cache.h +41 -40
  13. package/deps/rocksdb/rocksdb/cache/lru_cache.cc +109 -155
  14. package/deps/rocksdb/rocksdb/cache/lru_cache.h +127 -149
  15. package/deps/rocksdb/rocksdb/cache/lru_cache_test.cc +75 -80
  16. package/deps/rocksdb/rocksdb/cache/sharded_cache.cc +22 -172
  17. package/deps/rocksdb/rocksdb/cache/sharded_cache.h +272 -85
  18. package/deps/rocksdb/rocksdb/db/arena_wrapped_db_iter.cc +12 -4
  19. package/deps/rocksdb/rocksdb/db/blob/blob_counting_iterator_test.cc +1 -0
  20. package/deps/rocksdb/rocksdb/db/blob/blob_file_addition_test.cc +1 -0
  21. package/deps/rocksdb/rocksdb/db/blob/blob_file_builder_test.cc +1 -0
  22. package/deps/rocksdb/rocksdb/db/blob/blob_file_cache_test.cc +1 -0
  23. package/deps/rocksdb/rocksdb/db/blob/blob_file_garbage_test.cc +1 -0
  24. package/deps/rocksdb/rocksdb/db/blob/blob_file_reader_test.cc +1 -0
  25. package/deps/rocksdb/rocksdb/db/blob/blob_garbage_meter_test.cc +1 -0
  26. package/deps/rocksdb/rocksdb/db/blob/blob_source_test.cc +13 -4
  27. package/deps/rocksdb/rocksdb/db/builder.cc +1 -1
  28. package/deps/rocksdb/rocksdb/db/column_family.cc +15 -1
  29. package/deps/rocksdb/rocksdb/db/compact_files_test.cc +1 -0
  30. package/deps/rocksdb/rocksdb/db/compaction/clipping_iterator_test.cc +1 -0
  31. package/deps/rocksdb/rocksdb/db/compaction/compaction.cc +25 -7
  32. package/deps/rocksdb/rocksdb/db/compaction/compaction.h +10 -0
  33. package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator.cc +22 -8
  34. package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator.h +14 -5
  35. package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator_test.cc +1 -0
  36. package/deps/rocksdb/rocksdb/db/compaction/compaction_job.cc +38 -12
  37. package/deps/rocksdb/rocksdb/db/compaction/compaction_job.h +9 -6
  38. package/deps/rocksdb/rocksdb/db/compaction/compaction_job_test.cc +408 -6
  39. package/deps/rocksdb/rocksdb/db/compaction/compaction_outputs.cc +244 -54
  40. package/deps/rocksdb/rocksdb/db/compaction/compaction_outputs.h +27 -6
  41. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker.cc +25 -30
  42. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_fifo.cc +87 -26
  43. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_level.cc +23 -4
  44. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_test.cc +61 -0
  45. package/deps/rocksdb/rocksdb/db/compaction/tiered_compaction_test.cc +294 -21
  46. package/deps/rocksdb/rocksdb/db/comparator_db_test.cc +1 -0
  47. package/deps/rocksdb/rocksdb/db/cuckoo_table_db_test.cc +1 -0
  48. package/deps/rocksdb/rocksdb/db/db_block_cache_test.cc +28 -10
  49. package/deps/rocksdb/rocksdb/db/db_bloom_filter_test.cc +4 -4
  50. package/deps/rocksdb/rocksdb/db/db_compaction_test.cc +272 -0
  51. package/deps/rocksdb/rocksdb/db/db_flush_test.cc +38 -0
  52. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.cc +69 -25
  53. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.h +7 -3
  54. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_compaction_flush.cc +29 -12
  55. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_debug.cc +0 -12
  56. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_files.cc +10 -4
  57. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_open.cc +35 -22
  58. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.cc +5 -1
  59. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_write.cc +40 -5
  60. package/deps/rocksdb/rocksdb/db/db_iter.cc +1 -0
  61. package/deps/rocksdb/rocksdb/db/db_iter_stress_test.cc +1 -0
  62. package/deps/rocksdb/rocksdb/db/db_iter_test.cc +1 -0
  63. package/deps/rocksdb/rocksdb/db/db_iterator_test.cc +22 -0
  64. package/deps/rocksdb/rocksdb/db/db_kv_checksum_test.cc +1 -0
  65. package/deps/rocksdb/rocksdb/db/db_logical_block_size_cache_test.cc +1 -0
  66. package/deps/rocksdb/rocksdb/db/db_range_del_test.cc +72 -5
  67. package/deps/rocksdb/rocksdb/db/db_tailing_iter_test.cc +60 -21
  68. package/deps/rocksdb/rocksdb/db/db_test.cc +170 -1
  69. package/deps/rocksdb/rocksdb/db/db_test2.cc +9 -3
  70. package/deps/rocksdb/rocksdb/db/db_test_util.cc +19 -0
  71. package/deps/rocksdb/rocksdb/db/db_test_util.h +32 -0
  72. package/deps/rocksdb/rocksdb/db/db_with_timestamp_basic_test.cc +444 -3
  73. package/deps/rocksdb/rocksdb/db/db_write_test.cc +8 -8
  74. package/deps/rocksdb/rocksdb/db/dbformat.cc +13 -0
  75. package/deps/rocksdb/rocksdb/db/dbformat.h +59 -4
  76. package/deps/rocksdb/rocksdb/db/dbformat_test.cc +1 -0
  77. package/deps/rocksdb/rocksdb/db/experimental.cc +3 -1
  78. package/deps/rocksdb/rocksdb/db/external_sst_file_ingestion_job.cc +24 -3
  79. package/deps/rocksdb/rocksdb/db/fault_injection_test.cc +1 -0
  80. package/deps/rocksdb/rocksdb/db/filename_test.cc +1 -0
  81. package/deps/rocksdb/rocksdb/db/flush_job.cc +4 -3
  82. package/deps/rocksdb/rocksdb/db/flush_job_test.cc +1 -0
  83. package/deps/rocksdb/rocksdb/db/forward_iterator.cc +85 -43
  84. package/deps/rocksdb/rocksdb/db/forward_iterator.h +3 -1
  85. package/deps/rocksdb/rocksdb/db/internal_stats.cc +33 -6
  86. package/deps/rocksdb/rocksdb/db/internal_stats.h +6 -0
  87. package/deps/rocksdb/rocksdb/db/listener_test.cc +1 -0
  88. package/deps/rocksdb/rocksdb/db/log_test.cc +1 -0
  89. package/deps/rocksdb/rocksdb/db/log_writer.cc +1 -1
  90. package/deps/rocksdb/rocksdb/db/log_writer.h +1 -1
  91. package/deps/rocksdb/rocksdb/db/manual_compaction_test.cc +1 -0
  92. package/deps/rocksdb/rocksdb/db/memtable.cc +158 -56
  93. package/deps/rocksdb/rocksdb/db/memtable.h +2 -0
  94. package/deps/rocksdb/rocksdb/db/memtable_list_test.cc +1 -0
  95. package/deps/rocksdb/rocksdb/db/merge_helper_test.cc +1 -0
  96. package/deps/rocksdb/rocksdb/db/options_file_test.cc +1 -0
  97. package/deps/rocksdb/rocksdb/db/perf_context_test.cc +1 -0
  98. package/deps/rocksdb/rocksdb/db/periodic_task_scheduler_test.cc +1 -0
  99. package/deps/rocksdb/rocksdb/db/plain_table_db_test.cc +1 -0
  100. package/deps/rocksdb/rocksdb/db/prefix_test.cc +1 -0
  101. package/deps/rocksdb/rocksdb/db/range_del_aggregator.cc +52 -9
  102. package/deps/rocksdb/rocksdb/db/range_del_aggregator.h +31 -2
  103. package/deps/rocksdb/rocksdb/db/range_del_aggregator_test.cc +1 -0
  104. package/deps/rocksdb/rocksdb/db/range_tombstone_fragmenter.cc +81 -42
  105. package/deps/rocksdb/rocksdb/db/range_tombstone_fragmenter.h +78 -12
  106. package/deps/rocksdb/rocksdb/db/range_tombstone_fragmenter_test.cc +1 -0
  107. package/deps/rocksdb/rocksdb/db/repair_test.cc +1 -0
  108. package/deps/rocksdb/rocksdb/db/seqno_time_test.cc +154 -27
  109. package/deps/rocksdb/rocksdb/db/seqno_to_time_mapping.cc +21 -4
  110. package/deps/rocksdb/rocksdb/db/seqno_to_time_mapping.h +4 -1
  111. package/deps/rocksdb/rocksdb/db/table_cache.cc +18 -6
  112. package/deps/rocksdb/rocksdb/db/table_properties_collector_test.cc +1 -0
  113. package/deps/rocksdb/rocksdb/db/version_builder_test.cc +1 -0
  114. package/deps/rocksdb/rocksdb/db/version_edit_test.cc +1 -0
  115. package/deps/rocksdb/rocksdb/db/version_set.cc +15 -7
  116. package/deps/rocksdb/rocksdb/db/version_set.h +2 -1
  117. package/deps/rocksdb/rocksdb/db/version_set_test.cc +1 -0
  118. package/deps/rocksdb/rocksdb/db/version_util.h +3 -1
  119. package/deps/rocksdb/rocksdb/db/wal_manager_test.cc +1 -0
  120. package/deps/rocksdb/rocksdb/db/wide/wide_column_serialization.cc +28 -9
  121. package/deps/rocksdb/rocksdb/db/wide/wide_column_serialization.h +21 -0
  122. package/deps/rocksdb/rocksdb/db/wide/wide_column_serialization_test.cc +30 -0
  123. package/deps/rocksdb/rocksdb/db/wide/wide_columns.cc +4 -0
  124. package/deps/rocksdb/rocksdb/db/write_batch.cc +30 -7
  125. package/deps/rocksdb/rocksdb/db/write_batch_internal.h +24 -13
  126. package/deps/rocksdb/rocksdb/db/write_batch_test.cc +5 -4
  127. package/deps/rocksdb/rocksdb/db/write_callback_test.cc +1 -0
  128. package/deps/rocksdb/rocksdb/db/write_controller_test.cc +1 -0
  129. package/deps/rocksdb/rocksdb/db_stress_tool/batched_ops_stress.cc +104 -60
  130. package/deps/rocksdb/rocksdb/db_stress_tool/cf_consistency_stress.cc +199 -108
  131. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_common.cc +39 -0
  132. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_common.h +8 -0
  133. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_driver.cc +3 -1
  134. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_gflags.cc +19 -0
  135. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_shared_state.h +26 -0
  136. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_test_base.cc +247 -118
  137. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_test_base.h +24 -4
  138. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_tool.cc +18 -0
  139. package/deps/rocksdb/rocksdb/db_stress_tool/expected_state.cc +129 -1
  140. package/deps/rocksdb/rocksdb/db_stress_tool/multi_ops_txns_stress.cc +22 -0
  141. package/deps/rocksdb/rocksdb/db_stress_tool/multi_ops_txns_stress.h +4 -0
  142. package/deps/rocksdb/rocksdb/db_stress_tool/no_batched_ops_stress.cc +312 -117
  143. package/deps/rocksdb/rocksdb/env/env_basic_test.cc +1 -0
  144. package/deps/rocksdb/rocksdb/env/fs_posix.cc +10 -2
  145. package/deps/rocksdb/rocksdb/env/io_posix_test.cc +1 -0
  146. package/deps/rocksdb/rocksdb/env/mock_env_test.cc +1 -0
  147. package/deps/rocksdb/rocksdb/file/delete_scheduler.cc +5 -1
  148. package/deps/rocksdb/rocksdb/file/delete_scheduler_test.cc +1 -0
  149. package/deps/rocksdb/rocksdb/file/prefetch_test.cc +1 -0
  150. package/deps/rocksdb/rocksdb/file/writable_file_writer.h +1 -1
  151. package/deps/rocksdb/rocksdb/include/rocksdb/advanced_options.h +49 -1
  152. package/deps/rocksdb/rocksdb/include/rocksdb/cache.h +44 -18
  153. package/deps/rocksdb/rocksdb/include/rocksdb/db.h +8 -7
  154. package/deps/rocksdb/rocksdb/include/rocksdb/file_system.h +6 -1
  155. package/deps/rocksdb/rocksdb/include/rocksdb/listener.h +3 -0
  156. package/deps/rocksdb/rocksdb/include/rocksdb/secondary_cache.h +17 -4
  157. package/deps/rocksdb/rocksdb/include/rocksdb/sst_file_reader.h +4 -0
  158. package/deps/rocksdb/rocksdb/include/rocksdb/sst_file_writer.h +7 -0
  159. package/deps/rocksdb/rocksdb/include/rocksdb/universal_compaction.h +1 -1
  160. package/deps/rocksdb/rocksdb/include/rocksdb/wide_columns.h +9 -0
  161. package/deps/rocksdb/rocksdb/include/rocksdb/write_batch.h +3 -6
  162. package/deps/rocksdb/rocksdb/logging/auto_roll_logger_test.cc +1 -0
  163. package/deps/rocksdb/rocksdb/logging/env_logger_test.cc +1 -0
  164. package/deps/rocksdb/rocksdb/logging/event_logger_test.cc +1 -0
  165. package/deps/rocksdb/rocksdb/memory/arena.cc +23 -88
  166. package/deps/rocksdb/rocksdb/memory/arena.h +25 -31
  167. package/deps/rocksdb/rocksdb/memory/arena_test.cc +61 -0
  168. package/deps/rocksdb/rocksdb/memory/memory_allocator_test.cc +1 -0
  169. package/deps/rocksdb/rocksdb/memtable/inlineskiplist_test.cc +1 -0
  170. package/deps/rocksdb/rocksdb/memtable/skiplist_test.cc +1 -0
  171. package/deps/rocksdb/rocksdb/memtable/write_buffer_manager_test.cc +1 -0
  172. package/deps/rocksdb/rocksdb/monitoring/histogram_test.cc +1 -0
  173. package/deps/rocksdb/rocksdb/monitoring/iostats_context_test.cc +1 -0
  174. package/deps/rocksdb/rocksdb/options/cf_options.cc +19 -0
  175. package/deps/rocksdb/rocksdb/options/cf_options.h +8 -0
  176. package/deps/rocksdb/rocksdb/options/configurable_test.cc +1 -0
  177. package/deps/rocksdb/rocksdb/options/options.cc +7 -0
  178. package/deps/rocksdb/rocksdb/options/options_helper.cc +6 -0
  179. package/deps/rocksdb/rocksdb/options/options_settable_test.cc +6 -0
  180. package/deps/rocksdb/rocksdb/options/options_test.cc +63 -40
  181. package/deps/rocksdb/rocksdb/port/mmap.cc +98 -0
  182. package/deps/rocksdb/rocksdb/port/mmap.h +70 -0
  183. package/deps/rocksdb/rocksdb/port/stack_trace.cc +7 -0
  184. package/deps/rocksdb/rocksdb/port/stack_trace.h +4 -1
  185. package/deps/rocksdb/rocksdb/port/win/port_win.h +2 -7
  186. package/deps/rocksdb/rocksdb/src.mk +1 -0
  187. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_factory.cc +7 -7
  188. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.cc +3 -3
  189. package/deps/rocksdb/rocksdb/table/block_based/block_test.cc +1 -0
  190. package/deps/rocksdb/rocksdb/table/block_based/data_block_hash_index_test.cc +1 -0
  191. package/deps/rocksdb/rocksdb/table/block_based/full_filter_block_test.cc +1 -0
  192. package/deps/rocksdb/rocksdb/table/block_based/partitioned_filter_block_test.cc +1 -0
  193. package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_builder_test.cc +1 -0
  194. package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_reader_test.cc +1 -0
  195. package/deps/rocksdb/rocksdb/table/get_context.cc +19 -1
  196. package/deps/rocksdb/rocksdb/table/get_context.h +9 -0
  197. package/deps/rocksdb/rocksdb/table/merger_test.cc +1 -0
  198. package/deps/rocksdb/rocksdb/table/merging_iterator.cc +10 -11
  199. package/deps/rocksdb/rocksdb/table/mock_table.cc +37 -19
  200. package/deps/rocksdb/rocksdb/table/mock_table.h +5 -1
  201. package/deps/rocksdb/rocksdb/table/sst_file_reader.cc +6 -0
  202. package/deps/rocksdb/rocksdb/table/sst_file_reader_test.cc +33 -0
  203. package/deps/rocksdb/rocksdb/table/sst_file_writer.cc +45 -6
  204. package/deps/rocksdb/rocksdb/test_util/testharness.h +2 -0
  205. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc +1 -0
  206. package/deps/rocksdb/rocksdb/tools/db_bench_tool.cc +5 -0
  207. package/deps/rocksdb/rocksdb/tools/db_bench_tool_test.cc +1 -0
  208. package/deps/rocksdb/rocksdb/tools/io_tracer_parser_test.cc +1 -0
  209. package/deps/rocksdb/rocksdb/tools/ldb_cmd_test.cc +36 -0
  210. package/deps/rocksdb/rocksdb/tools/reduce_levels_test.cc +1 -0
  211. package/deps/rocksdb/rocksdb/tools/trace_analyzer_test.cc +1 -0
  212. package/deps/rocksdb/rocksdb/trace_replay/block_cache_tracer_test.cc +1 -0
  213. package/deps/rocksdb/rocksdb/trace_replay/io_tracer_test.cc +1 -0
  214. package/deps/rocksdb/rocksdb/util/autovector_test.cc +1 -0
  215. package/deps/rocksdb/rocksdb/util/bloom_test.cc +1 -0
  216. package/deps/rocksdb/rocksdb/util/coding_test.cc +1 -0
  217. package/deps/rocksdb/rocksdb/util/crc32c_test.cc +1 -0
  218. package/deps/rocksdb/rocksdb/util/dynamic_bloom_test.cc +1 -0
  219. package/deps/rocksdb/rocksdb/util/file_reader_writer_test.cc +1 -0
  220. package/deps/rocksdb/rocksdb/util/filelock_test.cc +1 -0
  221. package/deps/rocksdb/rocksdb/util/gflags_compat.h +12 -7
  222. package/deps/rocksdb/rocksdb/util/hash_test.cc +1 -0
  223. package/deps/rocksdb/rocksdb/util/heap_test.cc +4 -2
  224. package/deps/rocksdb/rocksdb/util/random_test.cc +1 -0
  225. package/deps/rocksdb/rocksdb/util/rate_limiter_test.cc +1 -0
  226. package/deps/rocksdb/rocksdb/util/repeatable_thread_test.cc +1 -0
  227. package/deps/rocksdb/rocksdb/util/ribbon_test.cc +1 -0
  228. package/deps/rocksdb/rocksdb/util/slice_transform_test.cc +1 -0
  229. package/deps/rocksdb/rocksdb/util/thread_list_test.cc +1 -0
  230. package/deps/rocksdb/rocksdb/util/thread_local_test.cc +1 -0
  231. package/deps/rocksdb/rocksdb/util/timer_test.cc +1 -0
  232. package/deps/rocksdb/rocksdb/util/work_queue_test.cc +4 -0
  233. package/deps/rocksdb/rocksdb/utilities/agg_merge/agg_merge_test.cc +1 -0
  234. package/deps/rocksdb/rocksdb/utilities/backup/backup_engine.cc +13 -0
  235. package/deps/rocksdb/rocksdb/utilities/backup/backup_engine_test.cc +9 -3
  236. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_db_test.cc +1 -0
  237. package/deps/rocksdb/rocksdb/utilities/cassandra/cassandra_format_test.cc +1 -0
  238. package/deps/rocksdb/rocksdb/utilities/cassandra/cassandra_functional_test.cc +1 -0
  239. package/deps/rocksdb/rocksdb/utilities/cassandra/cassandra_row_merge_test.cc +1 -0
  240. package/deps/rocksdb/rocksdb/utilities/cassandra/cassandra_serialize_test.cc +1 -0
  241. package/deps/rocksdb/rocksdb/utilities/env_mirror_test.cc +1 -0
  242. package/deps/rocksdb/rocksdb/utilities/env_timed_test.cc +1 -0
  243. package/deps/rocksdb/rocksdb/utilities/fault_injection_secondary_cache.h +8 -0
  244. package/deps/rocksdb/rocksdb/utilities/memory/memory_test.cc +1 -0
  245. package/deps/rocksdb/rocksdb/utilities/object_registry_test.cc +1 -0
  246. package/deps/rocksdb/rocksdb/utilities/options/options_util_test.cc +1 -0
  247. package/deps/rocksdb/rocksdb/utilities/persistent_cache/hash_table_test.cc +1 -0
  248. package/deps/rocksdb/rocksdb/utilities/persistent_cache/persistent_cache_test.cc +1 -0
  249. package/deps/rocksdb/rocksdb/utilities/simulator_cache/cache_simulator_test.cc +1 -0
  250. package/deps/rocksdb/rocksdb/utilities/transactions/optimistic_transaction_test.cc +1 -0
  251. package/deps/rocksdb/rocksdb/utilities/transactions/timestamped_snapshot_test.cc +1 -0
  252. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_test.cc +1 -0
  253. package/deps/rocksdb/rocksdb/utilities/transactions/write_committed_transaction_ts_test.cc +1 -0
  254. package/deps/rocksdb/rocksdb/utilities/transactions/write_unprepared_transaction_test.cc +1 -0
  255. package/deps/rocksdb/rocksdb/utilities/ttl/ttl_test.cc +1 -0
  256. package/deps/rocksdb/rocksdb/utilities/util_merge_operators_test.cc +1 -0
  257. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc +7 -0
  258. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index_test.cc +20 -0
  259. package/index.js +12 -4
  260. package/package.json +1 -1
  261. package/prebuilds/darwin-arm64/node.napi.node +0 -0
  262. package/prebuilds/linux-x64/node.napi.node +0 -0
@@ -395,6 +395,7 @@ TEST_P(EnvMoreTestWithParam, GetChildrenIgnoresDotAndDotDot) {
395
395
 
396
396
  } // namespace ROCKSDB_NAMESPACE
397
397
  int main(int argc, char** argv) {
398
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
398
399
  ::testing::InitGoogleTest(&argc, argv);
399
400
  return RUN_ALL_TESTS();
400
401
  }
@@ -575,7 +575,7 @@ class PosixFileSystem : public FileSystem {
575
575
  }
576
576
  }
577
577
 
578
- IOStatus GetChildren(const std::string& dir, const IOOptions& /*opts*/,
578
+ IOStatus GetChildren(const std::string& dir, const IOOptions& opts,
579
579
  std::vector<std::string>* result,
580
580
  IODebugContext* /*dbg*/) override {
581
581
  result->clear();
@@ -595,12 +595,20 @@ class PosixFileSystem : public FileSystem {
595
595
  // reset errno before calling readdir()
596
596
  errno = 0;
597
597
  struct dirent* entry;
598
+
598
599
  while ((entry = readdir(d)) != nullptr) {
599
600
  // filter out '.' and '..' directory entries
600
601
  // which appear only on some platforms
601
602
  const bool ignore =
602
603
  entry->d_type == DT_DIR &&
603
- (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0);
604
+ (strcmp(entry->d_name, ".") == 0 ||
605
+ strcmp(entry->d_name, "..") == 0
606
+ #ifndef ASSERT_STATUS_CHECKED
607
+ // In case of ASSERT_STATUS_CHECKED, GetChildren support older
608
+ // version of API for debugging purpose.
609
+ || opts.do_not_recurse
610
+ #endif
611
+ );
604
612
  if (!ignore) {
605
613
  result->push_back(entry->d_name);
606
614
  }
@@ -135,6 +135,7 @@ TEST_F(LogicalBlockSizeCacheTest, Ref) {
135
135
  #endif
136
136
 
137
137
  int main(int argc, char** argv) {
138
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
138
139
  ::testing::InitGoogleTest(&argc, argv);
139
140
  return RUN_ALL_TESTS();
140
141
  }
@@ -78,6 +78,7 @@ TEST_F(MockEnvTest, FakeSleeping) {
78
78
  } // namespace ROCKSDB_NAMESPACE
79
79
 
80
80
  int main(int argc, char** argv) {
81
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
81
82
  ::testing::InitGoogleTest(&argc, argv);
82
83
  return RUN_ALL_TESTS();
83
84
  }
@@ -141,7 +141,11 @@ Status DeleteScheduler::CleanupDirectory(Env* env, SstFileManagerImpl* sfm,
141
141
  Status s;
142
142
  // Check if there are any files marked as trash in this path
143
143
  std::vector<std::string> files_in_path;
144
- s = env->GetChildren(path, &files_in_path);
144
+ const auto& fs = env->GetFileSystem();
145
+ IOOptions io_opts;
146
+ io_opts.do_not_recurse = true;
147
+ s = fs->GetChildren(path, io_opts, &files_in_path,
148
+ /*IODebugContext*=*/nullptr);
145
149
  if (!s.ok()) {
146
150
  return s;
147
151
  }
@@ -712,6 +712,7 @@ TEST_F(DeleteSchedulerTest, IsTrashCheck) {
712
712
  } // namespace ROCKSDB_NAMESPACE
713
713
 
714
714
  int main(int argc, char** argv) {
715
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
715
716
  ::testing::InitGoogleTest(&argc, argv);
716
717
  return RUN_ALL_TESTS();
717
718
  }
@@ -2079,6 +2079,7 @@ namespace {
2079
2079
  } // namespace ROCKSDB_NAMESPACE
2080
2080
 
2081
2081
  int main(int argc, char** argv) {
2082
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
2082
2083
  ::testing::InitGoogleTest(&argc, argv);
2083
2084
 
2084
2085
  return RUN_ALL_TESTS();
@@ -286,7 +286,7 @@ class WritableFileWriter {
286
286
 
287
287
  bool use_direct_io() { return writable_file_->use_direct_io(); }
288
288
 
289
- bool TEST_BufferIsEmpty() { return buf_.CurrentSize() == 0; }
289
+ bool BufferIsEmpty() { return buf_.CurrentSize() == 0; }
290
290
 
291
291
  void TEST_SetFileChecksumGenerator(
292
292
  FileChecksumGenerator* checksum_generator) {
@@ -271,7 +271,10 @@ struct AdvancedColumnFamilyOptions {
271
271
  // read amplification because a get request has to check in all of these
272
272
  // files. Also, an in-memory merge may result in writing lesser
273
273
  // data to storage if there are duplicate records in each of these
274
- // individual write buffers. Default: 1
274
+ // individual write buffers.
275
+ // If atomic flush is enabled (options.atomic_flush == true), then this
276
+ // option will be sanitized to 1.
277
+ // Default: 1
275
278
  int min_write_buffer_number_to_merge = 1;
276
279
 
277
280
  // DEPRECATED
@@ -648,6 +651,15 @@ struct AdvancedColumnFamilyOptions {
648
651
  // Default: false
649
652
  bool level_compaction_dynamic_level_bytes = false;
650
653
 
654
+ // Allows RocksDB to generate files that are not exactly the target_file_size
655
+ // only for the non-bottommost files. Which can reduce the write-amplification
656
+ // from compaction. The file size could be from 0 to 2x target_file_size.
657
+ // Once enabled, non-bottommost compaction will try to cut the files align
658
+ // with the next level file boundaries (grandparent level).
659
+ //
660
+ // Default: true
661
+ bool level_compaction_dynamic_file_size = true;
662
+
651
663
  // Default: 10.
652
664
  //
653
665
  // Dynamically changeable through SetOptions() API
@@ -672,6 +684,17 @@ struct AdvancedColumnFamilyOptions {
672
684
  // Dynamically changeable through SetOptions() API
673
685
  uint64_t max_compaction_bytes = 0;
674
686
 
687
+ // When setting up compaction input files, we ignore the
688
+ // `max_compaction_bytes` limit when pulling in input files that are entirely
689
+ // within output key range.
690
+ //
691
+ // Default: true
692
+ //
693
+ // Dynamically changeable through SetOptions() API
694
+ // We could remove this knob and always ignore the limit once it is proven
695
+ // safe.
696
+ bool ignore_max_compaction_bytes_for_input = true;
697
+
675
698
  // All writes will be slowed down to at least delayed_write_rate if estimated
676
699
  // bytes needed to be compaction exceed this threshold.
677
700
  //
@@ -899,8 +922,33 @@ struct AdvancedColumnFamilyOptions {
899
922
  // size constrained, the size amp is going to be only for non-last levels.
900
923
  //
901
924
  // Default: 0 (disable the feature)
925
+ //
926
+ // Not dynamically changeable, change it requires db restart.
902
927
  uint64_t preclude_last_level_data_seconds = 0;
903
928
 
929
+ // EXPERIMENTAL
930
+ // If this option is set, it will preserve the internal time information about
931
+ // the data until it's older than the specified time here.
932
+ // Internally the time information is a map between sequence number and time,
933
+ // which is the same as `preclude_last_level_data_seconds`. But it won't
934
+ // preclude the data from the last level and the data in the last level won't
935
+ // have the sequence number zeroed out.
936
+ // Internally, rocksdb would sample the sequence number to time pair and store
937
+ // that in SST property "rocksdb.seqno.time.map". The information is currently
938
+ // only used for tiered storage compaction (option
939
+ // `preclude_last_level_data_seconds`).
940
+ //
941
+ // Note: if both `preclude_last_level_data_seconds` and this option is set, it
942
+ // will preserve the max time of the 2 options and compaction still preclude
943
+ // the data based on `preclude_last_level_data_seconds`.
944
+ // The higher the preserve_time is, the less the sampling frequency will be (
945
+ // which means less accuracy of the time estimation).
946
+ //
947
+ // Default: 0 (disable the feature)
948
+ //
949
+ // Not dynamically changeable, change it requires db restart.
950
+ uint64_t preserve_internal_time_seconds = 0;
951
+
904
952
  // When set, large values (blobs) are written to separate blob files, and
905
953
  // only pointers to them are stored in SST files. This can reduce write
906
954
  // amplification for large-value use cases at the cost of introducing a level
@@ -569,9 +569,11 @@ class Cache {
569
569
  // over time.
570
570
 
571
571
  // Insert a mapping from key->value into the cache and assign it
572
- // the specified charge against the total cache capacity.
573
- // If strict_capacity_limit is true and cache reaches its full capacity,
574
- // return Status::MemoryLimit.
572
+ // the specified charge against the total cache capacity. If
573
+ // strict_capacity_limit is true and cache reaches its full capacity,
574
+ // return Status::MemoryLimit. `value` must be non-nullptr for this
575
+ // Insert() because Value() == nullptr is reserved for indicating failure
576
+ // with secondary-cache-compatible mappings.
575
577
  //
576
578
  // The helper argument is saved by the cache and will be used when the
577
579
  // inserted object is evicted or promoted to the secondary cache. It,
@@ -619,11 +621,31 @@ class Cache {
619
621
  // saved and used later when the object is evicted. Therefore, it must
620
622
  // outlive the cache.
621
623
  //
622
- // The handle returned may not be ready. The caller should call IsReady()
623
- // to check if the item value is ready, and call Wait() or WaitAll() if
624
- // its not ready. The caller should then call Value() to check if the
625
- // item was successfully retrieved. If unsuccessful (perhaps due to an
626
- // IO error), Value() will return nullptr.
624
+ // ======================== Async Lookup (wait=false) ======================
625
+ // When wait=false, the handle returned might be in any of three states:
626
+ // * Present - If Value() != nullptr, then the result is present and
627
+ // the handle can be used just as if wait=true.
628
+ // * Pending, not ready (IsReady() == false) - secondary cache is still
629
+ // working to retrieve the value. Might become ready any time.
630
+ // * Pending, ready (IsReady() == true) - secondary cache has the value
631
+ // but it has not been loaded into primary cache. Call to Wait()/WaitAll()
632
+ // will not block.
633
+ //
634
+ // IMPORTANT: Pending handles are not thread-safe, and only these functions
635
+ // are allowed on them: Value(), IsReady(), Wait(), WaitAll(). Even Release()
636
+ // can only come after Wait() or WaitAll() even though a reference is held.
637
+ //
638
+ // Only Wait()/WaitAll() gets a Handle out of a Pending state. (Waiting is
639
+ // safe and has no effect on other handle states.) After waiting on a Handle,
640
+ // it is in one of two states:
641
+ // * Present - if Value() != nullptr
642
+ // * Failed - if Value() == nullptr, such as if the secondary cache
643
+ // initially thought it had the value but actually did not.
644
+ //
645
+ // Note that given an arbitrary Handle, the only way to distinguish the
646
+ // Pending+ready state from the Failed state is to Wait() on it. A cache
647
+ // entry not compatible with secondary cache can also have Value()==nullptr
648
+ // like the Failed state, but this is not generally a concern.
627
649
  virtual Handle* Lookup(const Slice& key, const CacheItemHelper* /*helper_cb*/,
628
650
  const CreateCallback& /*create_cb*/,
629
651
  Priority /*priority*/, bool /*wait*/,
@@ -634,27 +656,31 @@ class Cache {
634
656
  // Release a mapping returned by a previous Lookup(). The "useful"
635
657
  // parameter specifies whether the data was actually used or not,
636
658
  // which may be used by the cache implementation to decide whether
637
- // to consider it as a hit for retention purposes.
659
+ // to consider it as a hit for retention purposes. As noted elsewhere,
660
+ // "pending" handles require Wait()/WaitAll() before Release().
638
661
  virtual bool Release(Handle* handle, bool /*useful*/,
639
662
  bool erase_if_last_ref) {
640
663
  return Release(handle, erase_if_last_ref);
641
664
  }
642
665
 
643
- // Determines if the handle returned by Lookup() has a valid value yet. The
644
- // call is not thread safe and should be called only by someone holding a
645
- // reference to the handle.
666
+ // Determines if the handle returned by Lookup() can give a value without
667
+ // blocking, though Wait()/WaitAll() might be required to publish it to
668
+ // Value(). See secondary cache compatible Lookup() above for details.
669
+ // This call is not thread safe on "pending" handles.
646
670
  virtual bool IsReady(Handle* /*handle*/) { return true; }
647
671
 
648
- // If the handle returned by Lookup() is not ready yet, wait till it
649
- // becomes ready.
650
- // Note: A ready handle doesn't necessarily mean it has a valid value. The
651
- // user should call Value() and check for nullptr.
672
+ // Convert a "pending" handle into a full thread-shareable handle by
673
+ // * If necessary, wait until secondary cache finishes loading the value.
674
+ // * Construct the value for primary cache and set it in the handle.
675
+ // Even after Wait() on a pending handle, the caller must check for
676
+ // Value() == nullptr in case of failure. This call is not thread-safe
677
+ // on pending handles. This call has no effect on non-pending handles.
678
+ // See secondary cache compatible Lookup() above for details.
652
679
  virtual void Wait(Handle* /*handle*/) {}
653
680
 
654
681
  // Wait for a vector of handles to become ready. As with Wait(), the user
655
682
  // should check the Value() of each handle for nullptr. This call is not
656
- // thread safe and should only be called by the caller holding a reference
657
- // to each of the handles.
683
+ // thread-safe on pending handles.
658
684
  virtual void WaitAll(std::vector<Handle*>& /*handles*/) {}
659
685
 
660
686
  private:
@@ -481,13 +481,10 @@ class DB {
481
481
  virtual Status DeleteRange(const WriteOptions& options,
482
482
  ColumnFamilyHandle* column_family,
483
483
  const Slice& begin_key, const Slice& end_key);
484
- virtual Status DeleteRange(const WriteOptions& /*options*/,
485
- ColumnFamilyHandle* /*column_family*/,
486
- const Slice& /*begin_key*/,
487
- const Slice& /*end_key*/, const Slice& /*ts*/) {
488
- return Status::NotSupported(
489
- "DeleteRange does not support user-defined timestamp yet");
490
- }
484
+ virtual Status DeleteRange(const WriteOptions& options,
485
+ ColumnFamilyHandle* column_family,
486
+ const Slice& begin_key, const Slice& end_key,
487
+ const Slice& ts);
491
488
 
492
489
  // Merge the database entry for "key" with "value". Returns OK on success,
493
490
  // and a non-OK status on error. The semantics of this operation is
@@ -914,6 +911,10 @@ class DB {
914
911
  // available in the map form.
915
912
  static const std::string kBlockCacheEntryStats;
916
913
 
914
+ // "rocksdb.fast-block-cache-entry-stats" - same as above, but returns
915
+ // stale values more frequently to reduce overhead and latency.
916
+ static const std::string kFastBlockCacheEntryStats;
917
+
917
918
  // "rocksdb.num-immutable-mem-table" - returns number of immutable
918
919
  // memtables that have not yet been flushed.
919
920
  static const std::string kNumImmutableMemTable;
@@ -112,6 +112,10 @@ struct IOOptions {
112
112
  // fsync, set this to force the fsync
113
113
  bool force_dir_fsync;
114
114
 
115
+ // Can be used by underlying file systems to skip recursing through sub
116
+ // directories and list only files in GetChildren API.
117
+ bool do_not_recurse;
118
+
115
119
  IOOptions() : IOOptions(false) {}
116
120
 
117
121
  explicit IOOptions(bool force_dir_fsync_)
@@ -119,7 +123,8 @@ struct IOOptions {
119
123
  prio(IOPriority::kIOLow),
120
124
  rate_limiter_priority(Env::IO_TOTAL),
121
125
  type(IOType::kUnknown),
122
- force_dir_fsync(force_dir_fsync_) {}
126
+ force_dir_fsync(force_dir_fsync_),
127
+ do_not_recurse(false) {}
123
128
  };
124
129
 
125
130
  struct DirFsyncOptions {
@@ -148,6 +148,9 @@ enum class CompactionReason : int {
148
148
  kChangeTemperature,
149
149
  // Compaction scheduled to force garbage collection of blob files
150
150
  kForcedBlobGC,
151
+ // A special TTL compaction for RoundRobin policy, which basically the same as
152
+ // kLevelMaxLevelSize, but the goal is to compact TTLed files.
153
+ kRoundRobinTtl,
151
154
  // total number of compaction reasons, new reasons must be added above this.
152
155
  kNumOfReasons,
153
156
  };
@@ -24,7 +24,7 @@ namespace ROCKSDB_NAMESPACE {
24
24
  // handle successfullly read the item.
25
25
  class SecondaryCacheResultHandle {
26
26
  public:
27
- virtual ~SecondaryCacheResultHandle() {}
27
+ virtual ~SecondaryCacheResultHandle() = default;
28
28
 
29
29
  // Returns whether the handle is ready or not
30
30
  virtual bool IsReady() = 0;
@@ -49,7 +49,7 @@ class SecondaryCacheResultHandle {
49
49
  // including data loss, unreported corruption, deadlocks, and more.
50
50
  class SecondaryCache : public Customizable {
51
51
  public:
52
- virtual ~SecondaryCache() {}
52
+ ~SecondaryCache() override = default;
53
53
 
54
54
  static const char* Type() { return "SecondaryCache"; }
55
55
  static Status CreateFromString(const ConfigOptions& config_options,
@@ -83,7 +83,7 @@ class SecondaryCache : public Customizable {
83
83
  bool advise_erase, bool& is_in_sec_cache) = 0;
84
84
 
85
85
  // Indicate whether a handle can be erased in this secondary cache.
86
- virtual bool SupportForceErase() const = 0;
86
+ [[nodiscard]] virtual bool SupportForceErase() const = 0;
87
87
 
88
88
  // At the discretion of the implementation, erase the data associated
89
89
  // with key.
@@ -92,7 +92,20 @@ class SecondaryCache : public Customizable {
92
92
  // Wait for a collection of handles to become ready.
93
93
  virtual void WaitAll(std::vector<SecondaryCacheResultHandle*> handles) = 0;
94
94
 
95
- virtual std::string GetPrintableOptions() const = 0;
95
+ // Set the maximum configured capacity of the cache.
96
+ // When the new capacity is less than the old capacity and the existing usage
97
+ // is greater than new capacity, the implementation will do its best job to
98
+ // purge the released entries from the cache in order to lower the usage.
99
+ //
100
+ // The derived class can make this function no-op and return NotSupported().
101
+ virtual Status SetCapacity(size_t /* capacity */) {
102
+ return Status::NotSupported();
103
+ }
104
+
105
+ // The derived class can make this function no-op and return NotSupported().
106
+ virtual Status GetCapacity(size_t& /* capacity */) {
107
+ return Status::NotSupported();
108
+ }
96
109
  };
97
110
 
98
111
  } // namespace ROCKSDB_NAMESPACE
@@ -7,6 +7,7 @@
7
7
 
8
8
  #ifndef ROCKSDB_LITE
9
9
 
10
+ #include "db/range_tombstone_fragmenter.h"
10
11
  #include "rocksdb/iterator.h"
11
12
  #include "rocksdb/options.h"
12
13
  #include "rocksdb/slice.h"
@@ -30,6 +31,9 @@ class SstFileReader {
30
31
  // If "snapshot" is nullptr, the iterator returns only the latest keys.
31
32
  Iterator* NewIterator(const ReadOptions& options);
32
33
 
34
+ FragmentedRangeTombstoneIterator* NewRangeTombstoneIterator(
35
+ const ReadOptions& options);
36
+
33
37
  std::shared_ptr<const TableProperties> GetTableProperties() const;
34
38
 
35
39
  // Verifies whether there is corruption in this table.
@@ -148,6 +148,13 @@ class SstFileWriter {
148
148
  // REQUIRES: comparator is *not* timestamp-aware.
149
149
  Status DeleteRange(const Slice& begin_key, const Slice& end_key);
150
150
 
151
+ // Add a range deletion tombstone to currently opened file.
152
+ // REQUIRES: begin_key and end_key are user keys without timestamp.
153
+ // REQUIRES: the timestamp's size is equal to what is expected by
154
+ // the comparator.
155
+ Status DeleteRange(const Slice& begin_key, const Slice& end_key,
156
+ const Slice& timestamp);
157
+
151
158
  // Finalize writing to sst file and close file.
152
159
  //
153
160
  // An optional ExternalSstFileInfo pointer can be passed to the function
@@ -59,7 +59,7 @@ class CompactionOptionsUniversal {
59
59
  // A1...An B1...Bm C1...Ct
60
60
  // where A1 is the newest and Ct is the oldest, and we are going to compact
61
61
  // B1...Bm, we calculate the total size of all the files as total_size, as
62
- // well as the total size of C1...Ct as total_C, the compaction output file
62
+ // well as the total size of C1...Ct as total_C, the compaction output file
63
63
  // will be compressed iff
64
64
  // total_C / total_size < this percentage
65
65
  // Default: -1
@@ -5,6 +5,7 @@
5
5
 
6
6
  #pragma once
7
7
 
8
+ #include <ostream>
8
9
  #include <tuple>
9
10
  #include <utility>
10
11
  #include <vector>
@@ -70,6 +71,14 @@ inline bool operator!=(const WideColumn& lhs, const WideColumn& rhs) {
70
71
  return !(lhs == rhs);
71
72
  }
72
73
 
74
+ inline std::ostream& operator<<(std::ostream& os, const WideColumn& column) {
75
+ const bool hex =
76
+ (os.flags() & std::ios_base::basefield) == std::ios_base::hex;
77
+ os << column.name().ToString(hex) << ':' << column.value().ToString(hex);
78
+
79
+ return os;
80
+ }
81
+
73
82
  // A collection of wide columns.
74
83
  using WideColumns = std::vector<WideColumn>;
75
84
 
@@ -150,12 +150,9 @@ class WriteBatch : public WriteBatchBase {
150
150
  Status DeleteRange(const Slice& begin_key, const Slice& end_key) override {
151
151
  return DeleteRange(nullptr, begin_key, end_key);
152
152
  }
153
- Status DeleteRange(ColumnFamilyHandle* /*column_family*/,
154
- const Slice& /*begin_key*/, const Slice& /*end_key*/,
155
- const Slice& /*ts*/) override {
156
- return Status::NotSupported(
157
- "DeleteRange does not support user-defined timestamp");
158
- }
153
+ // begin_key and end_key should be user keys without timestamp.
154
+ Status DeleteRange(ColumnFamilyHandle* column_family, const Slice& begin_key,
155
+ const Slice& end_key, const Slice& ts) override;
159
156
 
160
157
  // variant that takes SliceParts
161
158
  Status DeleteRange(ColumnFamilyHandle* column_family,
@@ -728,6 +728,7 @@ TEST_F(AutoRollLoggerTest, RenameError) {
728
728
  } // namespace ROCKSDB_NAMESPACE
729
729
 
730
730
  int main(int argc, char** argv) {
731
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
731
732
  ::testing::InitGoogleTest(&argc, argv);
732
733
  return RUN_ALL_TESTS();
733
734
  }
@@ -156,6 +156,7 @@ TEST_F(EnvLoggerTest, ConcurrentLogging) {
156
156
  } // namespace ROCKSDB_NAMESPACE
157
157
 
158
158
  int main(int argc, char** argv) {
159
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
159
160
  ::testing::InitGoogleTest(&argc, argv);
160
161
  return RUN_ALL_TESTS();
161
162
  }
@@ -38,6 +38,7 @@ TEST_F(EventLoggerTest, SimpleTest) {
38
38
  } // namespace ROCKSDB_NAMESPACE
39
39
 
40
40
  int main(int argc, char** argv) {
41
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
41
42
  ::testing::InitGoogleTest(&argc, argv);
42
43
  return RUN_ALL_TESTS();
43
44
  }