db_stress_gflags.cc 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562
  1. // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
  2. // This source code is licensed under both the GPLv2 (found in the
  3. // COPYING file in the root directory) and Apache 2.0 License
  4. // (found in the LICENSE.Apache file in the root directory).
  5. //
  6. // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
  7. // Use of this source code is governed by a BSD-style license that can be
  8. // found in the LICENSE file. See the AUTHORS file for names of contributors.
  9. #include "rocksdb/cache.h"
  10. #include "rocksdb/options.h"
  11. #include "rocksdb/utilities/backup_engine.h"
  12. #ifdef GFLAGS
  13. #include "db_stress_tool/db_stress_common.h"
  14. static bool ValidateUint32Range(const char* flagname, uint64_t value) {
  15. if (value > std::numeric_limits<uint32_t>::max()) {
  16. fprintf(stderr, "Invalid value for --%s: %lu, overflow\n", flagname,
  17. (unsigned long)value);
  18. return false;
  19. }
  20. return true;
  21. }
  22. DEFINE_uint64(seed, 2341234,
  23. "Seed for PRNG. When --nooverwritepercent is "
  24. "nonzero and --expected_values_dir is nonempty, this value "
  25. "must be fixed across invocations.");
  26. static const bool FLAGS_seed_dummy __attribute__((__unused__)) =
  27. RegisterFlagValidator(&FLAGS_seed, &ValidateUint32Range);
  28. DEFINE_bool(read_only, false, "True if open DB in read-only mode during tests");
  29. DEFINE_int64(max_key, 1 * KB * KB,
  30. "Max number of key/values to place in database");
  31. DEFINE_int32(max_key_len, 3, "Maximum length of a key in 8-byte units");
  32. DEFINE_uint64(max_sequential_skip_in_iterations,
  33. ROCKSDB_NAMESPACE::Options().max_sequential_skip_in_iterations,
  34. "Iterator will reseek after scanning this number of keys with"
  35. "the same user key during Next/Prev().");
  36. DEFINE_string(key_len_percent_dist, "",
  37. "Percentages of keys of various lengths. For example, 1,30,69 "
  38. "means 1% of keys are 8 bytes, 30% are 16 bytes, and 69% are "
  39. "24 bytes. If not specified, it will be evenly distributed");
  40. DEFINE_int32(key_window_scale_factor, 10,
  41. "This value will be multiplied by 100 to come up with a window "
  42. "size for varying the key length");
  43. DEFINE_int32(column_families, 10, "Number of column families");
  44. DEFINE_double(
  45. hot_key_alpha, 0,
  46. "Use Zipfian distribution to generate the key "
  47. "distribution. If it is not specified, write path will use random "
  48. "distribution to generate the keys. The parameter is [0, double_max]). "
  49. "However, the larger alpha is, the more shewed will be. If alpha is "
  50. "larger than 2, it is likely that only 1 key will be accessed. The "
  51. "Recommended value is [0.8-1.5]. The distribution is also related to "
  52. "max_key and total iterations of generating the hot key. ");
  53. DEFINE_string(
  54. options_file, "",
  55. "The path to a RocksDB options file. If specified, then db_stress will "
  56. "run with the RocksDB options in the default column family of the "
  57. "specified options file. Note that, when an options file is provided, "
  58. "db_stress will ignore the flag values for all options that may be passed "
  59. "via options file.");
  60. DEFINE_int64(
  61. active_width, 0,
  62. "Number of keys in active span of the key-range at any given time. The "
  63. "span begins with its left endpoint at key 0, gradually moves rightwards, "
  64. "and ends with its right endpoint at max_key. If set to 0, active_width "
  65. "will be sanitized to be equal to max_key.");
  66. // TODO(noetzli) Add support for single deletes
  67. DEFINE_bool(test_batches_snapshots, false,
  68. "If set, the test uses MultiGet(), MultiPut() and MultiDelete()"
  69. " which read/write/delete multiple keys in a batch. In this mode,"
  70. " we do not verify db content by comparing the content with the "
  71. "pre-allocated array. Instead, we do partial verification inside"
  72. " MultiGet() by checking various values in a batch. Benefit of"
  73. " this mode:\n"
  74. "\t(a) No need to acquire mutexes during writes (less cache "
  75. "flushes in multi-core leading to speed up)\n"
  76. "\t(b) No long validation at the end (more speed up)\n"
  77. "\t(c) Test snapshot and atomicity of batch writes");
  78. DEFINE_bool(atomic_flush, false,
  79. "If set, enables atomic flush in the options.\n");
  80. DEFINE_int32(
  81. manual_wal_flush_one_in, 0,
  82. "If non-zero, then `FlushWAL(bool sync)`, where `bool sync` is randomly "
  83. "decided, will be explictly called in db stress once for every N ops "
  84. "on average. Setting `manual_wal_flush_one_in` to be greater than 0 "
  85. "implies `Options::manual_wal_flush = true` is set.");
  86. DEFINE_int32(lock_wal_one_in, 1000000,
  87. "If non-zero, then `LockWAL()` + `UnlockWAL()` will be called in "
  88. "db_stress once for every N ops on average.");
  89. DEFINE_bool(test_cf_consistency, false,
  90. "If set, runs the stress test dedicated to verifying writes to "
  91. "multiple column families are consistent. Setting this implies "
  92. "`atomic_flush=true` is set true if `disable_wal=false`.\n");
  93. DEFINE_bool(test_multi_ops_txns, false,
  94. "If set, runs stress test dedicated to verifying multi-ops "
  95. "transactions on a simple relational table with primary and "
  96. "secondary index.");
  97. DEFINE_int32(threads, 32, "Number of concurrent threads to run.");
  98. DEFINE_int32(ttl, -1,
  99. "Opens the db with this ttl value if this is not -1. "
  100. "Carefully specify a large value such that verifications on "
  101. "deleted values don't fail");
  102. DEFINE_int32(value_size_mult, 8,
  103. "Size of value will be this number times rand_int(1,3) bytes");
  104. DEFINE_int32(compaction_readahead_size, 0, "Compaction readahead size");
  105. DEFINE_bool(enable_pipelined_write, false, "Pipeline WAL/memtable writes");
  106. DEFINE_bool(verify_before_write, false, "Verify before write");
  107. DEFINE_bool(histogram, false, "Print histogram of operation timings");
  108. DEFINE_bool(destroy_db_initially, true,
  109. "Destroys the database dir before start if this is true");
  110. DEFINE_bool(verbose, false, "Verbose");
  111. DEFINE_bool(progress_reports, true,
  112. "If true, db_stress will report number of finished operations");
  113. DEFINE_uint64(db_write_buffer_size,
  114. ROCKSDB_NAMESPACE::Options().db_write_buffer_size,
  115. "Number of bytes to buffer in all memtables before compacting");
  116. DEFINE_bool(use_write_buffer_manager, false,
  117. "Charge WriteBufferManager memory to the block cache");
  118. DEFINE_int32(
  119. write_buffer_size,
  120. static_cast<int32_t>(ROCKSDB_NAMESPACE::Options().write_buffer_size),
  121. "Number of bytes to buffer in memtable before compacting");
  122. DEFINE_int32(max_write_buffer_number,
  123. ROCKSDB_NAMESPACE::Options().max_write_buffer_number,
  124. "The number of in-memory memtables. "
  125. "Each memtable is of size FLAGS_write_buffer_size.");
  126. DEFINE_int32(min_write_buffer_number_to_merge,
  127. ROCKSDB_NAMESPACE::Options().min_write_buffer_number_to_merge,
  128. "The minimum number of write buffers that will be merged together "
  129. "before writing to storage. This is cheap because it is an "
  130. "in-memory merge. If this feature is not enabled, then all these "
  131. "write buffers are flushed to L0 as separate files and this "
  132. "increases read amplification because a get request has to check "
  133. "in all of these files. Also, an in-memory merge may result in "
  134. "writing less data to storage if there are duplicate records in"
  135. " each of these individual write buffers.");
  136. DEFINE_int64(max_write_buffer_size_to_maintain,
  137. ROCKSDB_NAMESPACE::Options().max_write_buffer_size_to_maintain,
  138. "The total maximum size of write buffers to maintain in memory "
  139. "including copies of buffers that have already been flushed. "
  140. "Unlike max_write_buffer_number, this parameter does not affect "
  141. "flushing. This controls the minimum amount of write history "
  142. "that will be available in memory for conflict checking when "
  143. "Transactions are used. If this value is too low, some "
  144. "transactions may fail at commit time due to not being able to "
  145. "determine whether there were any write conflicts. Setting this "
  146. "value to 0 will cause write buffers to be freed immediately "
  147. "after they are flushed. If this value is set to -1, "
  148. "'max_write_buffer_number' will be used.");
  149. DEFINE_double(memtable_prefix_bloom_size_ratio,
  150. ROCKSDB_NAMESPACE::Options().memtable_prefix_bloom_size_ratio,
  151. "creates prefix blooms for memtables, each with size "
  152. "`write_buffer_size * memtable_prefix_bloom_size_ratio`.");
  153. DEFINE_bool(memtable_whole_key_filtering,
  154. ROCKSDB_NAMESPACE::Options().memtable_whole_key_filtering,
  155. "Enable whole key filtering in memtables.");
  156. DEFINE_int32(open_files, ROCKSDB_NAMESPACE::Options().max_open_files,
  157. "Maximum number of files to keep open at the same time "
  158. "(use default if == 0)");
  159. DEFINE_uint64(compressed_secondary_cache_size, 0,
  160. "Number of bytes to use as a cache of compressed data."
  161. " 0 means use default settings.");
  162. DEFINE_int32(compressed_secondary_cache_numshardbits, -1,
  163. "Number of shards for the compressed secondary cache is 2 ** "
  164. "compressed_secondary_cache_numshardbits. "
  165. "Negative value means default settings. This is applied only "
  166. "if compressed_secondary_cache_size is greater than 0.");
  167. DEFINE_double(compressed_secondary_cache_ratio, 0.0,
  168. "Fraction of block cache memory budget to use for compressed "
  169. "secondary cache");
  170. DEFINE_int32(secondary_cache_update_interval, 30 * 1000 * 1000,
  171. "Interval between modification of secondary cache parameters, in "
  172. "microseconds");
  173. DEFINE_int32(compaction_style, ROCKSDB_NAMESPACE::Options().compaction_style,
  174. "");
  175. DEFINE_int32(compaction_pri, ROCKSDB_NAMESPACE::Options().compaction_pri,
  176. "Which file from a level should be picked to merge to the next "
  177. "level in level-based compaction");
  178. DEFINE_int32(num_levels, ROCKSDB_NAMESPACE::Options().num_levels,
  179. "Number of levels in the DB");
  180. DEFINE_int32(level0_file_num_compaction_trigger,
  181. ROCKSDB_NAMESPACE::Options().level0_file_num_compaction_trigger,
  182. "Level0 compaction start trigger");
  183. DEFINE_int32(level0_slowdown_writes_trigger,
  184. ROCKSDB_NAMESPACE::Options().level0_slowdown_writes_trigger,
  185. "Number of files in level-0 that will slow down writes");
  186. DEFINE_int32(level0_stop_writes_trigger,
  187. ROCKSDB_NAMESPACE::Options().level0_stop_writes_trigger,
  188. "Number of files in level-0 that will trigger put stop.");
  189. DEFINE_int32(block_size,
  190. static_cast<int32_t>(
  191. ROCKSDB_NAMESPACE::BlockBasedTableOptions().block_size),
  192. "Number of bytes in a block.");
  193. DEFINE_int32(format_version,
  194. static_cast<int32_t>(
  195. ROCKSDB_NAMESPACE::BlockBasedTableOptions().format_version),
  196. "Format version of SST files.");
  197. DEFINE_int32(
  198. index_block_restart_interval,
  199. ROCKSDB_NAMESPACE::BlockBasedTableOptions().index_block_restart_interval,
  200. "Number of keys between restart points "
  201. "for delta encoding of keys in index block.");
  202. DEFINE_bool(disable_auto_compactions,
  203. ROCKSDB_NAMESPACE::Options().disable_auto_compactions,
  204. "If true, RocksDB internally will not trigger compactions.");
  205. DEFINE_int32(max_background_compactions,
  206. ROCKSDB_NAMESPACE::Options().max_background_compactions,
  207. "The maximum number of concurrent background compactions "
  208. "that can occur in parallel.");
  209. DEFINE_int32(num_bottom_pri_threads, 0,
  210. "The number of threads in the bottom-priority thread pool (used "
  211. "by universal compaction only).");
  212. DEFINE_int32(compaction_thread_pool_adjust_interval, 0,
  213. "The interval (in milliseconds) to adjust compaction thread pool "
  214. "size. Don't change it periodically if the value is 0.");
  215. DEFINE_int32(compaction_thread_pool_variations, 2,
  216. "Range of background thread pool size variations when adjusted "
  217. "periodically.");
  218. DEFINE_int32(max_background_flushes,
  219. ROCKSDB_NAMESPACE::Options().max_background_flushes,
  220. "The maximum number of concurrent background flushes "
  221. "that can occur in parallel.");
  222. DEFINE_int32(universal_size_ratio, 0,
  223. "The ratio of file sizes that trigger"
  224. " compaction in universal style");
  225. DEFINE_int32(universal_min_merge_width, 0,
  226. "The minimum number of files to "
  227. "compact in universal style compaction");
  228. DEFINE_int32(universal_max_merge_width, 0,
  229. "The max number of files to compact"
  230. " in universal style compaction");
  231. DEFINE_int32(universal_max_size_amplification_percent, 0,
  232. "The max size amplification for universal style compaction");
  233. DEFINE_int32(universal_max_read_amp, -1,
  234. "The limit on the number of sorted runs");
  235. DEFINE_int32(clear_column_family_one_in, 1000000,
  236. "With a chance of 1/N, delete a column family and then recreate "
  237. "it again. If N == 0, never drop/create column families. "
  238. "When test_batches_snapshots is true, this flag has no effect");
  239. DEFINE_int32(
  240. get_live_files_apis_one_in, 1000000,
  241. "With a chance of 1/N, call GetLiveFiles(), GetLiveFilesMetaData() and "
  242. "GetLiveFilesChecksumInfo() to verify if it returns "
  243. "OK or violate any internal assertion. If N == 0, do not call the "
  244. "interface.");
  245. DEFINE_int32(
  246. get_all_column_family_metadata_one_in, 1000000,
  247. "With a chance of 1/N, call GetAllColumnFamilyMetaData to verify if it "
  248. "violates any internal assertion. If N == 0, do not call the interface.");
  249. DEFINE_int32(
  250. get_sorted_wal_files_one_in, 1000000,
  251. "With a chance of 1/N, call GetSortedWalFiles to verify if it returns "
  252. "correctly. (Note that this API may legitimately return an error.) If N == "
  253. "0, do not call the interface.");
  254. DEFINE_int32(
  255. get_current_wal_file_one_in, 1000000,
  256. "With a chance of 1/N, call GetCurrentWalFile to verify if it returns "
  257. "correctly. (Note that this API may legitimately return an error.) If N == "
  258. "0, do not call the interface.");
  259. DEFINE_int32(set_options_one_in, 0,
  260. "With a chance of 1/N, change some random options");
  261. DEFINE_int32(set_in_place_one_in, 0,
  262. "With a chance of 1/N, toggle in place support option");
  263. DEFINE_int64(cache_size, 2LL * KB * KB * KB,
  264. "Number of bytes to use as a cache of uncompressed data.");
  265. DEFINE_int32(cache_numshardbits, 6,
  266. "Number of shards for the block cache"
  267. " is 2 ** cache_numshardbits. Negative means use default settings."
  268. " This is applied only if FLAGS_cache_size is greater than 0.");
  269. DEFINE_bool(cache_index_and_filter_blocks, false,
  270. "True if indexes/filters should be cached in block cache.");
  271. DEFINE_bool(charge_compression_dictionary_building_buffer, false,
  272. "Setting for "
  273. "CacheEntryRoleOptions::charged of "
  274. "CacheEntryRole::kCompressionDictionaryBuildingBuffer");
  275. DEFINE_bool(charge_filter_construction, false,
  276. "Setting for "
  277. "CacheEntryRoleOptions::charged of "
  278. "CacheEntryRole::kFilterConstruction");
  279. DEFINE_bool(charge_table_reader, false,
  280. "Setting for "
  281. "CacheEntryRoleOptions::charged of "
  282. "CacheEntryRole::kBlockBasedTableReader");
  283. DEFINE_bool(charge_file_metadata, false,
  284. "Setting for "
  285. "CacheEntryRoleOptions::charged of "
  286. "kFileMetadata");
  287. DEFINE_bool(charge_blob_cache, false,
  288. "Setting for "
  289. "CacheEntryRoleOptions::charged of "
  290. "kBlobCache");
  291. DEFINE_bool(
  292. decouple_partitioned_filters,
  293. ROCKSDB_NAMESPACE::BlockBasedTableOptions().decouple_partitioned_filters,
  294. "Decouple filter partitioning from index partitioning.");
  295. DEFINE_int32(
  296. top_level_index_pinning,
  297. static_cast<int32_t>(ROCKSDB_NAMESPACE::PinningTier::kFallback),
  298. "Type of pinning for top-level indexes into metadata partitions (see "
  299. "`enum PinningTier` in table.h)");
  300. DEFINE_int32(
  301. partition_pinning,
  302. static_cast<int32_t>(ROCKSDB_NAMESPACE::PinningTier::kFallback),
  303. "Type of pinning for metadata partitions (see `enum PinningTier` in "
  304. "table.h)");
  305. DEFINE_int32(
  306. unpartitioned_pinning,
  307. static_cast<int32_t>(ROCKSDB_NAMESPACE::PinningTier::kFallback),
  308. "Type of pinning for unpartitioned metadata blocks (see `enum PinningTier` "
  309. "in table.h)");
  310. DEFINE_string(cache_type, "lru_cache", "Type of block cache.");
  311. DEFINE_uint64(subcompactions, 1,
  312. "Maximum number of subcompactions to divide L0-L1 compactions "
  313. "into.");
  314. DEFINE_uint64(periodic_compaction_seconds, 1000,
  315. "Files older than this value will be picked up for compaction.");
  316. DEFINE_string(daily_offpeak_time_utc, "",
  317. "If set, process periodic compactions during this period only");
  318. DEFINE_uint64(compaction_ttl, 1000,
  319. "Files older than TTL will be compacted to the next level.");
  320. DEFINE_bool(fifo_allow_compaction, false,
  321. "If true, set `Options::compaction_options_fifo.allow_compaction = "
  322. "true`. It only take effect when FIFO compaction is used.");
  323. DEFINE_bool(allow_concurrent_memtable_write, false,
  324. "Allow multi-writers to update mem tables in parallel.");
  325. DEFINE_double(experimental_mempurge_threshold, 0.0,
  326. "Maximum estimated useful payload that triggers a "
  327. "mempurge process to collect memtable garbage bytes.");
  328. DEFINE_bool(enable_write_thread_adaptive_yield,
  329. ROCKSDB_NAMESPACE::Options().enable_write_thread_adaptive_yield,
  330. "Use a yielding spin loop for brief writer thread waits.");
  331. // Options for StackableDB-based BlobDB
  332. DEFINE_bool(use_blob_db, false, "[Stacked BlobDB] Use BlobDB.");
  333. DEFINE_uint64(
  334. blob_db_min_blob_size,
  335. ROCKSDB_NAMESPACE::blob_db::BlobDBOptions().min_blob_size,
  336. "[Stacked BlobDB] Smallest blob to store in a file. Blobs "
  337. "smaller than this will be inlined with the key in the LSM tree.");
  338. DEFINE_uint64(
  339. blob_db_bytes_per_sync,
  340. ROCKSDB_NAMESPACE::blob_db::BlobDBOptions().bytes_per_sync,
  341. "[Stacked BlobDB] Sync blob files once per every N bytes written.");
  342. DEFINE_uint64(blob_db_file_size,
  343. ROCKSDB_NAMESPACE::blob_db::BlobDBOptions().blob_file_size,
  344. "[Stacked BlobDB] Target size of each blob file.");
  345. DEFINE_bool(
  346. blob_db_enable_gc,
  347. ROCKSDB_NAMESPACE::blob_db::BlobDBOptions().enable_garbage_collection,
  348. "[Stacked BlobDB] Enable BlobDB garbage collection.");
  349. DEFINE_double(
  350. blob_db_gc_cutoff,
  351. ROCKSDB_NAMESPACE::blob_db::BlobDBOptions().garbage_collection_cutoff,
  352. "[Stacked BlobDB] Cutoff ratio for BlobDB garbage collection.");
  353. // Options for integrated BlobDB
  354. DEFINE_bool(allow_setting_blob_options_dynamically, false,
  355. "[Integrated BlobDB] Allow setting blob options dynamically.");
  356. DEFINE_bool(
  357. enable_blob_files,
  358. ROCKSDB_NAMESPACE::AdvancedColumnFamilyOptions().enable_blob_files,
  359. "[Integrated BlobDB] Enable writing large values to separate blob files.");
  360. DEFINE_uint64(min_blob_size,
  361. ROCKSDB_NAMESPACE::AdvancedColumnFamilyOptions().min_blob_size,
  362. "[Integrated BlobDB] The size of the smallest value to be stored "
  363. "separately in a blob file.");
  364. DEFINE_uint64(blob_file_size,
  365. ROCKSDB_NAMESPACE::AdvancedColumnFamilyOptions().blob_file_size,
  366. "[Integrated BlobDB] The size limit for blob files.");
  367. DEFINE_string(blob_compression_type, "none",
  368. "[Integrated BlobDB] The compression algorithm to use for large "
  369. "values stored in blob files.");
  370. DEFINE_string(compression_manager, "mixed",
  371. "Ability to change compression manager specified in "
  372. "simple_mixed_manager.h (mixed -> roundRobin)");
  373. DEFINE_bool(enable_blob_garbage_collection,
  374. ROCKSDB_NAMESPACE::AdvancedColumnFamilyOptions()
  375. .enable_blob_garbage_collection,
  376. "[Integrated BlobDB] Enable blob garbage collection.");
  377. DEFINE_double(blob_garbage_collection_age_cutoff,
  378. ROCKSDB_NAMESPACE::AdvancedColumnFamilyOptions()
  379. .blob_garbage_collection_age_cutoff,
  380. "[Integrated BlobDB] The cutoff in terms of blob file age for "
  381. "garbage collection.");
  382. DEFINE_double(blob_garbage_collection_force_threshold,
  383. ROCKSDB_NAMESPACE::AdvancedColumnFamilyOptions()
  384. .blob_garbage_collection_force_threshold,
  385. "[Integrated BlobDB] The threshold for the ratio of garbage in "
  386. "the eligible blob files for forcing garbage collection.");
  387. DEFINE_uint64(blob_compaction_readahead_size,
  388. ROCKSDB_NAMESPACE::AdvancedColumnFamilyOptions()
  389. .blob_compaction_readahead_size,
  390. "[Integrated BlobDB] Compaction readahead for blob files.");
  391. DEFINE_int32(
  392. blob_file_starting_level,
  393. ROCKSDB_NAMESPACE::AdvancedColumnFamilyOptions().blob_file_starting_level,
  394. "[Integrated BlobDB] Enable writing blob files during flushes and "
  395. "compactions starting from the specified level.");
  396. DEFINE_bool(use_blob_cache, false, "[Integrated BlobDB] Enable blob cache.");
  397. DEFINE_bool(
  398. use_shared_block_and_blob_cache, true,
  399. "[Integrated BlobDB] Use a shared backing cache for both block "
  400. "cache and blob cache. It only takes effect if use_blob_cache is enabled.");
  401. DEFINE_uint64(
  402. blob_cache_size, 2LL * KB * KB * KB,
  403. "[Integrated BlobDB] Number of bytes to use as a cache of blobs. It only "
  404. "takes effect if the block and blob caches are different "
  405. "(use_shared_block_and_blob_cache = false).");
  406. DEFINE_int32(blob_cache_numshardbits, 6,
  407. "[Integrated BlobDB] Number of shards for the blob cache is 2 ** "
  408. "blob_cache_numshardbits. Negative means use default settings. "
  409. "It only takes effect if blob_cache_size is greater than 0, and "
  410. "the block and blob caches are different "
  411. "(use_shared_block_and_blob_cache = false).");
  412. DEFINE_int32(prepopulate_blob_cache, 0,
  413. "[Integrated BlobDB] Pre-populate hot/warm blobs in blob cache. 0 "
  414. "to disable and 1 to insert during flush.");
  415. DEFINE_int64(preclude_last_level_data_seconds, 0,
  416. "Preclude data from the last level. Used with tiered storage "
  417. "feature to preclude new data from comacting to the last level.");
  418. DEFINE_int64(
  419. preserve_internal_time_seconds, 0,
  420. "Preserve internal time information which is attached to each SST.");
  421. DEFINE_uint32(use_timed_put_one_in, 0,
  422. "If greater than zero, TimedPut is used per every N write ops on "
  423. "on average.");
  424. DEFINE_string(file_temperature_age_thresholds, "",
  425. "See CompactionOptionsFIFO::file_temperature_age_thresholds. "
  426. "empty == unset");
  427. DEFINE_bool(allow_trivial_copy_when_change_temperature, true,
  428. "Allow kChangeTemperature to do trivial copy");
  429. static const bool FLAGS_subcompactions_dummy __attribute__((__unused__)) =
  430. RegisterFlagValidator(&FLAGS_subcompactions, &ValidateUint32Range);
  431. static bool ValidateInt32Positive(const char* flagname, int32_t value) {
  432. if (value < 0) {
  433. fprintf(stderr, "Invalid value for --%s: %d, must be >=0\n", flagname,
  434. value);
  435. return false;
  436. }
  437. return true;
  438. }
  439. DEFINE_int32(reopen, 10, "Number of times database reopens");
  440. static const bool FLAGS_reopen_dummy __attribute__((__unused__)) =
  441. RegisterFlagValidator(&FLAGS_reopen, &ValidateInt32Positive);
  442. DEFINE_double(bloom_bits, 10,
  443. "Bloom filter bits per key. "
  444. "Negative means use default settings.");
  445. DEFINE_int32(
  446. bloom_before_level, 999,
  447. "Use Bloom filter on levels below specified and Ribbon beginning on level "
  448. "specified. Flush is considered level -1. Setting -1 -> always Ribbon. "
  449. "0 -> Ribbon except Bloom for flush. INT_MAX (typically 2147483647) -> "
  450. "always Bloom.");
  451. DEFINE_bool(partition_filters, false,
  452. "use partitioned filters "
  453. "for block-based table");
  454. DEFINE_bool(
  455. optimize_filters_for_memory,
  456. ROCKSDB_NAMESPACE::BlockBasedTableOptions().optimize_filters_for_memory,
  457. "Minimize memory footprint of filters");
  458. DEFINE_bool(
  459. detect_filter_construct_corruption,
  460. ROCKSDB_NAMESPACE::BlockBasedTableOptions()
  461. .detect_filter_construct_corruption,
  462. "Detect corruption during new Bloom Filter and Ribbon Filter construction");
  463. DEFINE_string(sqfc_name, "foo",
  464. "Config name to select from SstQueryFilterConfigsManager.");
  465. DEFINE_uint32(sqfc_version, 0,
  466. "User-defined filtering version to select from "
  467. "SstQueryFilterConfigsManager. 0 = disable writing filters");
  468. DEFINE_bool(use_sqfc_for_range_queries, true,
  469. "Apply SstQueryFilters to range queries");
  470. DEFINE_int32(
  471. index_type,
  472. static_cast<int32_t>(
  473. ROCKSDB_NAMESPACE::BlockBasedTableOptions().index_type),
  474. "Type of block-based table index (see `enum IndexType` in table.h)");
  475. DEFINE_int32(
  476. data_block_index_type,
  477. static_cast<int32_t>(
  478. ROCKSDB_NAMESPACE::BlockBasedTableOptions().data_block_index_type),
  479. "Index type for data blocks (see `enum DataBlockIndexType` in table.h)");
  480. DEFINE_string(db, "", "Use the db with the following name.");
  481. DEFINE_string(secondaries_base, "",
  482. "Use this path as the base path for secondary instances.");
  483. DEFINE_bool(test_secondary, false,
  484. "If true, start an additional secondary instance which can be used "
  485. "for verification.");
  486. DEFINE_string(
  487. expected_values_dir, "",
  488. "Dir where files containing info about the latest/historical values will "
  489. "be stored. If provided and non-empty, the DB state will be verified "
  490. "against values from these files after recovery. --max_key and "
  491. "--column_family must be kept the same across invocations of this program "
  492. "that use the same --expected_values_dir. Currently historical values are "
  493. "only tracked when --sync_fault_injection is set. See --seed and "
  494. "--nooverwritepercent for further requirements.");
  495. DEFINE_bool(verify_checksum, false,
  496. "Verify checksum for every block read from storage");
  497. DEFINE_bool(mmap_read, ROCKSDB_NAMESPACE::Options().allow_mmap_reads,
  498. "Allow reads to occur via mmap-ing files");
  499. DEFINE_bool(mmap_write, ROCKSDB_NAMESPACE::Options().allow_mmap_writes,
  500. "Allow writes to occur via mmap-ing files");
  501. DEFINE_bool(use_direct_reads, ROCKSDB_NAMESPACE::Options().use_direct_reads,
  502. "Use O_DIRECT for reading data");
  503. DEFINE_bool(use_direct_io_for_flush_and_compaction,
  504. ROCKSDB_NAMESPACE::Options().use_direct_io_for_flush_and_compaction,
  505. "Use O_DIRECT for writing data");
  506. DEFINE_bool(mock_direct_io, false,
  507. "Mock direct IO by not using O_DIRECT for direct IO read");
  508. DEFINE_bool(statistics, false, "Create database statistics");
  509. DEFINE_bool(sync, false, "Sync all writes to disk");
  510. DEFINE_bool(use_fsync, false, "If true, issue fsync instead of fdatasync");
  511. DEFINE_uint64(bytes_per_sync, ROCKSDB_NAMESPACE::Options().bytes_per_sync,
  512. "If nonzero, sync SST file data incrementally after every "
  513. "`bytes_per_sync` bytes are written");
  514. DEFINE_uint64(wal_bytes_per_sync,
  515. ROCKSDB_NAMESPACE::Options().wal_bytes_per_sync,
  516. "If nonzero, sync WAL file data incrementally after every "
  517. "`bytes_per_sync` bytes are written");
  518. DEFINE_int32(kill_random_test, 0,
  519. "If non-zero, kill at various points in source code with "
  520. "probability 1/this");
  521. static const bool FLAGS_kill_random_test_dummy __attribute__((__unused__)) =
  522. RegisterFlagValidator(&FLAGS_kill_random_test, &ValidateInt32Positive);
  523. DEFINE_string(kill_exclude_prefixes, "",
  524. "If non-empty, kill points with prefix in the list given will be"
  525. " skipped. Items are comma-separated.");
  526. extern std::vector<std::string> rocksdb_kill_exclude_prefixes;
  527. DEFINE_bool(disable_wal, false, "If true, do not write WAL for write.");
  528. DEFINE_uint64(recycle_log_file_num,
  529. ROCKSDB_NAMESPACE::Options().recycle_log_file_num,
  530. "Number of old WAL files to keep around for later recycling");
  531. DEFINE_int64(target_file_size_base,
  532. ROCKSDB_NAMESPACE::Options().target_file_size_base,
  533. "Target level-1 file size for compaction");
  534. DEFINE_int32(target_file_size_multiplier, 1,
  535. "A multiplier to compute target level-N file size (N >= 2)");
  536. DEFINE_uint64(max_bytes_for_level_base,
  537. ROCKSDB_NAMESPACE::Options().max_bytes_for_level_base,
  538. "Max bytes for level-1");
  539. DEFINE_double(max_bytes_for_level_multiplier, 2,
  540. "A multiplier to compute max bytes for level-N (N >= 2)");
  541. DEFINE_int32(range_deletion_width, 10,
  542. "The width of the range deletion intervals.");
  543. DEFINE_uint64(rate_limiter_bytes_per_sec, 0, "Set options.rate_limiter value.");
  544. DEFINE_bool(rate_limit_bg_reads, false,
  545. "Use options.rate_limiter on compaction reads");
  546. DEFINE_bool(rate_limit_user_ops, false,
  547. "When true use Env::IO_USER priority level to charge internal rate "
  548. "limiter for reads associated with user operations.");
  549. DEFINE_bool(rate_limit_auto_wal_flush, false,
  550. "When true use Env::IO_USER priority level to charge internal rate "
  551. "limiter for automatic WAL flush (`Options::manual_wal_flush` == "
  552. "false) after the user "
  553. "write operation.");
  554. DEFINE_uint64(sst_file_manager_bytes_per_sec, 0,
  555. "Set `Options::sst_file_manager` to delete at this rate. By "
  556. "default the deletion rate is unbounded.");
  557. DEFINE_uint64(sst_file_manager_bytes_per_truncate, 0,
  558. "Set `Options::sst_file_manager` to delete in chunks of this "
  559. "many bytes. By default whole files will be deleted.");
  560. DEFINE_bool(use_txn, false,
  561. "Use TransactionDB or OptimisticTransactionDB. When "
  562. "use_optimistic_txn == false (by default), "
  563. "it's (Pessimistic) TransactionDB");
  564. DEFINE_uint64(txn_write_policy, 0,
  565. "The transaction write policy. Default is "
  566. "TxnDBWritePolicy::WRITE_COMMITTED. Note that this should not be "
  567. "changed across crashes.");
  568. DEFINE_bool(use_per_key_point_lock_mgr, true,
  569. "Use PointLockManager(false) or PerKeyPointLockManager(true) in "
  570. "TransactionDB.");
  571. DEFINE_bool(use_optimistic_txn, false, "Use OptimisticTransactionDB.");
  572. DEFINE_uint64(occ_validation_policy, 1,
  573. "Optimistic Concurrency Control Validation Policy for "
  574. "OptimisticTransactionDB");
  575. DEFINE_bool(share_occ_lock_buckets, false,
  576. "Share a pool of locks across DB instances for buckets");
  577. DEFINE_uint32(
  578. occ_lock_bucket_count, 500,
  579. "Bucket Count for shared Optimistic Concurrency Control (OCC) locks");
  580. DEFINE_bool(unordered_write, false,
  581. "Turn on the unordered_write feature. This options is currently "
  582. "tested only in combination with use_txn=true and "
  583. "txn_write_policy=TxnDBWritePolicy::WRITE_PREPARED.");
  584. DEFINE_int32(backup_one_in, 0,
  585. "If non-zero, then CreateNewBackup() will be called once for "
  586. "every N operations on average. 0 indicates CreateNewBackup() "
  587. "is disabled.");
  588. DEFINE_uint64(backup_max_size, 100 * 1024 * 1024,
  589. "If non-zero, skip checking backup/restore when DB size in "
  590. "bytes exceeds this setting.");
  591. DEFINE_int32(checkpoint_one_in, 0,
  592. "If non-zero, then CreateCheckpoint() will be called once for "
  593. "every N operations on average. 0 indicates CreateCheckpoint() "
  594. "is disabled.");
  595. DEFINE_int32(ingest_external_file_one_in, 0,
  596. "If non-zero, then IngestExternalFile() will be called once for "
  597. "every N operations on average. 0 indicates IngestExternalFile() "
  598. "is disabled.");
  599. DEFINE_int32(ingest_external_file_width, 100,
  600. "The width of the ingested external files.");
  601. DEFINE_int32(compact_files_one_in, 0,
  602. "If non-zero, then CompactFiles() will be called once for every N "
  603. "operations on average. 0 indicates CompactFiles() is disabled.");
  604. DEFINE_int32(compact_range_one_in, 0,
  605. "If non-zero, then CompactRange() will be called once for every N "
  606. "operations on average. 0 indicates CompactRange() is disabled.");
  607. DEFINE_int32(promote_l0_one_in, 0,
  608. "If non-zero, then PromoteL0() will be called once for every N "
  609. "operations on average. 0 indicates PromoteL0() is disabled.");
  610. DEFINE_int32(mark_for_compaction_one_file_in, 0,
  611. "A `TablePropertiesCollectorFactory` will be registered, which "
  612. "creates a `TablePropertiesCollector` with `NeedCompact()` "
  613. "returning true once for every N files on average. 0 or negative "
  614. "mean `NeedCompact()` always returns false.");
  615. DEFINE_int32(flush_one_in, 0,
  616. "If non-zero, then Flush() will be called once for every N ops "
  617. "on average. 0 indicates calls to Flush() are disabled.");
  618. DEFINE_int32(key_may_exist_one_in, 0,
  619. "If non-zero, then KeyMayExist() will be called "
  620. "once for every N ops on average. 0 disables.");
  621. DEFINE_int32(reset_stats_one_in, 0,
  622. "If non-zero, then ResetStats() will be called "
  623. "once for every N ops on average. 0 disables.");
  624. DEFINE_int32(pause_background_one_in, 0,
  625. "If non-zero, then PauseBackgroundWork()+Continue will be called "
  626. "once for every N ops on average. 0 disables.");
  627. DEFINE_int32(disable_file_deletions_one_in, 0,
  628. "If non-zero, then DisableFileDeletions()+Enable will be called "
  629. "once for every N ops on average. 0 disables.");
  630. DEFINE_int32(
  631. disable_manual_compaction_one_in, 0,
  632. "If non-zero, then DisableManualCompaction()+Enable will be called "
  633. "once for every N ops on average. 0 disables.");
  634. DEFINE_int32(compact_range_width, 10000,
  635. "The width of the ranges passed to CompactRange().");
  636. DEFINE_int32(acquire_snapshot_one_in, 0,
  637. "If non-zero, then acquires a snapshot once every N operations on "
  638. "average.");
  639. DEFINE_bool(compare_full_db_state_snapshot, false,
  640. "If set we compare state of entire db (in one of the threads) with"
  641. "each snapshot.");
  642. DEFINE_uint64(snapshot_hold_ops, 0,
  643. "If non-zero, then releases snapshots N operations after they're "
  644. "acquired.");
  645. DEFINE_bool(long_running_snapshots, false,
  646. "If set, hold on some some snapshots for much longer time.");
  647. // The following three options affect both regular read operations during the
  648. // test and initial/final database verification through VerifyDB.
  649. DEFINE_bool(use_multiget, false,
  650. "If set, use the batched MultiGet API for reads.");
  651. DEFINE_bool(use_get_entity, false, "If set, use the GetEntity API for reads.");
  652. DEFINE_bool(use_multi_get_entity, false,
  653. "If set, use the MultiGetEntity API for reads.");
  654. DEFINE_int32(test_ingest_standalone_range_deletion_one_in, 0,
  655. "If non-zero, file ingestion flow will test standalone range "
  656. "deletion file once every N file ingestion operations.");
  657. DEFINE_bool(allow_unprepared_value,
  658. ROCKSDB_NAMESPACE::ReadOptions().allow_unprepared_value,
  659. "Allow lazy loading of values for range scans");
  660. DEFINE_bool(track_and_verify_wals,
  661. ROCKSDB_NAMESPACE::Options().track_and_verify_wals,
  662. "See Options::track_and_verify_wals");
  663. DEFINE_int32(
  664. remote_compaction_worker_threads, 2,
  665. "Remote Compaction Worker Thread count. If 0, remote compaction is "
  666. "disabled");
  667. DEFINE_int32(remote_compaction_worker_interval, 10,
  668. "Remote Compaction Worker Thread dequeue tasks every N "
  669. "milliseconds. (Default: 10ms)");
  670. DEFINE_bool(remote_compaction_failure_fall_back_to_local, true,
  671. "If true, remote compaction failures will be ignored and "
  672. "compactions will fall back to local and retried");
  673. DEFINE_int32(allow_resumption_one_in, 0,
  674. "If non-zero, enable resumable compaction with 1/N probability "
  675. "for each OpenAndCompact call.Requires "
  676. "remote_compaction_worker_threads > 0");
  677. DEFINE_uint32(ingest_wbwi_one_in, 0,
  678. "If set, will call"
  679. "IngestWriteBatchWithIndex() instead of regular write operations "
  680. "once every N writes.");
  681. static bool ValidateInt32Percent(const char* flagname, int32_t value) {
  682. if (value < 0 || value > 100) {
  683. fprintf(stderr, "Invalid value for --%s: %d, 0<= pct <=100 \n", flagname,
  684. value);
  685. return false;
  686. }
  687. return true;
  688. }
  689. DEFINE_int32(readpercent, 10,
  690. "Ratio of reads to total workload (expressed as a percentage)");
  691. static const bool FLAGS_readpercent_dummy __attribute__((__unused__)) =
  692. RegisterFlagValidator(&FLAGS_readpercent, &ValidateInt32Percent);
  693. DEFINE_int32(prefixpercent, 20,
  694. "Ratio of prefix iterators to total workload (expressed as a"
  695. " percentage)");
  696. static const bool FLAGS_prefixpercent_dummy __attribute__((__unused__)) =
  697. RegisterFlagValidator(&FLAGS_prefixpercent, &ValidateInt32Percent);
  698. DEFINE_int32(writepercent, 45,
  699. "Ratio of writes to total workload (expressed as a percentage)");
  700. static const bool FLAGS_writepercent_dummy __attribute__((__unused__)) =
  701. RegisterFlagValidator(&FLAGS_writepercent, &ValidateInt32Percent);
  702. DEFINE_int32(delpercent, 15,
  703. "Ratio of deletes to total workload (expressed as a percentage)");
  704. static const bool FLAGS_delpercent_dummy __attribute__((__unused__)) =
  705. RegisterFlagValidator(&FLAGS_delpercent, &ValidateInt32Percent);
  706. DEFINE_int32(delrangepercent, 0,
  707. "Ratio of range deletions to total workload (expressed as a "
  708. "percentage). Cannot be used with test_batches_snapshots");
  709. static const bool FLAGS_delrangepercent_dummy __attribute__((__unused__)) =
  710. RegisterFlagValidator(&FLAGS_delrangepercent, &ValidateInt32Percent);
  711. DEFINE_int32(nooverwritepercent, 60,
  712. "Ratio of keys without overwrite to total workload (expressed as "
  713. "a percentage). When --expected_values_dir is nonempty, must "
  714. "keep this value constant across invocations.");
  715. static const bool FLAGS_nooverwritepercent_dummy __attribute__((__unused__)) =
  716. RegisterFlagValidator(&FLAGS_nooverwritepercent, &ValidateInt32Percent);
  717. DEFINE_int32(iterpercent, 10,
  718. "Ratio of iterations to total workload"
  719. " (expressed as a percentage)");
  720. static const bool FLAGS_iterpercent_dummy __attribute__((__unused__)) =
  721. RegisterFlagValidator(&FLAGS_iterpercent, &ValidateInt32Percent);
  722. DEFINE_uint64(num_iterations, 10, "Number of iterations per MultiIterate run");
  723. static const bool FLAGS_num_iterations_dummy __attribute__((__unused__)) =
  724. RegisterFlagValidator(&FLAGS_num_iterations, &ValidateUint32Range);
  725. DEFINE_int32(
  726. customopspercent, 0,
  727. "Ratio of custom operations to total workload (expressed as a percentage)");
  728. DEFINE_string(compression_type, "snappy",
  729. "Algorithm to use to compress the database");
  730. DEFINE_int32(compression_max_dict_bytes, 0,
  731. "Maximum size of dictionary used to prime the compression "
  732. "library.");
  733. DEFINE_int32(compression_zstd_max_train_bytes, 0,
  734. "Maximum size of training data passed to zstd's dictionary "
  735. "trainer.");
  736. DEFINE_int32(compression_parallel_threads, 1,
  737. "Number of threads for parallel compression.");
  738. DEFINE_uint64(compression_max_dict_buffer_bytes, 0,
  739. "Buffering limit for SST file data to sample for dictionary "
  740. "compression.");
  741. DEFINE_bool(
  742. compression_use_zstd_dict_trainer, true,
  743. "Use zstd's trainer to generate dictionary. If the options is false, "
  744. "zstd's finalizeDictionary() API is used to generate dictionary. "
  745. "ZSTD 1.4.5+ is required. If ZSTD 1.4.5+ is not linked with the binary, "
  746. "this flag will have the default value true.");
  747. DEFINE_bool(compression_checksum, false,
  748. "Turn on zstd's checksum feature for detecting corruption.");
  749. DEFINE_string(bottommost_compression_type, "disable",
  750. "Algorithm to use to compress bottommost level of the database. "
  751. "\"disable\" means disabling the feature");
  752. DEFINE_string(checksum_type, "kCRC32c", "Algorithm to use to checksum blocks");
  753. DEFINE_string(env_uri, "",
  754. "URI for env lookup. Mutually exclusive with --fs_uri");
  755. DEFINE_string(fs_uri, "",
  756. "URI for registry Filesystem lookup. Mutually exclusive"
  757. " with --env_uri."
  758. " Creates a default environment with the specified filesystem.");
  759. DEFINE_uint64(ops_per_thread, 1200000, "Number of operations per thread.");
  760. static const bool FLAGS_ops_per_thread_dummy __attribute__((__unused__)) =
  761. RegisterFlagValidator(&FLAGS_ops_per_thread, &ValidateUint32Range);
  762. DEFINE_uint64(log2_keys_per_lock, 2, "Log2 of number of keys per lock");
  763. static const bool FLAGS_log2_keys_per_lock_dummy __attribute__((__unused__)) =
  764. RegisterFlagValidator(&FLAGS_log2_keys_per_lock, &ValidateUint32Range);
  765. DEFINE_uint64(max_manifest_file_size, 16384, "Maximum size of a MANIFEST file");
  766. DEFINE_bool(in_place_update, false, "On true, does inplace update in memtable");
  767. DEFINE_string(memtablerep, "skip_list", "");
  768. inline static bool ValidatePrefixSize(const char* flagname, int32_t value) {
  769. if (value < -1 || value > 8) {
  770. fprintf(stderr, "Invalid value for --%s: %d. -1 <= PrefixSize <= 8\n",
  771. flagname, value);
  772. return false;
  773. }
  774. return true;
  775. }
  776. DEFINE_int32(prefix_size, 7,
  777. "Control the prefix size for HashSkipListRep. "
  778. "-1 is disabled.");
  779. static const bool FLAGS_prefix_size_dummy __attribute__((__unused__)) =
  780. RegisterFlagValidator(&FLAGS_prefix_size, &ValidatePrefixSize);
  781. DEFINE_bool(use_merge, false,
  782. "On true, replaces all writes with a Merge "
  783. "that behaves like a Put");
  784. DEFINE_uint32(use_put_entity_one_in, 0,
  785. "If greater than zero, PutEntity will be used once per every N "
  786. "write ops on average.");
  787. DEFINE_bool(use_attribute_group, false,
  788. "If set, use the attribute_group API to put/get entities");
  789. DEFINE_bool(use_multi_cf_iterator, false,
  790. "If set, use the multi_cf_iterator for TestIterate");
  791. DEFINE_bool(use_full_merge_v1, false,
  792. "On true, use a merge operator that implement the deprecated "
  793. "version of FullMerge");
  794. DEFINE_int32(sync_wal_one_in, 0,
  795. "If non-zero, then SyncWAL() will be called once for every N ops "
  796. "on average. 0 indicates that calls to SyncWAL() are disabled.");
  797. DEFINE_bool(avoid_unnecessary_blocking_io,
  798. ROCKSDB_NAMESPACE::Options().avoid_unnecessary_blocking_io,
  799. "If true, some expensive cleaning up operations will be moved from "
  800. "user reads to high-pri background threads.");
  801. DEFINE_bool(write_dbid_to_manifest,
  802. ROCKSDB_NAMESPACE::Options().write_dbid_to_manifest,
  803. "Write DB_ID to manifest");
  804. DEFINE_bool(write_identity_file,
  805. ROCKSDB_NAMESPACE::Options().write_identity_file,
  806. "Write DB_ID to IDENTITY file");
  807. DEFINE_bool(avoid_flush_during_recovery,
  808. ROCKSDB_NAMESPACE::Options().avoid_flush_during_recovery,
  809. "Avoid flush during recovery");
  810. DEFINE_uint64(max_write_batch_group_size_bytes,
  811. ROCKSDB_NAMESPACE::Options().max_write_batch_group_size_bytes,
  812. "Max write batch group size");
  813. DEFINE_bool(level_compaction_dynamic_level_bytes,
  814. ROCKSDB_NAMESPACE::Options().level_compaction_dynamic_level_bytes,
  815. "Use dynamic level");
  816. DEFINE_int32(verify_checksum_one_in, 0,
  817. "If non-zero, then DB::VerifyChecksum() will be called to do"
  818. " checksum verification of all the files in the database once for"
  819. " every N ops on average. 0 indicates that calls to"
  820. " VerifyChecksum() are disabled.");
  821. DEFINE_int32(verify_file_checksums_one_in, 0,
  822. "If non-zero, then DB::VerifyFileChecksums() will be called to do"
  823. " checksum verification of all the files in the database once for"
  824. " every N ops on average. 0 indicates that calls to"
  825. " VerifyFileChecksums() are disabled.");
  826. DEFINE_int32(verify_db_one_in, 0,
  827. "If non-zero, call VerifyDb() once for every N ops. 0 indicates "
  828. "that VerifyDb() will not be called in OperateDb(). Note that "
  829. "enabling this can slow down tests.");
  830. DEFINE_int32(continuous_verification_interval, 1000,
  831. "While test is running, verify db every N milliseconds. 0 "
  832. "disables continuous verification.");
  833. DEFINE_int32(approximate_size_one_in, 64,
  834. "If non-zero, DB::GetApproximateSizes() and "
  835. "DB::GetApproximateMemTableStats() will be called against "
  836. "random key ranges.");
  837. DEFINE_int32(read_fault_one_in, 1000,
  838. "On non-zero, enables fault injection on read");
  839. DEFINE_bool(error_recovery_with_no_fault_injection, false,
  840. "If true, error recovery will be done without fault injection if "
  841. "fault injection is enabled");
  842. DEFINE_int32(metadata_read_fault_one_in, 1000,
  843. "On non-zero, enables fault injection on metadata read (i.e, "
  844. "directory and file metadata read)");
  845. DEFINE_int32(get_property_one_in, 1000,
  846. "If non-zero, then DB::GetProperty() will be called to get various"
  847. " properties for every N ops on average. 0 indicates that"
  848. " GetProperty() will be not be called.");
  849. DEFINE_int32(get_properties_of_all_tables_one_in, 1000,
  850. "If non-zero, then DB::GetPropertiesOfAllTables() will be called "
  851. "for every N ops on average. 0 indicates that"
  852. " it will be not be called.");
  853. DEFINE_bool(sync_fault_injection, false,
  854. "If true, FaultInjectionTestFS will be used for write operations, "
  855. "and unsynced data in DB will lost after crash. In such a case we "
  856. "track DB changes in a trace file (\"*.trace\") in "
  857. "--expected_values_dir for verifying there are no holes in the "
  858. "recovered data.");
  859. DEFINE_bool(best_efforts_recovery, false,
  860. "If true, use best efforts recovery.");
  861. DEFINE_bool(skip_verifydb, false,
  862. "If true, skip VerifyDb() calls and Get()/Iterator verifications"
  863. "against expected state.");
  864. DEFINE_bool(enable_compaction_filter, false,
  865. "If true, configures a compaction filter that returns a kRemove "
  866. "decision for deleted keys.");
  867. DEFINE_bool(paranoid_file_checks, true,
  868. "After writing every SST file, reopen it and read all the keys "
  869. "and validate checksums");
  870. DEFINE_uint64(batch_protection_bytes_per_key, 0,
  871. "If nonzero, enables integrity protection in `WriteBatch` at the "
  872. "specified number of bytes per key. Currently the only supported "
  873. "nonzero value is eight.");
  874. DEFINE_uint32(
  875. memtable_protection_bytes_per_key, 0,
  876. "If nonzero, enables integrity protection in memtable entries at the "
  877. "specified number of bytes per key. Currently the supported "
  878. "nonzero values are 1, 2, 4 and 8.");
  879. DEFINE_uint32(block_protection_bytes_per_key, 0,
  880. "If nonzero, enables integrity protection in blocks at the "
  881. "specified number of bytes per key. Currently the supported "
  882. "nonzero values are 1, 2, 4 and 8.");
  883. DEFINE_string(file_checksum_impl, "none",
  884. "Name of an implementation for file_checksum_gen_factory, or "
  885. "\"none\" for null.");
  886. DEFINE_int32(write_fault_one_in, 0,
  887. "On non-zero, enables fault injection on write. Currently only"
  888. "injects write error when writing to SST files.");
  889. DEFINE_bool(exclude_wal_from_write_fault_injection, false,
  890. "If true, we won't inject write fault when writing to WAL file");
  891. DEFINE_int32(metadata_write_fault_one_in, 1000,
  892. "On non-zero, enables fault injection on metadata write (i.e, "
  893. "directory and file metadata write)");
  894. DEFINE_uint64(user_timestamp_size, 0,
  895. "Number of bytes for a user-defined timestamp. Currently, only "
  896. "8-byte is supported");
  897. DEFINE_bool(persist_user_defined_timestamps, true,
  898. "Flag to indicate whether user-defined timestamps will be persisted"
  899. " during Flush");
  900. DEFINE_int32(open_metadata_read_fault_one_in, 0,
  901. "On non-zero, enables fault injection on file metadata read (i.e, "
  902. "directory and file metadata read)"
  903. "during DB reopen.");
  904. DEFINE_int32(open_metadata_write_fault_one_in, 0,
  905. "On non-zero, enables fault injection on file metadata write "
  906. "during DB reopen.");
  907. DEFINE_string(secondary_cache_uri, "",
  908. "Full URI for creating a customized secondary cache object");
  909. DEFINE_int32(secondary_cache_fault_one_in, 0,
  910. "On non-zero, enables fault injection in secondary cache inserts"
  911. " and lookups");
  912. DEFINE_double(tiered_cache_percent_compressed, 0.0,
  913. "Percentage of total block cache budget to allocate to the "
  914. "compressed cache");
  915. DEFINE_int32(open_write_fault_one_in, 0,
  916. "On non-zero, enables fault injection on file writes "
  917. "during DB reopen.");
  918. DEFINE_int32(open_read_fault_one_in, 0,
  919. "On non-zero, enables fault injection on file reads "
  920. "during DB reopen.");
  921. DEFINE_int32(inject_error_severity, 1,
  922. "The severity of the injected IO Error. 1 is soft error (e.g. "
  923. "retryable error), 2 is fatal error, and the default is "
  924. "retryable error.");
  925. DEFINE_int32(prepopulate_block_cache,
  926. static_cast<int32_t>(ROCKSDB_NAMESPACE::BlockBasedTableOptions::
  927. PrepopulateBlockCache::kDisable),
  928. "Options related to cache warming (see `enum "
  929. "PrepopulateBlockCache` in table.h)");
  930. DEFINE_bool(two_write_queues, false,
  931. "Set to true to enable two write queues. Default: false");
  932. DEFINE_bool(use_only_the_last_commit_time_batch_for_recovery, false,
  933. "If true, the commit-time write batch will not be immediately "
  934. "inserted into the memtables. Default: false");
  935. DEFINE_uint64(
  936. wp_snapshot_cache_bits, 7ull,
  937. "Number of bits to represent write-prepared transaction db's snapshot "
  938. "cache. Default: 7 (128 entries)");
  939. DEFINE_uint64(wp_commit_cache_bits, 23ull,
  940. "Number of bits to represent write-prepared transaction db's "
  941. "commit cache. Default: 23 (8M entries)");
  942. DEFINE_bool(adaptive_readahead, false,
  943. "Carry forward internal auto readahead size from one file to next "
  944. "file at each level during iteration");
  945. DEFINE_bool(
  946. async_io, false,
  947. "Does asynchronous prefetching when internal auto readahead is enabled");
  948. DEFINE_string(wal_compression, "none",
  949. "Algorithm to use for WAL compression. none to disable.");
  950. DEFINE_bool(
  951. verify_sst_unique_id_in_manifest, false,
  952. "Enable DB options `verify_sst_unique_id_in_manifest`, if true, during "
  953. "DB-open try verifying the SST unique id between MANIFEST and SST "
  954. "properties.");
  955. DEFINE_int32(
  956. create_timestamped_snapshot_one_in, 0,
  957. "On non-zero, create timestamped snapshots upon transaction commits.");
  958. DEFINE_bool(allow_data_in_errors,
  959. ROCKSDB_NAMESPACE::Options().allow_data_in_errors,
  960. "If true, allow logging data, e.g. key, value in LOG files.");
  961. DEFINE_bool(enable_thread_tracking,
  962. ROCKSDB_NAMESPACE::Options().enable_thread_tracking,
  963. "If true, the status of the threads involved in this DB will be "
  964. "tracked and available via GetThreadList() API.");
  965. DEFINE_int32(verify_iterator_with_expected_state_one_in, 0,
  966. "If non-zero, when TestIterate() is to be called, there is a "
  967. "1/verify_iterator_with_expected_state_one_in "
  968. "chance that the iterator is verified against the expected state "
  969. "file, instead of comparing keys between two iterators.");
  970. DEFINE_uint64(readahead_size, 0, "Iterator readahead size");
  971. DEFINE_uint64(initial_auto_readahead_size, 0,
  972. "Initial auto readahead size for prefetching during Iteration");
  973. DEFINE_uint64(max_auto_readahead_size, 0,
  974. "Max auto readahead size for prefetching during Iteration");
  975. DEFINE_uint64(
  976. num_file_reads_for_auto_readahead, 0,
  977. "Num of sequential reads to enable auto prefetching during Iteration");
  978. DEFINE_bool(
  979. preserve_unverified_changes, false,
  980. "DB files of the current run will all be preserved in `FLAGS_db`. DB files "
  981. "from the last run will be preserved in `FLAGS_db/unverified` until the "
  982. "first verification succeeds. Expected state files from the last run will "
  983. "be preserved similarly under `FLAGS_expected_values_dir/unverified` when "
  984. "`--expected_values_dir` is nonempty.");
  985. DEFINE_uint64(stats_dump_period_sec,
  986. ROCKSDB_NAMESPACE::Options().stats_dump_period_sec,
  987. "Gap between printing stats to log in seconds");
  988. DEFINE_bool(verification_only, false,
  989. "If true, tests will only execute verification step");
  990. extern "C" bool RocksDbIOUringEnable() { return true; }
  991. DEFINE_uint32(memtable_max_range_deletions, 0,
  992. "If nonzero, RocksDB will try to flush the current memtable"
  993. "after the number of range deletions is >= this limit");
  994. DEFINE_uint32(bottommost_file_compaction_delay, 0,
  995. "Delay kBottommostFiles compaction by this amount of seconds."
  996. "See more in option comment.");
  997. DEFINE_bool(auto_readahead_size, false,
  998. "Does auto tuning of readahead_size when enabled during scans.");
  999. DEFINE_bool(allow_fallocate, ROCKSDB_NAMESPACE::Options().allow_fallocate,
  1000. "Options.allow_fallocate");
  1001. DEFINE_int32(table_cache_numshardbits,
  1002. ROCKSDB_NAMESPACE::Options().table_cache_numshardbits,
  1003. "Options.table_cache_numshardbits");
  1004. DEFINE_uint64(log_readahead_size,
  1005. ROCKSDB_NAMESPACE::Options().log_readahead_size,
  1006. "Options.log_readahead_size");
  1007. DEFINE_uint64(bgerror_resume_retry_interval,
  1008. ROCKSDB_NAMESPACE::Options().bgerror_resume_retry_interval,
  1009. "Options.bgerror_resume_retry_interval");
  1010. DEFINE_uint64(delete_obsolete_files_period_micros,
  1011. ROCKSDB_NAMESPACE::Options().delete_obsolete_files_period_micros,
  1012. "Options.delete_obsolete_files_period_micros");
  1013. DEFINE_uint64(max_log_file_size, ROCKSDB_NAMESPACE::Options().max_log_file_size,
  1014. "Options.max_log_file_sizes");
  1015. DEFINE_uint64(log_file_time_to_roll,
  1016. ROCKSDB_NAMESPACE::Options().log_file_time_to_roll,
  1017. "Options.log_file_time_to_roll");
  1018. DEFINE_bool(use_adaptive_mutex, ROCKSDB_NAMESPACE::Options().use_adaptive_mutex,
  1019. "Options.use_adaptive_mutex");
  1020. DEFINE_bool(advise_random_on_open,
  1021. ROCKSDB_NAMESPACE::Options().advise_random_on_open,
  1022. "Options.advise_random_on_open");
  1023. DEFINE_uint64(WAL_ttl_seconds, ROCKSDB_NAMESPACE::Options().WAL_ttl_seconds,
  1024. "Options.WAL_ttl_seconds");
  1025. DEFINE_uint64(WAL_size_limit_MB, ROCKSDB_NAMESPACE::Options().WAL_size_limit_MB,
  1026. "Options.WAL_size_limit_MB");
  1027. DEFINE_bool(strict_bytes_per_sync,
  1028. ROCKSDB_NAMESPACE::Options().strict_bytes_per_sync,
  1029. "Options.strict_bytes_per_sync");
  1030. DEFINE_bool(avoid_flush_during_shutdown,
  1031. ROCKSDB_NAMESPACE::Options().avoid_flush_during_shutdown,
  1032. "Options.avoid_flush_during_shutdown");
  1033. DEFINE_bool(fill_cache, ROCKSDB_NAMESPACE::ReadOptions().fill_cache,
  1034. "ReadOptions.fill_cache");
  1035. DEFINE_bool(optimize_multiget_for_io,
  1036. ROCKSDB_NAMESPACE::ReadOptions().optimize_multiget_for_io,
  1037. "ReadOptions.optimize_multiget_for_io");
  1038. DEFINE_bool(memtable_insert_hint_per_batch,
  1039. ROCKSDB_NAMESPACE::WriteOptions().memtable_insert_hint_per_batch,
  1040. "WriteOptions.memtable_insert_hint_per_batch");
  1041. DEFINE_bool(dump_malloc_stats, ROCKSDB_NAMESPACE::Options().dump_malloc_stats,
  1042. "Options.dump_malloc_stats");
  1043. DEFINE_uint64(stats_history_buffer_size,
  1044. ROCKSDB_NAMESPACE::Options().stats_history_buffer_size,
  1045. "Options.stats_history_buffer_size");
  1046. DEFINE_bool(skip_stats_update_on_db_open,
  1047. ROCKSDB_NAMESPACE::Options().skip_stats_update_on_db_open,
  1048. "Options.skip_stats_update_on_db_open");
  1049. DEFINE_bool(optimize_filters_for_hits,
  1050. ROCKSDB_NAMESPACE::Options().optimize_filters_for_hits,
  1051. "Options.optimize_filters_for_hits");
  1052. DEFINE_uint64(sample_for_compression,
  1053. ROCKSDB_NAMESPACE::Options().sample_for_compression,
  1054. "Options.sample_for_compression");
  1055. DEFINE_bool(report_bg_io_stats, ROCKSDB_NAMESPACE::Options().report_bg_io_stats,
  1056. "Options.report_bg_io_stats");
  1057. DEFINE_bool(
  1058. cache_index_and_filter_blocks_with_high_priority,
  1059. ROCKSDB_NAMESPACE::BlockBasedTableOptions()
  1060. .cache_index_and_filter_blocks_with_high_priority,
  1061. "BlockBasedTableOptions.cache_index_and_filter_blocks_with_high_priority");
  1062. DEFINE_bool(use_delta_encoding,
  1063. ROCKSDB_NAMESPACE::BlockBasedTableOptions().use_delta_encoding,
  1064. "BlockBasedTableOptions.use_delta_encoding");
  1065. DEFINE_bool(verify_compression,
  1066. ROCKSDB_NAMESPACE::BlockBasedTableOptions().verify_compression,
  1067. "BlockBasedTableOptions.verify_compression");
  1068. DEFINE_uint32(
  1069. read_amp_bytes_per_bit,
  1070. ROCKSDB_NAMESPACE::BlockBasedTableOptions().read_amp_bytes_per_bit,
  1071. "Options.read_amp_bytes_per_bit");
  1072. DEFINE_bool(
  1073. enable_index_compression,
  1074. ROCKSDB_NAMESPACE::BlockBasedTableOptions().enable_index_compression,
  1075. "BlockBasedTableOptions.enable_index_compression");
  1076. DEFINE_uint32(index_shortening,
  1077. static_cast<uint32_t>(
  1078. ROCKSDB_NAMESPACE::BlockBasedTableOptions().index_shortening),
  1079. "BlockBasedTableOptions.index_shortening");
  1080. DEFINE_uint32(metadata_charge_policy,
  1081. static_cast<uint32_t>(ROCKSDB_NAMESPACE::ShardedCacheOptions()
  1082. .metadata_charge_policy),
  1083. "ShardedCacheOptions.metadata_charge_policy");
  1084. DEFINE_bool(use_adaptive_mutex_lru,
  1085. ROCKSDB_NAMESPACE::LRUCacheOptions().use_adaptive_mutex,
  1086. "LRUCacheOptions.use_adaptive_mutex");
  1087. DEFINE_uint32(
  1088. compress_format_version,
  1089. static_cast<uint32_t>(ROCKSDB_NAMESPACE::CompressedSecondaryCacheOptions()
  1090. .compress_format_version),
  1091. "CompressedSecondaryCacheOptions.compress_format_version");
  1092. DEFINE_uint64(manifest_preallocation_size,
  1093. ROCKSDB_NAMESPACE::Options().manifest_preallocation_size,
  1094. "Options.manifest_preallocation_size");
  1095. DEFINE_uint64(max_total_wal_size,
  1096. ROCKSDB_NAMESPACE::Options().max_total_wal_size,
  1097. "Options.max_total_wal_size");
  1098. DEFINE_bool(enable_checksum_handoff, false,
  1099. "If true, include all the supported files in "
  1100. "Options.checksum_handoff_file. Otherwise include no files.");
  1101. DEFINE_double(high_pri_pool_ratio,
  1102. ROCKSDB_NAMESPACE::LRUCacheOptions().high_pri_pool_ratio,
  1103. "LRUCacheOptions.high_pri_pool_ratio");
  1104. DEFINE_double(low_pri_pool_ratio,
  1105. ROCKSDB_NAMESPACE::LRUCacheOptions().low_pri_pool_ratio,
  1106. "LRUCacheOptions.low_pri_pool_ratio");
  1107. DEFINE_uint64(soft_pending_compaction_bytes_limit,
  1108. ROCKSDB_NAMESPACE::Options().soft_pending_compaction_bytes_limit,
  1109. "Options.soft_pending_compaction_bytes_limit");
  1110. DEFINE_uint64(hard_pending_compaction_bytes_limit,
  1111. ROCKSDB_NAMESPACE::Options().hard_pending_compaction_bytes_limit,
  1112. "Options.hard_pending_compaction_bytes_limit");
  1113. DEFINE_bool(enable_sst_partitioner_factory, false,
  1114. "If true, set Options.sst_partitioner_factory to "
  1115. "SstPartitionerFixedPrefixFactory with prefix length equal to 1");
  1116. DEFINE_bool(
  1117. enable_do_not_compress_roles, false,
  1118. "If true, set CompressedSecondaryCacheOptions.do_not_compress_roles to "
  1119. "include all cache roles");
  1120. DEFINE_bool(block_align,
  1121. ROCKSDB_NAMESPACE::BlockBasedTableOptions().block_align,
  1122. "BlockBasedTableOptions.block_align");
  1123. DEFINE_uint64(
  1124. super_block_alignment_size,
  1125. ROCKSDB_NAMESPACE::BlockBasedTableOptions().super_block_alignment_size,
  1126. "BlockBasedTableOptions.super_block_alignment_size");
  1127. DEFINE_uint64(
  1128. super_block_alignment_space_overhead_ratio,
  1129. ROCKSDB_NAMESPACE::BlockBasedTableOptions()
  1130. .super_block_alignment_space_overhead_ratio,
  1131. "BlockBasedTableOptions.super_block_alignment_space_overhead_ratio");
  1132. DEFINE_uint32(
  1133. lowest_used_cache_tier,
  1134. static_cast<uint32_t>(ROCKSDB_NAMESPACE::Options().lowest_used_cache_tier),
  1135. "Options.lowest_used_cache_tier");
  1136. DEFINE_bool(enable_custom_split_merge,
  1137. ROCKSDB_NAMESPACE::CompressedSecondaryCacheOptions()
  1138. .enable_custom_split_merge,
  1139. "CompressedSecondaryCacheOptions.enable_custom_split_merge");
  1140. DEFINE_uint32(
  1141. adm_policy,
  1142. static_cast<uint32_t>(ROCKSDB_NAMESPACE::TieredCacheOptions().adm_policy),
  1143. "TieredCacheOptions.adm_policy");
  1144. DEFINE_string(last_level_temperature, "kUnknown",
  1145. "Options.last_level_temperature");
  1146. DEFINE_string(default_write_temperature, "kUnknown",
  1147. "Options.default_write_temperature");
  1148. DEFINE_string(default_temperature, "kUnknown", "Options.default_temperature");
  1149. DEFINE_bool(enable_memtable_insert_with_hint_prefix_extractor,
  1150. ROCKSDB_NAMESPACE::Options()
  1151. .memtable_insert_with_hint_prefix_extractor != nullptr,
  1152. "If true and FLAGS_prefix_size > 0, set "
  1153. "Options.memtable_insert_with_hint_prefix_extractor to "
  1154. "be Options.prefix_extractor");
  1155. DEFINE_bool(check_multiget_consistency, true,
  1156. "If true, check consistency of MultiGet result by comparing it "
  1157. "with Get's under a snapshot");
  1158. DEFINE_bool(check_multiget_entity_consistency, true,
  1159. "If true, check consistency of MultiGetEntity result by comparing "
  1160. "it GetEntity's under a snapshot");
  1161. DEFINE_bool(inplace_update_support,
  1162. ROCKSDB_NAMESPACE::Options().inplace_update_support,
  1163. "Options.inplace_update_support");
  1164. DEFINE_uint32(uncache_aggressiveness,
  1165. ROCKSDB_NAMESPACE::ColumnFamilyOptions().uncache_aggressiveness,
  1166. "Aggressiveness of erasing cache entries that are likely "
  1167. "obsolete. 0 = disabled, 1 = minimum, 100 = moderate, 10000 = "
  1168. "normal max");
  1169. DEFINE_bool(paranoid_memory_checks,
  1170. ROCKSDB_NAMESPACE::Options().paranoid_memory_checks,
  1171. "Sets CF option paranoid_memory_checks.");
  1172. DEFINE_bool(
  1173. memtable_veirfy_per_key_checksum_on_seek,
  1174. ROCKSDB_NAMESPACE::Options().memtable_veirfy_per_key_checksum_on_seek,
  1175. "Sets CF option memtable_veirfy_per_key_checksum_on_seek.");
  1176. DEFINE_uint32(commit_bypass_memtable_one_in, 0,
  1177. "If greater than zero, transaction option will set "
  1178. "commit_bypass_memtable to per every N transactions on average.");
  1179. // Compaction on deletion trigger flags
  1180. DEFINE_bool(enable_compaction_on_deletion_trigger, false,
  1181. "Enable CompactOnDeletionCollectorFactory for stress testing "
  1182. "deletion-triggered compaction scenarios.");
  1183. DEFINE_uint64(compaction_on_deletion_min_file_size, 32 * 1024,
  1184. "Minimum file size (in bytes) for deletion-triggered compaction. "
  1185. "Files smaller than this will not trigger compaction even if "
  1186. "deletion ratio is exceeded. Default: 32KB");
  1187. DEFINE_int32(compaction_on_deletion_trigger_count, 50,
  1188. "Number of deletions that triggers compaction when deletion "
  1189. "ratio is exceeded. Default: 50");
  1190. DEFINE_int32(compaction_on_deletion_window_size, 100,
  1191. "Size of the sliding window for tracking deletions. "
  1192. "Default: 100");
  1193. DEFINE_double(compaction_on_deletion_ratio, 0.5,
  1194. "Deletion ratio threshold for triggering compaction. "
  1195. "Default: 0.5 (50%)");
  1196. DEFINE_bool(
  1197. auto_refresh_iterator_with_snapshot,
  1198. ROCKSDB_NAMESPACE::ReadOptions().auto_refresh_iterator_with_snapshot,
  1199. "ReadOptions.auto_refresh_iterator_with_snapshot");
  1200. DEFINE_uint32(
  1201. memtable_op_scan_flush_trigger,
  1202. ROCKSDB_NAMESPACE::ColumnFamilyOptions().memtable_op_scan_flush_trigger,
  1203. "Sets CF option memtable_op_scan_flush_trigger.");
  1204. DEFINE_uint32(
  1205. memtable_avg_op_scan_flush_trigger,
  1206. ROCKSDB_NAMESPACE::ColumnFamilyOptions().memtable_avg_op_scan_flush_trigger,
  1207. "Sets CF option memtable_avg_op_scan_flush_trigger.");
  1208. DEFINE_bool(
  1209. universal_reduce_file_locking,
  1210. ROCKSDB_NAMESPACE::ColumnFamilyOptions()
  1211. .compaction_options_universal.reduce_file_locking,
  1212. "Sets "
  1213. "ColumnFamilyOptions().compaciton_options_universal.reduce_file_locking.");
  1214. DEFINE_bool(use_multiscan, false,
  1215. "If set, use the batched MultiScan API for scans.");
  1216. DEFINE_bool(multiscan_use_async_io, false,
  1217. "If set, enable async_io for MultiScan operations.");
  1218. #endif // GFLAGS