@nxtedition/rocksdb 13.5.9 → 13.5.11

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 (124) hide show
  1. package/deps/rocksdb/rocksdb/BUCK +2 -1
  2. package/deps/rocksdb/rocksdb/CMakeLists.txt +2 -1
  3. package/deps/rocksdb/rocksdb/Makefile +1 -1
  4. package/deps/rocksdb/rocksdb/cache/secondary_cache_adapter.cc +4 -5
  5. package/deps/rocksdb/rocksdb/db/c.cc +13 -0
  6. package/deps/rocksdb/rocksdb/db/c_test.c +0 -12
  7. package/deps/rocksdb/rocksdb/db/compaction/compaction.cc +8 -8
  8. package/deps/rocksdb/rocksdb/db/compaction/compaction.h +2 -3
  9. package/deps/rocksdb/rocksdb/db/compaction/compaction_job.cc +5 -4
  10. package/deps/rocksdb/rocksdb/db/compaction/compaction_job_test.cc +2 -1
  11. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker.cc +10 -10
  12. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker.h +11 -6
  13. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_fifo.cc +10 -16
  14. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_level.cc +2 -4
  15. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_universal.cc +12 -17
  16. package/deps/rocksdb/rocksdb/db/compaction/compaction_service_test.cc +164 -0
  17. package/deps/rocksdb/rocksdb/db/corruption_test.cc +74 -3
  18. package/deps/rocksdb/rocksdb/db/db_encryption_test.cc +39 -4
  19. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.cc +2 -83
  20. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.h +0 -4
  21. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_compaction_flush.cc +11 -11
  22. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_follower.cc +0 -3
  23. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_open.cc +0 -9
  24. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.cc +16 -54
  25. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.h +0 -6
  26. package/deps/rocksdb/rocksdb/db/db_iterator_test.cc +186 -0
  27. package/deps/rocksdb/rocksdb/db/db_secondary_test.cc +3 -40
  28. package/deps/rocksdb/rocksdb/db/db_sst_test.cc +0 -54
  29. package/deps/rocksdb/rocksdb/db/db_test.cc +0 -292
  30. package/deps/rocksdb/rocksdb/db/db_test2.cc +0 -1235
  31. package/deps/rocksdb/rocksdb/db/db_test_util.h +8 -0
  32. package/deps/rocksdb/rocksdb/db/external_sst_file_ingestion_job.cc +11 -4
  33. package/deps/rocksdb/rocksdb/db/log_reader.cc +11 -11
  34. package/deps/rocksdb/rocksdb/db/merge_helper.h +1 -1
  35. package/deps/rocksdb/rocksdb/db/multi_scan.cc +70 -0
  36. package/deps/rocksdb/rocksdb/db/version_set.cc +15 -8
  37. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_test_base.cc +4 -0
  38. package/deps/rocksdb/rocksdb/env/composite_env.cc +4 -0
  39. package/deps/rocksdb/rocksdb/env/env.cc +4 -0
  40. package/deps/rocksdb/rocksdb/env/env_encryption.cc +38 -3
  41. package/deps/rocksdb/rocksdb/env/env_test.cc +36 -1
  42. package/deps/rocksdb/rocksdb/env/fs_posix.cc +20 -4
  43. package/deps/rocksdb/rocksdb/env/io_posix.cc +16 -0
  44. package/deps/rocksdb/rocksdb/env/io_posix.h +3 -0
  45. package/deps/rocksdb/rocksdb/env/mock_env.cc +5 -0
  46. package/deps/rocksdb/rocksdb/file/readahead_raf.cc +4 -0
  47. package/deps/rocksdb/rocksdb/include/rocksdb/advanced_compression.h +33 -6
  48. package/deps/rocksdb/rocksdb/include/rocksdb/c.h +5 -0
  49. package/deps/rocksdb/rocksdb/include/rocksdb/db.h +25 -1
  50. package/deps/rocksdb/rocksdb/include/rocksdb/env.h +10 -0
  51. package/deps/rocksdb/rocksdb/include/rocksdb/env_encryption.h +9 -0
  52. package/deps/rocksdb/rocksdb/include/rocksdb/file_system.h +12 -0
  53. package/deps/rocksdb/rocksdb/include/rocksdb/iterator.h +12 -8
  54. package/deps/rocksdb/rocksdb/include/rocksdb/multi_scan.h +29 -28
  55. package/deps/rocksdb/rocksdb/include/rocksdb/options.h +26 -6
  56. package/deps/rocksdb/rocksdb/include/rocksdb/table.h +9 -0
  57. package/deps/rocksdb/rocksdb/include/rocksdb/tool_hooks.h +3 -0
  58. package/deps/rocksdb/rocksdb/include/rocksdb/user_defined_index.h +142 -0
  59. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/db_ttl.h +2 -0
  60. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/transaction_db.h +2 -2
  61. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/write_batch_with_index.h +2 -0
  62. package/deps/rocksdb/rocksdb/include/rocksdb/version.h +2 -2
  63. package/deps/rocksdb/rocksdb/options/options_helper.h +3 -0
  64. package/deps/rocksdb/rocksdb/options/options_settable_test.cc +2 -0
  65. package/deps/rocksdb/rocksdb/port/win/io_win.cc +20 -0
  66. package/deps/rocksdb/rocksdb/port/win/io_win.h +4 -0
  67. package/deps/rocksdb/rocksdb/src.mk +2 -1
  68. package/deps/rocksdb/rocksdb/table/block_based/block.cc +31 -34
  69. package/deps/rocksdb/rocksdb/table/block_based/block.h +2 -4
  70. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_builder.cc +43 -7
  71. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_factory.cc +6 -0
  72. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_iterator.cc +367 -2
  73. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_iterator.h +69 -23
  74. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.cc +54 -6
  75. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.h +27 -5
  76. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_test.cc +167 -3
  77. package/deps/rocksdb/rocksdb/table/block_based/block_builder.cc +6 -2
  78. package/deps/rocksdb/rocksdb/table/block_based/block_cache.cc +6 -0
  79. package/deps/rocksdb/rocksdb/table/block_based/block_cache.h +12 -0
  80. package/deps/rocksdb/rocksdb/table/block_based/block_type.h +1 -0
  81. package/deps/rocksdb/rocksdb/table/block_based/filter_policy.cc +0 -3
  82. package/deps/rocksdb/rocksdb/table/block_based/index_builder.h +10 -7
  83. package/deps/rocksdb/rocksdb/table/block_based/user_defined_index_wrapper.h +244 -0
  84. package/deps/rocksdb/rocksdb/table/external_table.cc +1 -1
  85. package/deps/rocksdb/rocksdb/table/format.cc +51 -33
  86. package/deps/rocksdb/rocksdb/table/format.h +1 -1
  87. package/deps/rocksdb/rocksdb/table/sst_file_dumper.cc +13 -8
  88. package/deps/rocksdb/rocksdb/table/sst_file_dumper.h +1 -3
  89. package/deps/rocksdb/rocksdb/table/sst_file_writer.cc +5 -1
  90. package/deps/rocksdb/rocksdb/table/table_test.cc +629 -1
  91. package/deps/rocksdb/rocksdb/test_util/testutil.cc +0 -1
  92. package/deps/rocksdb/rocksdb/test_util/testutil.h +5 -0
  93. package/deps/rocksdb/rocksdb/tools/db_bench_tool.cc +183 -94
  94. package/deps/rocksdb/rocksdb/tools/sst_dump_test.cc +71 -0
  95. package/deps/rocksdb/rocksdb/tools/sst_dump_tool.cc +37 -22
  96. package/deps/rocksdb/rocksdb/util/auto_tune_compressor.cc +308 -0
  97. package/deps/rocksdb/rocksdb/util/auto_tune_compressor.h +189 -0
  98. package/deps/rocksdb/rocksdb/util/cast_util.h +22 -11
  99. package/deps/rocksdb/rocksdb/util/coding.h +4 -3
  100. package/deps/rocksdb/rocksdb/util/compression.cc +2 -0
  101. package/deps/rocksdb/rocksdb/util/compression.h +16 -6
  102. package/deps/rocksdb/rocksdb/util/compression_test.cc +1679 -15
  103. package/deps/rocksdb/rocksdb/util/stop_watch.h +17 -7
  104. package/deps/rocksdb/rocksdb/util/timer_queue_test.cc +17 -3
  105. package/deps/rocksdb/rocksdb/utilities/env_mirror.cc +10 -0
  106. package/deps/rocksdb/rocksdb/utilities/fault_injection_env.cc +5 -0
  107. package/deps/rocksdb/rocksdb/utilities/fault_injection_env.h +2 -0
  108. package/deps/rocksdb/rocksdb/utilities/fault_injection_fs.cc +18 -2
  109. package/deps/rocksdb/rocksdb/utilities/fault_injection_fs.h +22 -3
  110. package/deps/rocksdb/rocksdb/utilities/transactions/lock/point/point_lock_manager.cc +5 -0
  111. package/deps/rocksdb/rocksdb/utilities/transactions/pessimistic_transaction.cc +22 -2
  112. package/deps/rocksdb/rocksdb/utilities/transactions/pessimistic_transaction.h +15 -4
  113. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_test.cc +61 -0
  114. package/deps/rocksdb/rocksdb/utilities/ttl/db_ttl_impl.cc +18 -0
  115. package/deps/rocksdb/rocksdb/utilities/ttl/db_ttl_impl.h +3 -0
  116. package/deps/rocksdb/rocksdb/utilities/ttl/ttl_test.cc +3 -0
  117. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc +9 -3
  118. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index_test.cc +9 -0
  119. package/deps/rocksdb/rocksdb.gyp +15 -1
  120. package/package.json +1 -1
  121. package/prebuilds/darwin-arm64/@nxtedition+rocksdb.node +0 -0
  122. package/prebuilds/linux-x64/@nxtedition+rocksdb.node +0 -0
  123. package/deps/rocksdb/rocksdb/util/auto_skip_compressor.cc +0 -131
  124. package/deps/rocksdb/rocksdb/util/auto_skip_compressor.h +0 -90
