@nxtedition/rocksdb 13.1.5 → 13.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.
Files changed (237) hide show
  1. package/binding.cc +62 -15
  2. package/deps/rocksdb/rocksdb/{TARGETS → BUCK} +27 -0
  3. package/deps/rocksdb/rocksdb/CMakeLists.txt +3 -1
  4. package/deps/rocksdb/rocksdb/Makefile +2 -2
  5. package/deps/rocksdb/rocksdb/cache/cache.cc +3 -1
  6. package/deps/rocksdb/rocksdb/db/arena_wrapped_db_iter.h +2 -0
  7. package/deps/rocksdb/rocksdb/db/attribute_group_iterator_impl.h +34 -9
  8. package/deps/rocksdb/rocksdb/db/blob/blob_source.cc +7 -6
  9. package/deps/rocksdb/rocksdb/db/blob/blob_source.h +5 -1
  10. package/deps/rocksdb/rocksdb/db/blob/blob_source_test.cc +22 -14
  11. package/deps/rocksdb/rocksdb/db/blob/db_blob_basic_test.cc +149 -0
  12. package/deps/rocksdb/rocksdb/db/builder.cc +13 -24
  13. package/deps/rocksdb/rocksdb/db/coalescing_iterator.h +35 -10
  14. package/deps/rocksdb/rocksdb/db/column_family.cc +21 -10
  15. package/deps/rocksdb/rocksdb/db/column_family.h +15 -8
  16. package/deps/rocksdb/rocksdb/db/column_family_test.cc +98 -7
  17. package/deps/rocksdb/rocksdb/db/compaction/compaction.cc +126 -16
  18. package/deps/rocksdb/rocksdb/db/compaction/compaction.h +51 -5
  19. package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator.cc +2 -2
  20. package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator.h +2 -8
  21. package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator_test.cc +24 -0
  22. package/deps/rocksdb/rocksdb/db/compaction/compaction_job.cc +52 -22
  23. package/deps/rocksdb/rocksdb/db/compaction/compaction_job.h +9 -7
  24. package/deps/rocksdb/rocksdb/db/compaction/compaction_job_test.cc +36 -9
  25. package/deps/rocksdb/rocksdb/db/compaction/compaction_outputs.h +6 -0
  26. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker.cc +30 -17
  27. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker.h +26 -23
  28. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_fifo.cc +43 -33
  29. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_fifo.h +6 -5
  30. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_level.cc +19 -9
  31. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_level.h +6 -5
  32. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_test.cc +632 -411
  33. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_universal.cc +171 -51
  34. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_universal.h +7 -5
  35. package/deps/rocksdb/rocksdb/db/compaction/compaction_service_job.cc +37 -10
  36. package/deps/rocksdb/rocksdb/db/compaction/compaction_service_test.cc +51 -11
  37. package/deps/rocksdb/rocksdb/db/compaction/subcompaction_state.cc +10 -3
  38. package/deps/rocksdb/rocksdb/db/compaction/tiered_compaction_test.cc +350 -154
  39. package/deps/rocksdb/rocksdb/db/convenience.cc +1 -1
  40. package/deps/rocksdb/rocksdb/db/db_block_cache_test.cc +62 -27
  41. package/deps/rocksdb/rocksdb/db/db_bloom_filter_test.cc +68 -1
  42. package/deps/rocksdb/rocksdb/db/db_compaction_test.cc +91 -0
  43. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.cc +134 -70
  44. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.h +71 -23
  45. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_compaction_flush.cc +43 -16
  46. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_debug.cc +47 -33
  47. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_files.cc +27 -19
  48. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_open.cc +38 -25
  49. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_readonly.cc +3 -3
  50. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.cc +7 -4
  51. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_write.cc +258 -42
  52. package/deps/rocksdb/rocksdb/db/db_io_failure_test.cc +161 -9
  53. package/deps/rocksdb/rocksdb/db/db_iter.cc +118 -86
  54. package/deps/rocksdb/rocksdb/db/db_iter.h +44 -17
  55. package/deps/rocksdb/rocksdb/db/db_options_test.cc +27 -6
  56. package/deps/rocksdb/rocksdb/db/db_test.cc +48 -16
  57. package/deps/rocksdb/rocksdb/db/db_test2.cc +60 -15
  58. package/deps/rocksdb/rocksdb/db/db_test_util.cc +97 -44
  59. package/deps/rocksdb/rocksdb/db/db_test_util.h +7 -1
  60. package/deps/rocksdb/rocksdb/db/dbformat.cc +15 -5
  61. package/deps/rocksdb/rocksdb/db/dbformat.h +137 -55
  62. package/deps/rocksdb/rocksdb/db/event_helpers.cc +1 -0
  63. package/deps/rocksdb/rocksdb/db/experimental.cc +54 -0
  64. package/deps/rocksdb/rocksdb/db/external_sst_file_basic_test.cc +663 -8
  65. package/deps/rocksdb/rocksdb/db/external_sst_file_ingestion_job.cc +152 -91
  66. package/deps/rocksdb/rocksdb/db/external_sst_file_ingestion_job.h +134 -11
  67. package/deps/rocksdb/rocksdb/db/external_sst_file_test.cc +55 -9
  68. package/deps/rocksdb/rocksdb/db/flush_job.cc +52 -29
  69. package/deps/rocksdb/rocksdb/db/flush_job.h +5 -3
  70. package/deps/rocksdb/rocksdb/db/flush_job_test.cc +18 -12
  71. package/deps/rocksdb/rocksdb/db/forward_iterator.cc +23 -29
  72. package/deps/rocksdb/rocksdb/db/import_column_family_job.cc +3 -2
  73. package/deps/rocksdb/rocksdb/db/import_column_family_test.cc +2 -0
  74. package/deps/rocksdb/rocksdb/db/internal_stats.cc +9 -6
  75. package/deps/rocksdb/rocksdb/db/internal_stats.h +54 -0
  76. package/deps/rocksdb/rocksdb/db/job_context.h +1 -1
  77. package/deps/rocksdb/rocksdb/db/log_reader.cc +6 -7
  78. package/deps/rocksdb/rocksdb/db/manifest_ops.cc +47 -0
  79. package/deps/rocksdb/rocksdb/db/manifest_ops.h +20 -0
  80. package/deps/rocksdb/rocksdb/db/memtable.cc +165 -64
  81. package/deps/rocksdb/rocksdb/db/memtable.h +422 -243
  82. package/deps/rocksdb/rocksdb/db/memtable_list.cc +99 -68
  83. package/deps/rocksdb/rocksdb/db/memtable_list.h +63 -38
  84. package/deps/rocksdb/rocksdb/db/memtable_list_test.cc +28 -25
  85. package/deps/rocksdb/rocksdb/db/multi_cf_iterator_impl.h +118 -60
  86. package/deps/rocksdb/rocksdb/db/multi_cf_iterator_test.cc +344 -89
  87. package/deps/rocksdb/rocksdb/db/range_tombstone_fragmenter.h +2 -3
  88. package/deps/rocksdb/rocksdb/db/repair.cc +15 -14
  89. package/deps/rocksdb/rocksdb/db/repair_test.cc +0 -13
  90. package/deps/rocksdb/rocksdb/db/snapshot_checker.h +7 -0
  91. package/deps/rocksdb/rocksdb/db/table_cache.cc +62 -65
  92. package/deps/rocksdb/rocksdb/db/table_cache.h +70 -76
  93. package/deps/rocksdb/rocksdb/db/table_cache_sync_and_async.h +5 -6
  94. package/deps/rocksdb/rocksdb/db/table_properties_collector_test.cc +1 -1
  95. package/deps/rocksdb/rocksdb/db/transaction_log_impl.cc +8 -7
  96. package/deps/rocksdb/rocksdb/db/version_builder.cc +17 -19
  97. package/deps/rocksdb/rocksdb/db/version_builder.h +13 -12
  98. package/deps/rocksdb/rocksdb/db/version_edit.h +30 -0
  99. package/deps/rocksdb/rocksdb/db/version_edit_handler.cc +3 -5
  100. package/deps/rocksdb/rocksdb/db/version_set.cc +89 -129
  101. package/deps/rocksdb/rocksdb/db/version_set.h +12 -4
  102. package/deps/rocksdb/rocksdb/db/version_set_sync_and_async.h +1 -2
  103. package/deps/rocksdb/rocksdb/db/version_set_test.cc +12 -8
  104. package/deps/rocksdb/rocksdb/db/wide/wide_column_serialization.cc +0 -15
  105. package/deps/rocksdb/rocksdb/db/wide/wide_column_serialization.h +0 -2
  106. package/deps/rocksdb/rocksdb/db/wide/wide_column_serialization_test.cc +9 -7
  107. package/deps/rocksdb/rocksdb/db/wide/wide_columns_helper.cc +0 -8
  108. package/deps/rocksdb/rocksdb/db/wide/wide_columns_helper.h +28 -2
  109. package/deps/rocksdb/rocksdb/db/write_batch.cc +32 -10
  110. package/deps/rocksdb/rocksdb/db/write_batch_internal.h +9 -0
  111. package/deps/rocksdb/rocksdb/db/write_batch_test.cc +2 -1
  112. package/deps/rocksdb/rocksdb/db/write_thread.cc +3 -1
  113. package/deps/rocksdb/rocksdb/db/write_thread.h +6 -2
  114. package/deps/rocksdb/rocksdb/db_stress_tool/batched_ops_stress.cc +15 -0
  115. package/deps/rocksdb/rocksdb/db_stress_tool/cf_consistency_stress.cc +7 -0
  116. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_common.h +4 -0
  117. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_gflags.cc +18 -2
  118. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_test_base.cc +100 -22
  119. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_test_base.h +15 -4
  120. package/deps/rocksdb/rocksdb/db_stress_tool/multi_ops_txns_stress.cc +34 -8
  121. package/deps/rocksdb/rocksdb/db_stress_tool/no_batched_ops_stress.cc +223 -78
  122. package/deps/rocksdb/rocksdb/env/file_system.cc +6 -1
  123. package/deps/rocksdb/rocksdb/env/fs_posix.cc +53 -0
  124. package/deps/rocksdb/rocksdb/env/io_posix.cc +63 -17
  125. package/deps/rocksdb/rocksdb/env/io_posix.h +30 -1
  126. package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.cc +132 -48
  127. package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.h +92 -24
  128. package/deps/rocksdb/rocksdb/file/prefetch_test.cc +727 -109
  129. package/deps/rocksdb/rocksdb/file/random_access_file_reader.cc +3 -4
  130. package/deps/rocksdb/rocksdb/file/random_access_file_reader.h +1 -1
  131. package/deps/rocksdb/rocksdb/file/writable_file_writer.cc +8 -0
  132. package/deps/rocksdb/rocksdb/include/rocksdb/attribute_groups.h +20 -1
  133. package/deps/rocksdb/rocksdb/include/rocksdb/compaction_job_stats.h +9 -0
  134. package/deps/rocksdb/rocksdb/include/rocksdb/configurable.h +9 -5
  135. package/deps/rocksdb/rocksdb/include/rocksdb/convenience.h +2 -0
  136. package/deps/rocksdb/rocksdb/include/rocksdb/db.h +10 -2
  137. package/deps/rocksdb/rocksdb/include/rocksdb/env.h +1 -0
  138. package/deps/rocksdb/rocksdb/include/rocksdb/experimental.h +7 -0
  139. package/deps/rocksdb/rocksdb/include/rocksdb/file_system.h +34 -37
  140. package/deps/rocksdb/rocksdb/include/rocksdb/iterator_base.h +21 -0
  141. package/deps/rocksdb/rocksdb/include/rocksdb/options.h +56 -28
  142. package/deps/rocksdb/rocksdb/include/rocksdb/sst_file_writer.h +3 -0
  143. package/deps/rocksdb/rocksdb/include/rocksdb/table.h +36 -28
  144. package/deps/rocksdb/rocksdb/include/rocksdb/table_properties.h +11 -0
  145. package/deps/rocksdb/rocksdb/include/rocksdb/thread_status.h +1 -0
  146. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/options_type.h +84 -60
  147. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/secondary_index.h +102 -0
  148. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/table_properties_collectors.h +89 -2
  149. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/transaction.h +32 -0
  150. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/transaction_db.h +30 -1
  151. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/write_batch_with_index.h +23 -2
  152. package/deps/rocksdb/rocksdb/include/rocksdb/version.h +2 -2
  153. package/deps/rocksdb/rocksdb/include/rocksdb/write_batch.h +2 -0
  154. package/deps/rocksdb/rocksdb/memtable/inlineskiplist.h +79 -21
  155. package/deps/rocksdb/rocksdb/memtable/skiplist.h +41 -18
  156. package/deps/rocksdb/rocksdb/memtable/skiplistrep.cc +1 -5
  157. package/deps/rocksdb/rocksdb/memtable/wbwi_memtable.cc +169 -0
  158. package/deps/rocksdb/rocksdb/memtable/wbwi_memtable.h +400 -0
  159. package/deps/rocksdb/rocksdb/monitoring/thread_status_util_debug.cc +2 -0
  160. package/deps/rocksdb/rocksdb/options/cf_options.cc +137 -82
  161. package/deps/rocksdb/rocksdb/options/cf_options.h +18 -6
  162. package/deps/rocksdb/rocksdb/options/configurable.cc +31 -17
  163. package/deps/rocksdb/rocksdb/options/configurable_helper.h +7 -6
  164. package/deps/rocksdb/rocksdb/options/options_helper.cc +10 -8
  165. package/deps/rocksdb/rocksdb/options/options_parser.cc +74 -54
  166. package/deps/rocksdb/rocksdb/options/options_settable_test.cc +89 -0
  167. package/deps/rocksdb/rocksdb/options/options_test.cc +112 -26
  168. package/deps/rocksdb/rocksdb/port/port.h +5 -9
  169. package/deps/rocksdb/rocksdb/src.mk +8 -0
  170. package/deps/rocksdb/rocksdb/table/adaptive/adaptive_table_factory.h +4 -0
  171. package/deps/rocksdb/rocksdb/table/block_based/block.h +1 -7
  172. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_builder.cc +2 -0
  173. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_factory.cc +62 -80
  174. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_factory.h +13 -3
  175. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_iterator.cc +16 -5
  176. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_iterator.h +38 -7
  177. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.cc +12 -4
  178. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.h +4 -1
  179. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_sync_and_async.h +4 -1
  180. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_test.cc +204 -1
  181. package/deps/rocksdb/rocksdb/table/block_based/data_block_hash_index_test.cc +3 -3
  182. package/deps/rocksdb/rocksdb/table/block_fetcher_test.cc +2 -1
  183. package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_factory.h +4 -0
  184. package/deps/rocksdb/rocksdb/table/format.cc +3 -3
  185. package/deps/rocksdb/rocksdb/table/meta_blocks.cc +4 -1
  186. package/deps/rocksdb/rocksdb/table/mock_table.cc +0 -50
  187. package/deps/rocksdb/rocksdb/table/mock_table.h +53 -0
  188. package/deps/rocksdb/rocksdb/table/plain/plain_table_factory.h +4 -0
  189. package/deps/rocksdb/rocksdb/table/sst_file_dumper.cc +1 -1
  190. package/deps/rocksdb/rocksdb/table/sst_file_writer.cc +10 -5
  191. package/deps/rocksdb/rocksdb/table/table_builder.h +3 -1
  192. package/deps/rocksdb/rocksdb/table/table_properties.cc +181 -0
  193. package/deps/rocksdb/rocksdb/table/table_reader_bench.cc +5 -5
  194. package/deps/rocksdb/rocksdb/table/table_test.cc +71 -64
  195. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_pysim.py +45 -45
  196. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_pysim_test.py +35 -35
  197. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_plot.py +43 -43
  198. package/deps/rocksdb/rocksdb/tools/db_bench_tool.cc +41 -4
  199. package/deps/rocksdb/rocksdb/tools/ldb_cmd.cc +1 -0
  200. package/deps/rocksdb/rocksdb/tools/sst_dump_test.cc +1 -1
  201. package/deps/rocksdb/rocksdb/unreleased_history/add.sh +13 -0
  202. package/deps/rocksdb/rocksdb/util/aligned_buffer.h +24 -5
  203. package/deps/rocksdb/rocksdb/util/compaction_job_stats_impl.cc +7 -0
  204. package/deps/rocksdb/rocksdb/util/file_checksum_helper.cc +0 -52
  205. package/deps/rocksdb/rocksdb/util/file_checksum_helper.h +1 -10
  206. package/deps/rocksdb/rocksdb/util/file_reader_writer_test.cc +92 -0
  207. package/deps/rocksdb/rocksdb/util/thread_operation.h +1 -0
  208. package/deps/rocksdb/rocksdb/util/udt_util.cc +50 -4
  209. package/deps/rocksdb/rocksdb/util/udt_util.h +24 -11
  210. package/deps/rocksdb/rocksdb/util/udt_util_test.cc +26 -13
  211. package/deps/rocksdb/rocksdb/utilities/memory/memory_test.cc +1 -16
  212. package/deps/rocksdb/rocksdb/utilities/options/options_util_test.cc +2 -0
  213. package/deps/rocksdb/rocksdb/utilities/secondary_index/faiss_ivf_index.cc +214 -0
  214. package/deps/rocksdb/rocksdb/utilities/secondary_index/faiss_ivf_index.h +60 -0
  215. package/deps/rocksdb/rocksdb/utilities/secondary_index/faiss_ivf_index_test.cc +124 -0
  216. package/deps/rocksdb/rocksdb/utilities/secondary_index/secondary_index_mixin.h +441 -0
  217. package/deps/rocksdb/rocksdb/utilities/table_properties_collectors/compact_for_tiering_collector.cc +34 -3
  218. package/deps/rocksdb/rocksdb/utilities/table_properties_collectors/compact_for_tiering_collector.h +7 -2
  219. package/deps/rocksdb/rocksdb/utilities/transactions/optimistic_transaction_test.cc +437 -0
  220. package/deps/rocksdb/rocksdb/utilities/transactions/pessimistic_transaction.cc +34 -11
  221. package/deps/rocksdb/rocksdb/utilities/transactions/pessimistic_transaction.h +14 -7
  222. package/deps/rocksdb/rocksdb/utilities/transactions/pessimistic_transaction_db.cc +7 -1
  223. package/deps/rocksdb/rocksdb/utilities/transactions/snapshot_checker.cc +17 -0
  224. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_base.cc +69 -0
  225. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_base.h +20 -0
  226. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_test.cc +1290 -0
  227. package/deps/rocksdb/rocksdb/utilities/transactions/write_committed_transaction_ts_test.cc +324 -0
  228. package/deps/rocksdb/rocksdb/utilities/transactions/write_prepared_txn.cc +18 -1
  229. package/deps/rocksdb/rocksdb/utilities/transactions/write_prepared_txn.h +8 -1
  230. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc +57 -12
  231. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc +32 -3
  232. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.h +33 -2
  233. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index_test.cc +721 -9
  234. package/deps/rocksdb/rocksdb.gyp +2 -0
  235. package/package.json +1 -1
  236. package/prebuilds/darwin-arm64/@nxtedition+rocksdb.node +0 -0
  237. package/prebuilds/linux-x64/@nxtedition+rocksdb.node +0 -0