@@ -129,6 +129,7 @@ DEFINE_string(
129
129
  "compact1,"
130
130
  "waitforcompaction,"
131
131
  "multireadrandom,"
132
+ "multiscan,"
132
133
  "mixgraph,"
133
134
  "readseq,"
134
135
  "readtorowcache,"
@@ -333,6 +334,13 @@ DEFINE_bool(use_uint64_comparator, false, "use Uint64 user comparator");
333
334
 
334
335
  DEFINE_int64(batch_size, 1, "Batch size");
335
336
 
337
+ DEFINE_int64(multiscan_size, 10,
338
+ "MultiScan size - number of multiscans of size `batch_size`");
339
+
340
+ DEFINE_int64(
341
+ multiscan_stride, 100,
342
+ "The amount of keys between two successive Scan operations in multiscan");
343
+
336
344
  static bool ValidateKeySize(const char* /*flagname*/, int32_t /*value*/) {
337
345
  return true;
338
346
  }
@@ -1290,6 +1298,18 @@ DEFINE_uint32(memtable_op_scan_flush_trigger,
1290
1298
  DEFINE_bool(verify_compression, false,
1291
1299
  "See BlockBasedTableOptions::verify_compression");
1292
1300
 
1301
+ ROCKSDB_NAMESPACE::ToolHooks* hooks_ = nullptr;
1302
+ [[noreturn]] void db_bench_exit(int status) {
1303
+ if (hooks_ == nullptr) {
1304
+ exit(status);
1305
+ }
1306
+
1307
+ hooks_->Exit(status);
1308
+
1309
+ // We should exit here but in case they don't we exit anyway.
1310
+ exit(-1);
1311
+ };
1312
+
1293
1313
  static enum ROCKSDB_NAMESPACE::CompressionType StringToCompressionType(
1294
1314
  const char* ctype) {
1295
1315
  assert(ctype);
@@ -1312,7 +1332,7 @@ static enum ROCKSDB_NAMESPACE::CompressionType StringToCompressionType(
1312
1332
  return ROCKSDB_NAMESPACE::kZSTD;
1313
1333
  } else {
1314
1334
  fprintf(stderr, "Cannot parse compression type '%s'\n", ctype);
1315
- exit(1);
1335
+ db_bench_exit(1);
1316
1336
  }
1317
1337
  }
1318
1338
 
@@ -1332,7 +1352,7 @@ static enum ROCKSDB_NAMESPACE::TieredAdmissionPolicy StringToAdmissionPolicy(
1332
1352
  return ROCKSDB_NAMESPACE::kAdmPolicyAllowAll;
1333
1353
  } else {
1334
1354
  fprintf(stderr, "Cannot parse admission policy %s\n", policy);
1335
- exit(1);
1355
+ db_bench_exit(1);
1336
1356
  }
1337
1357
  }
1338
1358
 
@@ -1871,7 +1891,7 @@ static enum DistributionType StringToDistributionType(const char* ctype) {
1871
1891
  }
1872
1892
 
1873
1893
  fprintf(stdout, "Cannot parse distribution type '%s'\n", ctype);
1874
- exit(1);
1894
+ db_bench_exit(1);
1875
1895
  }
1876
1896
 
1877
1897
  class BaseDistribution {
@@ -2190,7 +2210,8 @@ enum OperationType : unsigned char {
2190
2210
  kUncompress,
2191
2211
  kCrc,
2192
2212
  kHash,
2193
- kOthers
2213
+ kOthers,
2214
+ kMultiScan
2194
2215
  };
2195
2216
 
2196
2217
  static std::unordered_map<OperationType, std::string, std::hash<unsigned char>>
@@ -2199,7 +2220,7 @@ static std::unordered_map<OperationType, std::string, std::hash<unsigned char>>
2199
2220
  {kMerge, "merge"}, {kUpdate, "update"},
2200
2221
  {kCompress, "compress"}, {kCompress, "uncompress"},
2201
2222
  {kCrc, "crc"}, {kHash, "hash"},
2202
- {kOthers, "op"}};
2223
+ {kOthers, "op"}, {kMultiScan, "multiscan"}};
2203
2224
 
2204
2225
  class CombinedStats;
2205
2226
  class Stats {
@@ -2896,11 +2917,11 @@ class Benchmark {
2896
2917
  fprintf(stderr, "Running in NUMA enabled mode.\n");
2897
2918
  #ifndef NUMA
2898
2919
  fprintf(stderr, "NUMA is not defined in the system.\n");
2899
- exit(1);
2920
+ db_bench_exit(1);
2900
2921
  #else
2901
2922
  if (numa_available() == -1) {
2902
2923
  fprintf(stderr, "NUMA is not supported by the system.\n");
2903
- exit(1);
2924
+ db_bench_exit(1);
2904
2925
  }
2905
2926
  #endif
2906
2927
  }
@@ -3102,14 +3123,14 @@ class Benchmark {
3102
3123
  JemallocAllocatorOptions jemalloc_options;
3103
3124
  if (!NewJemallocNodumpAllocator(jemalloc_options, &allocator).ok()) {
3104
3125
  fprintf(stderr, "JemallocNodumpAllocator not supported.\n");
3105
- exit(1);
3126
+ db_bench_exit(1);
3106
3127
  }
3107
3128
  } else if (FLAGS_use_cache_memkind_kmem_allocator) {
3108
3129
  #ifdef MEMKIND
3109
3130
  allocator = std::make_shared<MemkindKmemAllocator>();
3110
3131
  #else
3111
3132
  fprintf(stderr, "Memkind library is not linked with the binary.\n");
3112
- exit(1);
3133
+ db_bench_exit(1);
3113
3134
  #endif
3114
3135
  }
3115
3136
 
@@ -3153,7 +3174,7 @@ class Benchmark {
3153
3174
  stderr,
3154
3175
  "Cannot specify both --secondary_cache_uri and "
3155
3176
  "--use_compressed_secondary_cache when using a non-tiered cache\n");
3156
- exit(1);
3177
+ db_bench_exit(1);
3157
3178
  }
3158
3179
  Status s = SecondaryCache::CreateFromString(
3159
3180
  ConfigOptions(), FLAGS_secondary_cache_uri, &secondary_cache);
@@ -3161,7 +3182,7 @@ class Benchmark {
3161
3182
  fprintf(stderr,
3162
3183
  "No secondary cache registered matching string: %s status=%s\n",
3163
3184
  FLAGS_secondary_cache_uri.c_str(), s.ToString().c_str());
3164
- exit(1);
3185
+ db_bench_exit(1);
3165
3186
  }
3166
3187
  }
3167
3188
 
@@ -3172,11 +3193,11 @@ class Benchmark {
3172
3193
  if (block_cache == nullptr) {
3173
3194
  fprintf(stderr, "No cache registered matching string: %s status=%s\n",
3174
3195
  FLAGS_cache_uri.c_str(), s.ToString().c_str());
3175
- exit(1);
3196
+ db_bench_exit(1);
3176
3197
  }
3177
3198
  } else if (FLAGS_cache_type == "clock_cache") {
3178
3199
  fprintf(stderr, "Old clock cache implementation has been removed.\n");
3179
- exit(1);
3200
+ db_bench_exit(1);
3180
3201
  } else if (EndsWith(FLAGS_cache_type, "hyper_clock_cache")) {
3181
3202
  size_t estimated_entry_charge;
3182
3203
  if (FLAGS_cache_type == "fixed_hyper_clock_cache" ||
@@ -3186,7 +3207,7 @@ class Benchmark {
3186
3207
  estimated_entry_charge = 0;
3187
3208
  } else {
3188
3209
  fprintf(stderr, "Cache type not supported.");
3189
- exit(1);
3210
+ db_bench_exit(1);
3190
3211
  }
3191
3212
  HyperClockCacheOptions opts(FLAGS_cache_size, estimated_entry_charge,
3192
3213
  FLAGS_cache_numshardbits);
@@ -3242,12 +3263,12 @@ class Benchmark {
3242
3263
  }
3243
3264
  } else {
3244
3265
  fprintf(stderr, "Cache type not supported.");
3245
- exit(1);
3266
+ db_bench_exit(1);
3246
3267
  }
3247
3268
 
3248
3269
  if (!block_cache) {
3249
3270
  fprintf(stderr, "Unable to allocate block cache\n");
3250
- exit(1);
3271
+ db_bench_exit(1);
3251
3272
  }
3252
3273
  return block_cache;
3253
3274
  }