@@ -182,6 +182,14 @@ class InternalStats {
182
182
  // The number of bytes read from the compaction output level (table files)
183
183
  uint64_t bytes_read_output_level;
184
184
 
185
+ // The number of bytes skipped from all non-output levels because the input
186
+ // files are filtered by compaction optimizations.
187
+ uint64_t bytes_skipped_non_output_levels;
188
+
189
+ // The number of bytes skipped from the compaction output level because the
190
+ // input files are filtered by compaction optimizations.
191
+ uint64_t bytes_skipped_output_level;
192
+
185
193
  // The number of bytes read from blob files
186
194
  uint64_t bytes_read_blob;
187
195
 
@@ -201,6 +209,14 @@ class InternalStats {
201
209
  // The number of compaction input files in the output level (table files)
202
210
  int num_input_files_in_output_level;
203
211
 
212
+ // The number of non output level compaction input files that are filtered
213
+ // by compaction optimizations.
214
+ int num_filtered_input_files_in_non_output_levels;
215
+
216
+ // The number of output level compaction input files that are filtered by
217
+ // compaction optimizations.
218
+ int num_filtered_input_files_in_output_level;
219
+
204
220
  // The number of compaction output files (table files)
205
221
  int num_output_files;
206
222
 
@@ -228,12 +244,16 @@ class InternalStats {
228
244
  cpu_micros(0),
229
245
  bytes_read_non_output_levels(0),
230
246
  bytes_read_output_level(0),
247
+ bytes_skipped_non_output_levels(0),
248
+ bytes_skipped_output_level(0),
231
249
  bytes_read_blob(0),
232
250
  bytes_written(0),
233
251
  bytes_written_blob(0),
234
252
  bytes_moved(0),
235
253
  num_input_files_in_non_output_levels(0),
236
254
  num_input_files_in_output_level(0),
255
+ num_filtered_input_files_in_non_output_levels(0),
256
+ num_filtered_input_files_in_output_level(0),
237
257
  num_output_files(0),
238
258
  num_output_files_blob(0),
239
259
  num_input_records(0),
@@ -251,12 +271,16 @@ class InternalStats {
251
271
  cpu_micros(0),
252
272
  bytes_read_non_output_levels(0),
253
273
  bytes_read_output_level(0),
274
+ bytes_skipped_non_output_levels(0),
275
+ bytes_skipped_output_level(0),
254
276
  bytes_read_blob(0),
255
277
  bytes_written(0),
256
278
  bytes_written_blob(0),
257
279
  bytes_moved(0),
258
280
  num_input_files_in_non_output_levels(0),
259
281
  num_input_files_in_output_level(0),
282
+ num_filtered_input_files_in_non_output_levels(0),
283
+ num_filtered_input_files_in_output_level(0),
260
284
  num_output_files(0),
261
285
  num_output_files_blob(0),
262
286
  num_input_records(0),
@@ -280,6 +304,8 @@ class InternalStats {
280
304
  cpu_micros(c.cpu_micros),
281
305
  bytes_read_non_output_levels(c.bytes_read_non_output_levels),
282
306
  bytes_read_output_level(c.bytes_read_output_level),
307
+ bytes_skipped_non_output_levels(c.bytes_skipped_non_output_levels),
308
+ bytes_skipped_output_level(c.bytes_skipped_output_level),
283
309
  bytes_read_blob(c.bytes_read_blob),
284
310
  bytes_written(c.bytes_written),
285
311
  bytes_written_blob(c.bytes_written_blob),
@@ -287,6 +313,10 @@ class InternalStats {
287
313
  num_input_files_in_non_output_levels(
288
314
  c.num_input_files_in_non_output_levels),
289
315
  num_input_files_in_output_level(c.num_input_files_in_output_level),
316
+ num_filtered_input_files_in_non_output_levels(
317
+ c.num_filtered_input_files_in_non_output_levels),
318
+ num_filtered_input_files_in_output_level(
319
+ c.num_filtered_input_files_in_output_level),
290
320
  num_output_files(c.num_output_files),
291
321
  num_output_files_blob(c.num_output_files_blob),
292
322
  num_input_records(c.num_input_records),
@@ -304,6 +334,8 @@ class InternalStats {
304
334
  cpu_micros = c.cpu_micros;
305
335
  bytes_read_non_output_levels = c.bytes_read_non_output_levels;
306
336
  bytes_read_output_level = c.bytes_read_output_level;
337
+ bytes_skipped_non_output_levels = c.bytes_skipped_non_output_levels;
338
+ bytes_skipped_output_level = c.bytes_skipped_output_level;
307
339
  bytes_read_blob = c.bytes_read_blob;
308
340
  bytes_written = c.bytes_written;
309
341
  bytes_written_blob = c.bytes_written_blob;
@@ -311,6 +343,10 @@ class InternalStats {
311
343
  num_input_files_in_non_output_levels =
312
344
  c.num_input_files_in_non_output_levels;
313
345
  num_input_files_in_output_level = c.num_input_files_in_output_level;
346
+ num_filtered_input_files_in_non_output_levels =
347
+ c.num_filtered_input_files_in_non_output_levels;
348
+ num_filtered_input_files_in_output_level =
349
+ c.num_filtered_input_files_in_output_level;
314
350
  num_output_files = c.num_output_files;
315
351
  num_output_files_blob = c.num_output_files_blob;
316
352
  num_input_records = c.num_input_records;
@@ -330,12 +366,16 @@ class InternalStats {
330
366
  this->cpu_micros = 0;
331
367
  this->bytes_read_non_output_levels = 0;
332
368
  this->bytes_read_output_level = 0;
369
+ this->bytes_skipped_non_output_levels = 0;
370
+ this->bytes_skipped_output_level = 0;
333
371
  this->bytes_read_blob = 0;
334
372
  this->bytes_written = 0;
335
373
  this->bytes_written_blob = 0;
336
374
  this->bytes_moved = 0;
337
375
  this->num_input_files_in_non_output_levels = 0;
338
376
  this->num_input_files_in_output_level = 0;
377
+ this->num_filtered_input_files_in_non_output_levels = 0;
378
+ this->num_filtered_input_files_in_output_level = 0;
339
379
  this->num_output_files = 0;
340
380
  this->num_output_files_blob = 0;
341
381
  this->num_input_records = 0;
@@ -353,6 +393,9 @@ class InternalStats {
353
393
  this->cpu_micros += c.cpu_micros;
354
394
  this->bytes_read_non_output_levels += c.bytes_read_non_output_levels;
355
395
  this->bytes_read_output_level += c.bytes_read_output_level;
396
+ this->bytes_skipped_non_output_levels +=
397
+ c.bytes_skipped_non_output_levels;
398
+ this->bytes_skipped_output_level += c.bytes_skipped_output_level;
356
399
  this->bytes_read_blob += c.bytes_read_blob;
357
400
  this->bytes_written += c.bytes_written;
358
401
  this->bytes_written_blob += c.bytes_written_blob;
@@ -361,6 +404,10 @@ class InternalStats {
361
404
  c.num_input_files_in_non_output_levels;
362
405
  this->num_input_files_in_output_level +=
363
406
  c.num_input_files_in_output_level;
407
+ this->num_filtered_input_files_in_non_output_levels +=
408
+ c.num_filtered_input_files_in_non_output_levels;
409
+ this->num_filtered_input_files_in_output_level +=
410
+ c.num_filtered_input_files_in_output_level;
364
411
  this->num_output_files += c.num_output_files;
365
412
  this->num_output_files_blob += c.num_output_files_blob;
366
413
  this->num_input_records += c.num_input_records;
@@ -387,6 +434,9 @@ class InternalStats {
387
434
  this->cpu_micros -= c.cpu_micros;
388
435
  this->bytes_read_non_output_levels -= c.bytes_read_non_output_levels;
389
436
  this->bytes_read_output_level -= c.bytes_read_output_level;
437
+ this->bytes_skipped_non_output_levels -=
438
+ c.bytes_skipped_non_output_levels;
439
+ this->bytes_skipped_output_level -= c.bytes_skipped_output_level;
390
440
  this->bytes_read_blob -= c.bytes_read_blob;
391
441
  this->bytes_written -= c.bytes_written;
392
442
  this->bytes_written_blob -= c.bytes_written_blob;
@@ -395,6 +445,10 @@ class InternalStats {
395
445
  c.num_input_files_in_non_output_levels;
396
446
  this->num_input_files_in_output_level -=
397
447
  c.num_input_files_in_output_level;
448
+ this->num_filtered_input_files_in_non_output_levels -=
449
+ c.num_filtered_input_files_in_non_output_levels;
450
+ this->num_filtered_input_files_in_output_level -=
451
+ c.num_filtered_input_files_in_output_level;
398
452
  this->num_output_files -= c.num_output_files;
399
453
  this->num_output_files_blob -= c.num_output_files_blob;
400
454
  this->num_input_records -= c.num_input_records;
@@ -191,7 +191,7 @@ struct JobContext {
191
191
  std::vector<std::string> manifest_delete_files;
192
192
 
193
193
  // a list of memtables to be free
194
- autovector<MemTable*> memtables_to_free;
194
+ autovector<ReadOnlyMemTable*> memtables_to_free;
195
195
 
196
196
  // contexts for installing superversions for multiple column families
197
197
  std::vector<SuperVersionContext> superversion_contexts;
@@ -313,11 +313,11 @@ bool Reader::ReadRecord(Slice* record, std::string* scratch,
313
313
  break;
314
314
 
315
315
  default: {
316
- char buf[40];
317
- snprintf(buf, sizeof(buf), "unknown record type %u", record_type);
316
+ std::string reason =
317
+ "unknown record type " + std::to_string(record_type);
318
318
  ReportCorruption(
319
319
  (fragment.size() + (in_fragmented_record ? scratch->size() : 0)),
320
- buf);
320
+ reason.c_str());
321
321
  in_fragmented_record = false;
322
322
  scratch->clear();
323
323
  break;
@@ -781,12 +781,11 @@ bool FragmentBufferedReader::ReadRecord(Slice* record, std::string* scratch,
781
781
  break;
782
782
 
783
783
  default: {
784
- char buf[40];
785
- snprintf(buf, sizeof(buf), "unknown record type %u",
786
- fragment_type_or_err);
784
+ std::string reason =
785
+ "unknown record type " + std::to_string(fragment_type_or_err);
787
786
  ReportCorruption(
788
787
  fragment.size() + (in_fragmented_record_ ? fragments_.size() : 0),
789
- buf);
788
+ reason.c_str());
790
789
  in_fragmented_record_ = false;
791
790
  fragments_.clear();
792
791
  break;
@@ -0,0 +1,47 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ //
3
+ // This source code is licensed under both the GPLv2 (found in the
4
+ // COPYING file in the root directory) and Apache 2.0 License
5
+ // (found in the LICENSE.Apache file in the root directory).
6
+
7
+ #include "db/manifest_ops.h"
8
+
9
+ #include "file/filename.h"
10
+
11
+ namespace ROCKSDB_NAMESPACE {
12
+
13
+ Status GetCurrentManifestPath(const std::string& dbname, FileSystem* fs,
14
+ bool is_retry, std::string* manifest_path,
15
+ uint64_t* manifest_file_number) {
16
+ assert(fs != nullptr);
17
+ assert(manifest_path != nullptr);
18
+ assert(manifest_file_number != nullptr);
19
+
20
+ IOOptions opts;
21
+ std::string fname;
22
+ if (is_retry) {
23
+ opts.verify_and_reconstruct_read = true;
24
+ }
25
+ Status s = ReadFileToString(fs, CurrentFileName(dbname), opts, &fname);
26
+ if (!s.ok()) {
27
+ return s;
28
+ }
29
+ if (fname.empty() || fname.back() != '\n') {
30
+ return Status::Corruption("CURRENT file does not end with newline");
31
+ }
32
+ // remove the trailing '\n'
33
+ fname.resize(fname.size() - 1);
34
+ FileType type;
35
+ bool parse_ok = ParseFileName(fname, manifest_file_number, &type);
36
+ if (!parse_ok || type != kDescriptorFile) {
37
+ return Status::Corruption("CURRENT file corrupted");
38
+ }
39
+ *manifest_path = dbname;
40
+ if (dbname.back() != '/') {
41
+ manifest_path->push_back('/');
42
+ }
43
+ manifest_path->append(fname);
44
+ return Status::OK();
45
+ }
46
+
47
+ } // namespace ROCKSDB_NAMESPACE
@@ -0,0 +1,20 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ //
3
+ // This source code is licensed under both the GPLv2 (found in the
4
+ // COPYING file in the root directory) and Apache 2.0 License
5
+ // (found in the LICENSE.Apache file in the root directory).
6
+
7
+ #pragma once
8
+ #include <cassert>
9
+
10
+ #include "rocksdb/env.h"
11
+
12
+ namespace ROCKSDB_NAMESPACE {
13
+
14
+ // Parameter is_retry=true sets the verify_and_reconstruct_read flag.
15
+ // It comes handy when caller intends to re-read the data with much stronger
16
+ // data integrity checking - e.g. in case of a perceived file corruption.
17
+ Status GetCurrentManifestPath(const std::string& dbname, FileSystem* fs,
18
+ bool is_retry, std::string* manifest_path,
19
+ uint64_t* manifest_file_number);
20
+ } // namespace ROCKSDB_NAMESPACE
@@ -79,7 +79,6 @@ MemTable::MemTable(const InternalKeyComparator& cmp,
79
79
  SequenceNumber latest_seq, uint32_t column_family_id)
80
80
  : comparator_(cmp),
81
81
  moptions_(ioptions, mutable_cf_options),
82
- refs_(0),
83
82
  kArenaBlockSize(Arena::OptimizeBlockSize(moptions_.arena_block_size)),
84
83
  mem_tracker_(write_buffer_manager),
85
84
  arena_(moptions_.arena_block_size,
@@ -101,13 +100,9 @@ MemTable::MemTable(const InternalKeyComparator& cmp,
101
100
  num_deletes_(0),
102
101
  num_range_deletes_(0),
103
102
  write_buffer_size_(mutable_cf_options.write_buffer_size),
104
- flush_in_progress_(false),
105
- flush_completed_(false),
106
- file_number_(0),
107
103
  first_seqno_(0),
108
104
  earliest_seqno_(latest_seq),
109
105
  creation_seq_(latest_seq),
110
- mem_next_logfile_number_(0),
111
106
  min_prep_log_referenced_(0),
112
107
  locks_(moptions_.inplace_update_support
113
108
  ? moptions_.inplace_update_num_locks
@@ -118,7 +113,6 @@ MemTable::MemTable(const InternalKeyComparator& cmp,
118
113
  insert_with_hint_prefix_extractor_(
119
114
  ioptions.memtable_insert_with_hint_prefix_extractor.get()),
120
115
  oldest_key_time_(std::numeric_limits<uint64_t>::max()),
121
- atomic_flush_seqno_(kMaxSequenceNumber),
122
116
  approximate_memory_usage_(0),
123
117
  memtable_max_range_deletions_(
124
118
  mutable_cf_options.memtable_max_range_deletions) {
@@ -605,7 +599,7 @@ class MemTableIterator : public InternalIterator {
605
599
  InternalIterator* MemTable::NewIterator(
606
600
  const ReadOptions& read_options,
607
601
  UnownedPtr<const SeqnoToTimeMapping> seqno_to_time_mapping, Arena* arena,
608
- const SliceTransform* prefix_extractor) {
602
+ const SliceTransform* prefix_extractor, bool /*for_flush*/) {
609
603
  assert(arena != nullptr);
610
604
  auto mem = arena->AllocateAligned(sizeof(MemTableIterator));
611
605
  return new (mem)
@@ -613,6 +607,135 @@ InternalIterator* MemTable::NewIterator(
613
607
  seqno_to_time_mapping, arena, prefix_extractor);
614
608
  }
615
609
 
610
+ // An iterator wrapper that wraps a MemTableIterator and logically strips each
611
+ // key's user-defined timestamp.
612
+ class TimestampStrippingIterator : public InternalIterator {
613
+ public:
614
+ TimestampStrippingIterator(
615
+ MemTableIterator::Kind kind, const MemTable& memtable,
616
+ const ReadOptions& read_options,
617
+ UnownedPtr<const SeqnoToTimeMapping> seqno_to_time_mapping, Arena* arena,
618
+ const SliceTransform* cf_prefix_extractor, size_t ts_sz)
619
+ : arena_mode_(arena != nullptr), kind_(kind), ts_sz_(ts_sz) {
620
+ assert(ts_sz_ != 0);
621
+ void* mem = arena ? arena->AllocateAligned(sizeof(MemTableIterator)) :
622
+ operator new(sizeof(MemTableIterator));
623
+ iter_ = new (mem)
624
+ MemTableIterator(kind, memtable, read_options, seqno_to_time_mapping,
625
+ arena, cf_prefix_extractor);
626
+ }
627
+
628
+ // No copying allowed
629
+ TimestampStrippingIterator(const TimestampStrippingIterator&) = delete;
630
+ void operator=(const TimestampStrippingIterator&) = delete;
631
+
632
+ ~TimestampStrippingIterator() override {
633
+ if (arena_mode_) {
634
+ iter_->~MemTableIterator();
635
+ } else {
636
+ delete iter_;
637
+ }
638
+ }
639
+
640
+ void SetPinnedItersMgr(PinnedIteratorsManager* pinned_iters_mgr) override {
641
+ iter_->SetPinnedItersMgr(pinned_iters_mgr);
642
+ }
643
+
644
+ bool Valid() const override { return iter_->Valid(); }
645
+ void Seek(const Slice& k) override {
646
+ iter_->Seek(k);
647
+ UpdateKeyAndValueBuffer();
648
+ }
649
+ void SeekForPrev(const Slice& k) override {
650
+ iter_->SeekForPrev(k);
651
+ UpdateKeyAndValueBuffer();
652
+ }
653
+ void SeekToFirst() override {
654
+ iter_->SeekToFirst();
655
+ UpdateKeyAndValueBuffer();
656
+ }
657
+ void SeekToLast() override {
658
+ iter_->SeekToLast();
659
+ UpdateKeyAndValueBuffer();
660
+ }
661
+ void Next() override {
662
+ iter_->Next();
663
+ UpdateKeyAndValueBuffer();
664
+ }
665
+ bool NextAndGetResult(IterateResult* result) override {
666
+ iter_->Next();
667
+ UpdateKeyAndValueBuffer();
668
+ bool is_valid = Valid();
669
+ if (is_valid) {
670
+ result->key = key();
671
+ result->bound_check_result = IterBoundCheck::kUnknown;
672
+ result->value_prepared = true;
673
+ }
674
+ return is_valid;
675
+ }
676
+ void Prev() override {
677
+ iter_->Prev();
678
+ UpdateKeyAndValueBuffer();
679
+ }
680
+ Slice key() const override {
681
+ assert(Valid());
682
+ return key_buf_;
683
+ }
684
+
685
+ uint64_t write_unix_time() const override { return iter_->write_unix_time(); }
686
+ Slice value() const override {
687
+ if (kind_ == MemTableIterator::Kind::kRangeDelEntries) {
688
+ return value_buf_;
689
+ }
690
+ return iter_->value();
691
+ }
692
+ Status status() const override { return iter_->status(); }
693
+ bool IsKeyPinned() const override {
694
+ // Key is only in a buffer that is updated in each iteration.
695
+ return false;
696
+ }
697
+ bool IsValuePinned() const override {
698
+ if (kind_ == MemTableIterator::Kind::kRangeDelEntries) {
699
+ return false;
700
+ }
701
+ return iter_->IsValuePinned();
702
+ }
703
+
704
+ private:
705
+ void UpdateKeyAndValueBuffer() {
706
+ key_buf_.clear();
707
+ if (kind_ == MemTableIterator::Kind::kRangeDelEntries) {
708
+ value_buf_.clear();
709
+ }
710
+ if (!Valid()) {
711
+ return;
712
+ }
713
+ Slice original_key = iter_->key();
714
+ ReplaceInternalKeyWithMinTimestamp(&key_buf_, original_key, ts_sz_);
715
+ if (kind_ == MemTableIterator::Kind::kRangeDelEntries) {
716
+ Slice original_value = iter_->value();
717
+ AppendUserKeyWithMinTimestamp(&value_buf_, original_value, ts_sz_);
718
+ }
719
+ }
720
+ bool arena_mode_;
721
+ MemTableIterator::Kind kind_;
722
+ size_t ts_sz_;
723
+ MemTableIterator* iter_;
724
+ std::string key_buf_;
725
+ std::string value_buf_;
726
+ };
727
+
728
+ InternalIterator* MemTable::NewTimestampStrippingIterator(
729
+ const ReadOptions& read_options,
730
+ UnownedPtr<const SeqnoToTimeMapping> seqno_to_time_mapping, Arena* arena,
731
+ const SliceTransform* prefix_extractor, size_t ts_sz) {
732
+ assert(arena != nullptr);
733
+ auto mem = arena->AllocateAligned(sizeof(TimestampStrippingIterator));
734
+ return new (mem) TimestampStrippingIterator(
735
+ MemTableIterator::kPointEntries, *this, read_options,
736
+ seqno_to_time_mapping, arena, prefix_extractor, ts_sz);
737
+ }
738
+
616
739
  FragmentedRangeTombstoneIterator* MemTable::NewRangeTombstoneIterator(
617
740
  const ReadOptions& read_options, SequenceNumber read_seq,
618
741
  bool immutable_memtable) {
@@ -624,6 +747,30 @@ FragmentedRangeTombstoneIterator* MemTable::NewRangeTombstoneIterator(
624
747
  immutable_memtable);
625
748
  }
626
749
 
750
+ FragmentedRangeTombstoneIterator*
751
+ MemTable::NewTimestampStrippingRangeTombstoneIterator(
752
+ const ReadOptions& read_options, SequenceNumber read_seq, size_t ts_sz) {
753
+ if (read_options.ignore_range_deletions ||
754
+ is_range_del_table_empty_.load(std::memory_order_relaxed)) {
755
+ return nullptr;
756
+ }
757
+ if (!timestamp_stripping_fragmented_range_tombstone_list_) {
758
+ // TODO: plumb Env::IOActivity, Env::IOPriority
759
+ auto* unfragmented_iter = new TimestampStrippingIterator(
760
+ MemTableIterator::kRangeDelEntries, *this, ReadOptions(),
761
+ /*seqno_to_time_mapping*/ nullptr, /* arena */ nullptr,
762
+ /* prefix_extractor */ nullptr, ts_sz);
763
+
764
+ timestamp_stripping_fragmented_range_tombstone_list_ =
765
+ std::make_unique<FragmentedRangeTombstoneList>(
766
+ std::unique_ptr<InternalIterator>(unfragmented_iter),
767
+ comparator_.comparator);
768
+ }
769
+ return new FragmentedRangeTombstoneIterator(
770
+ timestamp_stripping_fragmented_range_tombstone_list_.get(),
771
+ comparator_.comparator, read_seq, read_options.timestamp);
772
+ }
773
+
627
774
  FragmentedRangeTombstoneIterator* MemTable::NewRangeTombstoneIteratorInternal(
628
775
  const ReadOptions& read_options, SequenceNumber read_seq,
629
776
  bool immutable_memtable) {
@@ -679,8 +826,8 @@ port::RWMutex* MemTable::GetLock(const Slice& key) {
679
826
  return &locks_[GetSliceRangedNPHash(key, locks_.size())];
680
827
  }
681
828
 
682
- MemTable::MemTableStats MemTable::ApproximateStats(const Slice& start_ikey,
683
- const Slice& end_ikey) {
829
+ ReadOnlyMemTable::MemTableStats MemTable::ApproximateStats(
830
+ const Slice& start_ikey, const Slice& end_ikey) {
684
831
  uint64_t entry_count = table_->ApproximateNumEntries(start_ikey, end_ikey);
685
832
  entry_count += range_del_table_->ApproximateNumEntries(start_ikey, end_ikey);
686
833
  if (entry_count == 0) {
@@ -1104,47 +1251,16 @@ static bool SaveValue(void* arg, const char* entry) {
1104
1251
  case kTypeValue:
1105
1252
  case kTypeValuePreferredSeqno: {
1106
1253
  Slice v = GetLengthPrefixedSlice(key_ptr + key_length);
1107
-
1108
1254
  if (type == kTypeValuePreferredSeqno) {
1109
1255
  v = ParsePackedValueForValue(v);
1110
1256
  }
1111
1257
 
1112
- *(s->status) = Status::OK();
1113
-
1114
- if (!s->do_merge) {
1115
- // Preserve the value with the goal of returning it as part of
1116
- // raw merge operands to the user
1117
- // TODO(yanqin) update MergeContext so that timestamps information
1118
- // can also be retained.
1119
-
1120
- merge_context->PushOperand(
1121
- v, s->inplace_update_support == false /* operand_pinned */);
1122
- } else if (*(s->merge_in_progress)) {
1123
- assert(s->do_merge);
1124
-
1125
- if (s->value || s->columns) {
1126
- // `op_failure_scope` (an output parameter) is not provided (set to
1127
- // nullptr) since a failure must be propagated regardless of its
1128
- // value.
1129
- *(s->status) = MergeHelper::TimedFullMerge(
1130
- merge_operator, s->key->user_key(),
1131
- MergeHelper::kPlainBaseValue, v, merge_context->GetOperands(),
1132
- s->logger, s->statistics, s->clock,
1133
- /* update_num_ops_stats */ true, /* op_failure_scope */ nullptr,
1134
- s->value, s->columns);
1135
- }
1136
- } else if (s->value) {
1137
- s->value->assign(v.data(), v.size());
1138
- } else if (s->columns) {
1139
- s->columns->SetPlainValue(v);
1140
- }
1141
-
1258
+ ReadOnlyMemTable::HandleTypeValue(
1259
+ s->key->user_key(), v, s->inplace_update_support == false,
1260
+ s->do_merge, *(s->merge_in_progress), merge_context,
1261
+ s->merge_operator, s->clock, s->statistics, s->logger, s->status,
1262
+ s->value, s->columns, s->is_blob_index);
1142
1263
  *(s->found_final_value) = true;
1143
-
1144
- if (s->is_blob_index != nullptr) {
1145
- *(s->is_blob_index) = false;
1146
- }
1147
-
1148
1264
  return false;
1149
1265
  }
1150
1266
  case kTypeWideColumnEntity: {
@@ -1201,25 +1317,10 @@ static bool SaveValue(void* arg, const char* entry) {
1201
1317
  case kTypeDeletionWithTimestamp:
1202
1318
  case kTypeSingleDeletion:
1203
1319
  case kTypeRangeDeletion: {
1204
- if (*(s->merge_in_progress)) {
1205
- if (s->value || s->columns) {
1206
- // `op_failure_scope` (an output parameter) is not provided (set to
1207
- // nullptr) since a failure must be propagated regardless of its
1208
- // value.
1209
- *(s->status) = MergeHelper::TimedFullMerge(
1210
- merge_operator, s->key->user_key(), MergeHelper::kNoBaseValue,
1211
- merge_context->GetOperands(), s->logger, s->statistics,
1212
- s->clock, /* update_num_ops_stats */ true,
1213
- /* op_failure_scope */ nullptr, s->value, s->columns);
1214
- } else {
1215
- // We have found a final value (a base deletion) and have newer
1216
- // merge operands that we do not intend to merge. Nothing remains
1217
- // to be done so assign status to OK.
1218
- *(s->status) = Status::OK();
1219
- }
1220
- } else {
1221
- *(s->status) = Status::NotFound();
1222
- }
1320
+ ReadOnlyMemTable::HandleTypeDeletion(
1321
+ s->key->user_key(), *(s->merge_in_progress), s->merge_context,
1322
+ s->merge_operator, s->clock, s->statistics, s->logger, s->status,
1323
+ s->value, s->columns);
1223
1324
  *(s->found_final_value) = true;
1224
1325
  return false;
1225
1326
  }