@@ -3295,7 +3316,7 @@ class Benchmark {
3295
3316
 
3296
3317
  if (FLAGS_prefix_size > FLAGS_key_size) {
3297
3318
  fprintf(stderr, "prefix size is larger than key size");
3298
- exit(1);
3319
+ db_bench_exit(1);
3299
3320
  }
3300
3321
 
3301
3322
  std::vector<std::string> files;
@@ -3445,7 +3466,7 @@ class Benchmark {
3445
3466
  auto s = DB::OpenForReadOnly(open_options_, truth_db_name, &truth_db.db);
3446
3467
  if (!s.ok()) {
3447
3468
  fprintf(stderr, "open error: %s\n", s.ToString().c_str());
3448
- exit(1);
3469
+ db_bench_exit(1);
3449
3470
  }
3450
3471
  ReadOptions ro;
3451
3472
  ro.total_order_seek = true;
@@ -3475,7 +3496,7 @@ class Benchmark {
3475
3496
 
3476
3497
  void ErrorExit() {
3477
3498
  DeleteDBs();
3478
- exit(1);
3499
+ db_bench_exit(1);
3479
3500
  }
3480
3501
 
3481
3502
  void Run(ToolHooks& hooks) {
@@ -3641,6 +3662,12 @@ class Benchmark {
3641
3662
  fprintf(stderr, "entries_per_batch = %" PRIi64 "\n",
3642
3663
  entries_per_batch_);
3643
3664
  method = &Benchmark::MultiReadRandom;
3665
+ } else if (name == "multiscan") {
3666
+ fprintf(stderr, "multiscan_stride = %" PRIi64 "\n",
3667
+ FLAGS_multiscan_stride);
3668
+ fprintf(stderr, "multiscan_size = %" PRIi64 "\n", FLAGS_multiscan_size);
3669
+ fprintf(stderr, "seek_nexts = %" PRIi32 "\n", FLAGS_seek_nexts);
3670
+ method = &Benchmark::MultiScan;
3644
3671
  } else if (name == "multireadwhilewriting") {
3645
3672
  fprintf(stderr, "entries_per_batch = %" PRIi64 "\n",
3646
3673
  entries_per_batch_);
@@ -3705,7 +3732,7 @@ class Benchmark {
3705
3732
  if (FLAGS_merge_operator.empty()) {
3706
3733
  fprintf(stdout, "%-12s : skipped (--merge_operator is unknown)\n",
3707
3734
  name.c_str());
3708
- exit(1);
3735
+ db_bench_exit(1);
3709
3736
  }
3710
3737
  method = &Benchmark::MergeRandom;
3711
3738
  } else if (name == "randomwithverify") {
@@ -4149,7 +4176,7 @@ class Benchmark {
4149
4176
  thread->stats.FinishedOps(nullptr, nullptr, 1, kOthers);
4150
4177
  }
4151
4178
  if (ptr == nullptr) {
4152
- exit(1); // Disable unused variable warning.
4179
+ db_bench_exit(1); // Disable unused variable warning.
4153
4180
  }
4154
4181
  }
4155
4182
 
@@ -4244,7 +4271,7 @@ class Benchmark {
4244
4271
  }
4245
4272
  fprintf(stderr, "Unable to load options file %s --- %s\n",
4246
4273
  FLAGS_options_file.c_str(), s.ToString().c_str());
4247
- exit(1);
4274
+ db_bench_exit(1);
4248
4275
  }
4249
4276
  return false;
4250
4277
  }
@@ -4316,7 +4343,7 @@ class Benchmark {
4316
4343
  options.comparator = test::Uint64Comparator();
4317
4344
  if (FLAGS_key_size != 8) {
4318
4345
  fprintf(stderr, "Using Uint64 comparator but key size is not 8.\n");
4319
- exit(1);
4346
+ db_bench_exit(1);
4320
4347
  }
4321
4348
  }
4322
4349
  if (FLAGS_use_stderr_info_logger) {
@@ -4350,14 +4377,14 @@ class Benchmark {
4350
4377
  if (!s.ok()) {
4351
4378
  fprintf(stderr, "Could not create memtable factory: %s\n",
4352
4379
  s.ToString().c_str());
4353
- exit(1);
4380
+ db_bench_exit(1);
4354
4381
  } else if ((FLAGS_prefix_size == 0) &&
4355
4382
  (options.memtable_factory->IsInstanceOf("prefix_hash") ||
4356
4383
  options.memtable_factory->IsInstanceOf("hash_linkedlist"))) {
4357
4384
  fprintf(stderr,
4358
4385
  "prefix_size should be non-zero if PrefixHash or "
4359
4386
  "HashLinkedList memtablerep is used\n");
4360
- exit(1);
4387
+ db_bench_exit(1);
4361
4388
  }
4362
4389
  if (FLAGS_use_plain_table) {
4363
4390
  if (!options.memtable_factory->IsInstanceOf("prefix_hash") &&
@@ -4380,12 +4407,12 @@ class Benchmark {
4380
4407
  } else if (FLAGS_use_cuckoo_table) {
4381
4408
  if (FLAGS_cuckoo_hash_ratio > 1 || FLAGS_cuckoo_hash_ratio < 0) {
4382
4409
  fprintf(stderr, "Invalid cuckoo_hash_ratio\n");
4383
- exit(1);
4410
+ db_bench_exit(1);
4384
4411
  }
4385
4412
 
4386
4413
  if (!FLAGS_mmap_read) {
4387
4414
  fprintf(stderr, "cuckoo table format requires mmap read to operate\n");
4388
- exit(1);
4415
+ db_bench_exit(1);
4389
4416
  }
4390
4417
 
4391
4418
  ROCKSDB_NAMESPACE::CuckooTableOptions table_options;
@@ -4401,7 +4428,7 @@ class Benchmark {
4401
4428
  if (FLAGS_prefix_size == 0) {
4402
4429
  fprintf(stderr,
4403
4430
  "prefix_size not assigned when enable use_hash_search \n");
4404
- exit(1);
4431
+ db_bench_exit(1);
4405
4432
  }
4406
4433
  block_based_options.index_type = BlockBasedTableOptions::kHashSearch;
4407
4434
  } else {
@@ -4569,7 +4596,7 @@ class Benchmark {
4569
4596
  if (!rc_status.ok()) {
4570
4597
  fprintf(stderr, "Error initializing read cache, %s\n",
4571
4598
  rc_status.ToString().c_str());
4572
- exit(1);
4599
+ db_bench_exit(1);
4573
4600
  }
4574
4601
  }
4575
4602
 
@@ -4589,7 +4616,7 @@ class Benchmark {
4589
4616
  stderr,
4590
4617
  "Unable to create a standalone blob cache if blob_cache_size "
4591
4618
  "<= 0.\n");
4592
- exit(1);
4619
+ db_bench_exit(1);
4593
4620
  }
4594
4621
  }
4595
4622
  switch (FLAGS_prepopulate_blob_cache) {
@@ -4601,7 +4628,7 @@ class Benchmark {
4601
4628
  break;
4602
4629
  default:
4603
4630
  fprintf(stderr, "Unknown prepopulate blob cache mode\n");
4604
- exit(1);
4631
+ db_bench_exit(1);
4605
4632
  }
4606
4633
 
4607
4634
  fprintf(stdout,
@@ -4629,7 +4656,7 @@ class Benchmark {
4629
4656
  fprintf(stderr, "Insufficient number of fanouts specified %d\n",
4630
4657
  static_cast<int>(
4631
4658
  FLAGS_max_bytes_for_level_multiplier_additional_v.size()));
4632
- exit(1);
4659
+ db_bench_exit(1);
4633
4660
  }
4634
4661
  options.max_bytes_for_level_multiplier_additional =
4635
4662
  FLAGS_max_bytes_for_level_multiplier_additional_v;
@@ -4639,36 +4666,32 @@ class Benchmark {
4639
4666
  FLAGS_level0_file_num_compaction_trigger;
4640
4667
  options.level0_slowdown_writes_trigger =
4641
4668
  FLAGS_level0_slowdown_writes_trigger;
4642
- if (!strcasecmp(FLAGS_compression_manager.c_str(), "none")) {
4669
+ options.compression = FLAGS_compression_type_e;
4670
+ std::shared_ptr<CompressionManagerWrapper> mgr = nullptr;
4671
+ if (!strcasecmp(FLAGS_compression_manager.c_str(), "mixed")) {
4672
+ mgr =
4673
+ std::make_shared<RoundRobinManager>(GetBuiltinV2CompressionManager());
4674
+ } else if (!strcasecmp(FLAGS_compression_manager.c_str(),
4675
+ "costpredictor")) {
4676
+ mgr = CreateCostAwareCompressionManager();
4677
+ } else if (!strcasecmp(FLAGS_compression_manager.c_str(), "autoskip")) {
4678
+ mgr = CreateAutoSkipCompressionManager();
4679
+ } else if (!strcasecmp(FLAGS_compression_manager.c_str(), "none")) {
4643
4680
  options.compression = FLAGS_compression_type_e;
4644
4681
  } else {
4645
- std::shared_ptr<CompressionManagerWrapper> mgr;
4646
- if (!strcasecmp(FLAGS_compression_manager.c_str(), "mixed")) {
4647
- // Need to list zstd in the compression_name table property if it's
4648
- // potentially used by being in the mix (i.e., potentially at least one
4649
- // data block in the table is compressed by zstd). This ensures proper
4650
- // context and dictionary handling, and prevents crashes in older
4651
- // RocksDB versions.
4652
- options.compression = kZSTD;
4653
- options.bottommost_compression = kZSTD;
4654
-
4655
- mgr = std::make_shared<RoundRobinManager>(
4656
- GetBuiltinV2CompressionManager());
4657
- } else if (!strcasecmp(FLAGS_compression_manager.c_str(), "autoskip")) {
4658
- options.compression = FLAGS_compression_type_e;
4659
- if (FLAGS_compression_type_e == kNoCompression) {
4660
- fprintf(stderr,
4661
- "Compression type must not be no Compression when using "
4662
- "autoskip");
4663
- ErrorExit();
4664
- }
4665
- mgr =
4666
- CreateAutoSkipCompressionManager(GetBuiltinV2CompressionManager());
4667
- } else {
4668
- // not defined -> exit with error
4669
- fprintf(stderr, "Requested compression manager not supported");
4670
- ErrorExit();
4671
- }
4682
+ // compression manager is not supported
4683
+ // exit with error
4684
+ fprintf(stderr, "Requested compression manager not supported");
4685
+ ErrorExit();
4686
+ }
4687
+ if (FLAGS_compression_type_e == kNoCompression &&
4688
+ strcasecmp(FLAGS_compression_manager.c_str(), "none")) {
4689
+ fprintf(stderr,
4690
+ "Compression type must not be no Compression when using "
4691
+ "compression manager");
4692
+ ErrorExit();
4693
+ }
4694
+ if (mgr != nullptr) {
4672
4695
  options.compression_manager = mgr;
4673
4696
  }
4674
4697
 
@@ -4732,7 +4755,7 @@ class Benchmark {
4732
4755
  if (!s.ok()) {
4733
4756
  fprintf(stderr, "invalid merge operator[%s]: %s\n",
4734
4757
  FLAGS_merge_operator.c_str(), s.ToString().c_str());
4735
- exit(1);
4758
+ db_bench_exit(1);
4736
4759
  }
4737
4760
  }
4738
4761
  options.max_successive_merges = FLAGS_max_successive_merges;
@@ -4775,7 +4798,7 @@ class Benchmark {
4775
4798
  if (FLAGS_user_timestamp_size > 0) {
4776
4799
  if (FLAGS_user_timestamp_size != 8) {
4777
4800
  fprintf(stderr, "Only 64 bits timestamps are supported.\n");
4778
- exit(1);
4801
+ db_bench_exit(1);
4779
4802
  }
4780
4803
  options.comparator = test::BytewiseComparatorWithU64TsWrapper();
4781
4804
  }
@@ -4803,12 +4826,12 @@ class Benchmark {
4803
4826
 
4804
4827
  if (FLAGS_readonly && FLAGS_transaction_db) {
4805
4828
  fprintf(stderr, "Cannot use readonly flag with transaction_db\n");
4806
- exit(1);
4829
+ db_bench_exit(1);
4807
4830
  }
4808
4831
  if (FLAGS_use_secondary_db &&
4809
4832
  (FLAGS_transaction_db || FLAGS_optimistic_transaction_db)) {
4810
4833
  fprintf(stderr, "Cannot use use_secondary_db flag with transaction_db\n");
4811
- exit(1);
4834
+ db_bench_exit(1);
4812
4835
  }
4813
4836
  options.memtable_protection_bytes_per_key =
4814
4837
  FLAGS_memtable_protection_bytes_per_key;
@@ -4987,7 +5010,7 @@ class Benchmark {
4987
5010
  }
4988
5011
  if (sum != 100) {
4989
5012
  fprintf(stderr, "column_family_distribution items must sum to 100\n");
4990
- exit(1);
5013
+ db_bench_exit(1);
4991
5014
  }
4992
5015
  if (cfh_idx_to_prob.size() != num_hot) {
4993
5016
  fprintf(stderr,
@@ -4995,7 +5018,7 @@ class Benchmark {
4995
5018
  " column_family_distribution items; expected "
4996
5019
  "%" ROCKSDB_PRIszt "\n",
4997
5020
  cfh_idx_to_prob.size(), num_hot);
4998
- exit(1);
5021
+ db_bench_exit(1);
4999
5022
  }
5000
5023
  }
5001
5024
  if (FLAGS_readonly) {
@@ -5109,7 +5132,7 @@ class Benchmark {
5109
5132
  }
5110
5133
  if (!s.ok()) {
5111
5134
  fprintf(stderr, "open error: %s\n", s.ToString().c_str());
5112
- exit(1);
5135
+ db_bench_exit(1);
5113
5136
  }
5114
5137
  }
5115
5138
 
@@ -5708,7 +5731,7 @@ class Benchmark {
5708
5731
  if (sorted_runs[i].size() < num_levels - 1) {
5709
5732
  fprintf(stderr, "n is too small to fill %" ROCKSDB_PRIszt " levels\n",
5710
5733
  num_levels);
5711
- exit(1);
5734
+ db_bench_exit(1);
5712
5735
  }
5713
5736
  }
5714
5737
  for (size_t i = 0; i < num_db; i++) {
@@ -5763,7 +5786,7 @@ class Benchmark {
5763
5786
  if (sorted_runs[i].size() < num_levels) {
5764
5787
  fprintf(stderr, "n is too small to fill %" ROCKSDB_PRIszt " levels\n",
5765
5788
  num_levels);
5766
- exit(1);
5789
+ db_bench_exit(1);
5767
5790
  }
5768
5791
  }
5769
5792
  for (size_t i = 0; i < num_db; i++) {
@@ -6373,6 +6396,71 @@ class Benchmark {
6373
6396
  thread->stats.AddMessage(msg);
6374
6397
  }
6375
6398
 
6399
+ void MultiScan(ThreadState* thread) {
6400
+ const int64_t scan_size = FLAGS_seek_nexts ? FLAGS_seek_nexts : 50;
6401
+ const int64_t readahead =
6402
+ FLAGS_readahead_size ? FLAGS_readahead_size : 1024 * 24;
6403
+ const int64_t multiscan_size = FLAGS_multiscan_size;
6404
+ auto count_hist = std::make_shared<HistogramImpl>();
6405
+ ReadOptions options = read_options_;
6406
+
6407
+ int64_t multiscans_done = 0;
6408
+
6409
+ options.async_io = true;
6410
+ options.readahead_size = readahead;
6411
+
6412
+ Duration duration(FLAGS_duration, reads_);
6413
+ while (!duration.Done(1)) {
6414
+ DB* db = SelectDB(thread);
6415
+ std::vector<ScanOptions> opts;
6416
+ std::vector<std::unique_ptr<const char[]>> guards;
6417
+ opts.reserve(multiscan_size);
6418
+ // We create 1 random start, and then multiscan will start from that
6419
+ // random start point And create a set of scans of `scan_size` in size
6420
+ // with `multiscan_stride` space between each scan.
6421
+ uint64_t range = static_cast<uint64_t>(FLAGS_num) -
6422
+ ((scan_size + FLAGS_multiscan_stride) * multiscan_size);
6423
+ uint64_t start_key = thread->rand.Uniform(range);
6424
+ for (int64_t i = 0; i < multiscan_size; i++) {
6425
+ std::unique_ptr<const char[]> skey_guard;
6426
+ Slice skey = AllocateKey(&skey_guard);
6427
+ guards.push_back(std::move(skey_guard));
6428
+ std::unique_ptr<const char[]> ekey_guard;
6429
+ Slice ekey = AllocateKey(&ekey_guard);
6430
+ guards.push_back(std::move(ekey_guard));
6431
+
6432
+ GenerateKeyFromInt(start_key, FLAGS_num, &skey);
6433
+ uint64_t end_key = start_key + scan_size;
6434
+ GenerateKeyFromInt(end_key, FLAGS_num, &ekey);
6435
+
6436
+ opts.emplace_back(skey, ekey);
6437
+ start_key += scan_size + FLAGS_multiscan_stride;
6438
+ }
6439
+
6440
+ auto iter =
6441
+ db->NewMultiScan(read_options_, db->DefaultColumnFamily(), opts);
6442
+ for (auto rng : *iter) {
6443
+ size_t keys = 0;
6444
+ for (auto it __attribute__((__unused__)) : rng) {
6445
+ keys++;
6446
+ }
6447
+ assert(keys > 0);
6448
+ }
6449
+
6450
+ if (thread->shared->read_rate_limiter.get() != nullptr) {
6451
+ thread->shared->read_rate_limiter->Request(
6452
+ 1, Env::IO_HIGH, nullptr /* stats */, RateLimiter::OpType::kRead);
6453
+ }
6454
+
6455
+ thread->stats.FinishedOps(nullptr, db, 1, kMultiScan);
6456
+ multiscans_done += 1;
6457
+ }
6458
+
6459
+ char msg[100];
6460
+ snprintf(msg, sizeof(msg), "(multscans:%" PRIu64 ")", multiscans_done);
6461
+ thread->stats.AddMessage(msg);
6462
+ }
6463
+
6376
6464
  void ApproximateMemtableStats(ThreadState* thread) {
6377
6465
  const size_t batch_size = entries_per_batch_;
6378
6466
  std::unique_ptr<const char[]> skey_guard;
@@ -7072,7 +7160,7 @@ class Benchmark {
7072
7160
  thread->stats.FinishedOps(nullptr, db, entries_per_batch_, kDelete);
7073
7161
  if (!s.ok()) {
7074
7162
  fprintf(stderr, "del error: %s\n", s.ToString().c_str());
7075
- exit(1);
7163
+ db_bench_exit(1);
7076
7164
  }
7077
7165
  i += entries_per_batch_;
7078
7166
  }
@@ -7188,7 +7276,7 @@ class Benchmark {
7188
7276
 
7189
7277
  if (!s.ok()) {
7190
7278
  fprintf(stderr, "put or merge error: %s\n", s.ToString().c_str());
7191
- exit(1);
7279
+ db_bench_exit(1);
7192
7280
  }
7193
7281
  bytes += key.size() + val.size() + user_timestamp_size_;
7194
7282
  thread->stats.FinishedOps(&db_, db_.db, 1, kWrite);
@@ -7215,7 +7303,7 @@ class Benchmark {
7215
7303
  &expanded_keys[offset]);
7216
7304
  if (!db->Delete(write_options_, expanded_keys[offset]).ok()) {
7217
7305
  fprintf(stderr, "delete error: %s\n", s.ToString().c_str());
7218
- exit(1);
7306
+ db_bench_exit(1);
7219
7307
  }
7220
7308
  }
7221
7309
  } else {
@@ -7226,7 +7314,7 @@ class Benchmark {
7226
7314
  begin_key, end_key)
7227
7315
  .ok()) {
7228
7316
  fprintf(stderr, "deleterange error: %s\n", s.ToString().c_str());
7229
- exit(1);
7317
+ db_bench_exit(1);
7230
7318
  }
7231
7319
  }
7232
7320
  thread->stats.FinishedOps(&db_, db_.db, 1, kWrite);
@@ -7460,7 +7548,7 @@ class Benchmark {
7460
7548
  Status s = PutMany(db, write_options_, key, gen.Generate());
7461
7549
  if (!s.ok()) {
7462
7550
  fprintf(stderr, "putmany error: %s\n", s.ToString().c_str());
7463
- exit(1);
7551
+ db_bench_exit(1);
7464
7552
  }
7465
7553
  put_weight--;
7466
7554
  puts_done++;
@@ -7469,7 +7557,7 @@ class Benchmark {
7469
7557
  Status s = DeleteMany(db, write_options_, key);
7470
7558
  if (!s.ok()) {
7471
7559
  fprintf(stderr, "deletemany error: %s\n", s.ToString().c_str());
7472
- exit(1);
7560
+ db_bench_exit(1);
7473
7561
  }
7474
7562
  delete_weight--;
7475
7563
  deletes_done++;
@@ -7613,7 +7701,7 @@ class Benchmark {
7613
7701
  }
7614
7702
  if (!s.ok()) {
7615
7703
  fprintf(stderr, "put error: %s\n", s.ToString().c_str());
7616
- exit(1);
7704
+ db_bench_exit(1);
7617
7705
  }
7618
7706
  bytes += key.size() + val.size() + user_timestamp_size_;
7619
7707
  thread->stats.FinishedOps(nullptr, db, 1, kUpdate);
@@ -7660,7 +7748,7 @@ class Benchmark {
7660
7748
  } else if (!status.IsNotFound()) {
7661
7749
  fprintf(stderr, "Get returned an error: %s\n",
7662
7750
  status.ToString().c_str());
7663
- exit(1);
7751
+ db_bench_exit(1);
7664
7752
  }
7665
7753
 
7666
7754
  Slice value =
@@ -7798,7 +7886,7 @@ class Benchmark {
7798
7886
 
7799
7887
  if (!s.ok()) {
7800
7888
  fprintf(stderr, "merge error: %s\n", s.ToString().c_str());
7801
- exit(1);
7889
+ db_bench_exit(1);
7802
7890
  }
7803
7891
  bytes += key.size() + val.size();
7804
7892
  thread->stats.FinishedOps(nullptr, db_with_cfh->db, 1, kMerge);
@@ -7840,7 +7928,7 @@ class Benchmark {
7840
7928
  Status s = db->Merge(write_options_, key, gen.Generate());
7841
7929
  if (!s.ok()) {
7842
7930
  fprintf(stderr, "merge error: %s\n", s.ToString().c_str());
7843
- exit(1);
7931
+ db_bench_exit(1);
7844
7932
  }
7845
7933
  num_merges++;
7846
7934
  thread->stats.FinishedOps(nullptr, db, 1, kMerge);
@@ -8032,7 +8120,7 @@ class Benchmark {
8032
8120
  Status s = db->VerifyChecksum(ro);
8033
8121
  if (!s.ok()) {
8034
8122
  fprintf(stderr, "VerifyChecksum() failed: %s\n", s.ToString().c_str());
8035
- exit(1);
8123
+ db_bench_exit(1);
8036
8124
  }
8037
8125
  }
8038
8126
 
@@ -8049,7 +8137,7 @@ class Benchmark {
8049
8137
  if (!s.ok()) {
8050
8138
  fprintf(stderr, "VerifyFileChecksums() failed: %s\n",
8051
8139
  s.ToString().c_str());
8052
- exit(1);
8140
+ db_bench_exit(1);
8053
8141
  }
8054
8142
  }
8055
8143
 
@@ -8173,7 +8261,7 @@ class Benchmark {
8173
8261
  }
8174
8262
  if (!s.ok()) {
8175
8263
  fprintf(stderr, "Operation failed: %s\n", s.ToString().c_str());
8176
- exit(1);
8264
+ db_bench_exit(1);
8177
8265
  }
8178
8266
  }
8179
8267
 
@@ -8211,7 +8299,7 @@ class Benchmark {
8211
8299
 
8212
8300
  if (!s.ok()) {
8213
8301
  fprintf(stderr, "Operation failed: %s\n", s.ToString().c_str());
8214
- exit(1);
8302
+ db_bench_exit(1);
8215
8303
  }
8216
8304
 
8217
8305
  thread->stats.FinishedOps(nullptr, db, 1, kOthers);
@@ -8518,7 +8606,7 @@ class Benchmark {
8518
8606
 
8519
8607
  if (!s.ok()) {
8520
8608
  fprintf(stderr, "Flush failed: %s\n", s.ToString().c_str());
8521
- exit(1);
8609
+ db_bench_exit(1);
8522
8610
  }
8523
8611
  } else {
8524
8612
  for (const auto& db_with_cfh : multi_dbs_) {
@@ -8532,7 +8620,7 @@ class Benchmark {
8532
8620
 
8533
8621
  if (!s.ok()) {
8534
8622
  fprintf(stderr, "Flush failed: %s\n", s.ToString().c_str());
8535
- exit(1);
8623
+ db_bench_exit(1);
8536
8624
  }
8537
8625
  }
8538
8626
  }
@@ -8648,7 +8736,7 @@ class Benchmark {
8648
8736
  "Encountered an error creating a TraceReader from the trace file. "
8649
8737
  "Error: %s\n",
8650
8738
  s.ToString().c_str());
8651
- exit(1);
8739
+ db_bench_exit(1);
8652
8740
  }
8653
8741
  std::unique_ptr<Replayer> replayer;
8654
8742
  s = db_with_cfh->db->NewDefaultReplayer(db_with_cfh->cfh,
@@ -8658,7 +8746,7 @@ class Benchmark {
8658
8746
  "Encountered an error creating a default Replayer. "
8659
8747
  "Error: %s\n",
8660
8748
  s.ToString().c_str());
8661
- exit(1);
8749
+ db_bench_exit(1);
8662
8750
  }
8663
8751
  s = replayer->Prepare();
8664
8752
  if (!s.ok()) {
@@ -8724,6 +8812,7 @@ int db_bench_tool(int argc, char** argv, ToolHooks& hooks) {
8724
8812
  ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
8725
8813
  ConfigOptions config_options;
8726
8814
  static bool initialized = false;
8815
+ hooks_ = &hooks;
8727
8816
  if (!initialized) {
8728
8817
  SetUsageMessage(std::string("\nUSAGE:\n") + std::string(argv[0]) +
8729
8818
  " [OPTIONS]...");
@@ -8736,7 +8825,7 @@ int db_bench_tool(int argc, char** argv, ToolHooks& hooks) {
8736
8825
  if (FLAGS_statistics && !FLAGS_statistics_string.empty()) {
8737
8826
  fprintf(stderr,
8738
8827
  "Cannot provide both --statistics and --statistics_string.\n");
8739
- exit(1);
8828
+ db_bench_exit(1);
8740
8829
  }
8741
8830
  if (!FLAGS_statistics_string.empty()) {
8742
8831
  Status s = Statistics::CreateFromString(config_options,
@@ -8745,7 +8834,7 @@ int db_bench_tool(int argc, char** argv, ToolHooks& hooks) {
8745
8834
  fprintf(stderr,
8746
8835
  "No Statistics registered matching string: %s status=%s\n",
8747
8836
  FLAGS_statistics_string.c_str(), s.ToString().c_str());
8748
- exit(1);
8837
+ db_bench_exit(1);
8749
8838
  }
8750
8839
  }
8751
8840
  if (FLAGS_statistics) {
@@ -8784,7 +8873,7 @@ int db_bench_tool(int argc, char** argv, ToolHooks& hooks) {
8784
8873
  int env_opts = !FLAGS_env_uri.empty() + !FLAGS_fs_uri.empty();
8785
8874
  if (env_opts > 1) {
8786
8875
  fprintf(stderr, "Error: --env_uri and --fs_uri are mutually exclusive\n");
8787
- exit(1);
8876
+ db_bench_exit(1);
8788
8877
  }
8789
8878
 
8790
8879
  if (env_opts == 1) {
@@ -8792,7 +8881,7 @@ int db_bench_tool(int argc, char** argv, ToolHooks& hooks) {
8792
8881
  &FLAGS_env, &env_guard);
8793
8882
  if (!s.ok()) {
8794
8883
  fprintf(stderr, "Failed creating env: %s\n", s.ToString().c_str());
8795
- exit(1);
8884
+ db_bench_exit(1);
8796
8885
  }
8797
8886
  } else if (FLAGS_simulate_hdd || FLAGS_simulate_hybrid_fs_file != "") {
8798
8887
  //**TODO: Make the simulate fs something that can be loaded
@@ -8813,7 +8902,7 @@ int db_bench_tool(int argc, char** argv, ToolHooks& hooks) {
8813
8902
  std::string build_info;
8814
8903
  std::cout << GetRocksBuildInfoAsString(build_info, true) << std::endl;
8815
8904
  // Similar to --version, nothing else will be done when this flag is set
8816
- exit(0);
8905
+ db_bench_exit(0);
8817
8906
  }
8818
8907
 
8819
8908
  if (!FLAGS_seed) {
@@ -8829,7 +8918,7 @@ int db_bench_tool(int argc, char** argv, ToolHooks& hooks) {
8829
8918
  fprintf(stderr,
8830
8919
  "`-use_existing_db` must be true for `-use_existing_keys` to be "
8831
8920
  "settable\n");
8832
- exit(1);
8921
+ db_bench_exit(1);
8833
8922
  }
8834
8923
 
8835
8924
  FLAGS_value_size_distribution_type_e =
@@ -8868,7 +8957,7 @@ int db_bench_tool(int argc, char** argv, ToolHooks& hooks) {
8868
8957
 
8869
8958
  if (FLAGS_seek_missing_prefix && FLAGS_prefix_size <= 8) {
8870
8959
  fprintf(stderr, "prefix_size > 8 required by --seek_missing_prefix\n");
8871
- exit(1);
8960
+ db_bench_exit(1);
8872
8961
  }
8873
8962
 
8874
8963
  ROCKSDB_NAMESPACE::Benchmark benchmark;