1.. _myrocks_server_variables:
2
3========================
4MyRocks Server Variables
5========================
6
7The MyRocks server variables expose configuration
8of the underlying RocksDB engine.
9There several ways to set these variables:
10
11* For production deployments,
12  you should have all variables defined in the configuration file.
13
14* *Dynamic* variables can be changed at runtime using the ``SET`` statement.
15
16* If you want to test things out, you can set some of the variables
17  when starting ``mysqld`` using corresponding command-line options.
18
19If a variable was not set in either the configuration file
20or as a command-line option,
21the default value is used.
22
23Also, all variables can exist in one or both of the following scopes:
24
25* *Global* scope defines how the variable affects overall server operation.
26
27* *Session* scope defines how the variable affects operation
28  for individual client connections.
29
30.. tabularcolumns:: |p{9cm}|p{2cm}|p{2cm}|p{2cm}|
31
32.. list-table::
33   :header-rows: 1
34
35   * - Name
36     - Command Line
37     - Dynamic
38     - Scope
39   * - :variable:`rocksdb_access_hint_on_compaction_start`
40     - Yes
41     - No
42     - Global
43   * - :variable:`rocksdb_advise_random_on_open`
44     - Yes
45     - No
46     - Global
47   * - :variable:`rocksdb_allow_concurrent_memtable_write`
48     - Yes
49     - No
50     - Global
51   * - :variable:`rocksdb_allow_to_start_after_corruption`
52     - Yes
53     - No
54     - Global
55   * - :variable:`rocksdb_allow_mmap_reads`
56     - Yes
57     - No
58     - Global
59   * - :variable:`rocksdb_allow_mmap_writes`
60     - Yes
61     - No
62     - Global
63   * - :variable:`rocksdb_alter_column_default_inplace`
64     - Yes
65     - Yes
66     - Global
67   * - :variable:`rocksdb_base_background_compactions`
68     - Yes
69     - No
70     - Global
71   * - :variable:`rocksdb_blind_delete_primary_key`
72     - Yes
73     - Yes
74     - Global, Session
75   * - :variable:`rocksdb_block_cache_size`
76     - Yes
77     - Yes
78     - Global
79   * - :variable:`rocksdb_block_restart_interval`
80     - Yes
81     - No
82     - Global
83   * - :variable:`rocksdb_block_size`
84     - Yes
85     - No
86     - Global
87   * - :variable:`rocksdb_block_size_deviation`
88     - Yes
89     - No
90     - Global
91   * - :variable:`rocksdb_bulk_load`
92     - Yes
93     - Yes
94     - Global, Session
95   * - :variable:`rocksdb_bulk_load_allow_sk`
96     - Yes
97     - Yes
98     - Global, Session
99   * - :variable:`rocksdb_bulk_load_allow_unsorted`
100     - Yes
101     - Yes
102     - Global, Session
103   * - :variable:`rocksdb_bulk_load_size`
104     - Yes
105     - Yes
106     - Global
107   * - :variable:`rocksdb_bytes_per_sync`
108     - Yes
109     - Yes
110     - Global
111   * - :variable:`rocksdb_cache_dump`
112     - Yes
113     - No
114     - Global
115   * - :variable:`rocksdb_cache_index_and_filter_blocks`
116     - Yes
117     - No
118     - Global
119   * - :variable:`rocksdb_checksums_pct`
120     - Yes
121     - Yes
122     - Global, Session
123   * - :variable:`rocksdb_collect_sst_properties`
124     - Yes
125     - No
126     - Global
127   * - :variable:`rocksdb_commit_in_the_middle`
128     - Yes
129     - Yes
130     - Global
131   * - :variable:`rocksdb_commit_time_batch_for_recovery`
132     - Yes
133     - Yes
134     - Global, Session
135   * - :variable:`rocksdb_compact_cf`
136     - Yes
137     - Yes
138     - Global
139   * - :variable:`rocksdb_compaction_readahead_size`
140     - Yes
141     - Yes
142     - Global
143   * - :variable:`rocksdb_compaction_sequential_deletes`
144     - Yes
145     - Yes
146     - Global
147   * - :variable:`rocksdb_compaction_sequential_deletes_count_sd`
148     - Yes
149     - Yes
150     - Global
151   * - :variable:`rocksdb_compaction_sequential_deletes_file_size`
152     - Yes
153     - Yes
154     - Global
155   * - :variable:`rocksdb_compaction_sequential_deletes_window`
156     - Yes
157     - Yes
158     - Global
159   * - :variable:`rocksdb_concurrent_prepare`
160     - Yes
161     - No
162     - Global
163   * - :variable:`rocksdb_create_checkpoint`
164     - Yes
165     - Yes
166     - Global
167   * - :variable:`rocksdb_create_if_missing`
168     - Yes
169     - No
170     - Global
171   * - :variable:`rocksdb_create_missing_column_families`
172     - Yes
173     - No
174     - Global
175   * - :variable:`rocksdb_datadir`
176     - Yes
177     - No
178     - Global
179   * - :variable:`rocksdb_db_write_buffer_size`
180     - Yes
181     - No
182     - Global
183   * - :variable:`rocksdb_deadlock_detect`
184     - Yes
185     - Yes
186     - Global, Session
187   * - :variable:`rocksdb_deadlock_detect_depth`
188     - Yes
189     - Yes
190     - Global, Session
191   * - :variable:`rocksdb_debug_optimizer_no_zero_cardinality`
192     - Yes
193     - Yes
194     - Global, Session
195   * - :variable:`rocksdb_debug_ttl_ignore_pk`
196     - Yes
197     - Yes
198     - Global
199   * - :variable:`rocksdb_debug_ttl_read_filter_ts`
200     - Yes
201     - Yes
202     - Global
203   * - :variable:`rocksdb_debug_ttl_rec_ts`
204     - Yes
205     - Yes
206     - Global
207   * - :variable:`rocksdb_debug_ttl_snapshot_ts`
208     - Yes
209     - Yes
210     - Global
211   * - :variable:`rocksdb_default_cf_options`
212     - Yes
213     - No
214     - Global
215   * - :variable:`rocksdb_delayed_write_rate`
216     - Yes
217     - Yes
218     - Global
219   * - :variable:`rocksdb_delete_cf`
220     - Yes
221     - Yes
222     - Global
223   * - :variable:`rocksdb_delete_obsolete_files_period_micros`
224     - Yes
225     - No
226     - Global
227   * - :variable:`rocksdb_enable_bulk_load_api`
228     - Yes
229     - No
230     - Global
231   * - :variable:`rocksdb_enable_insert_with_update_caching`
232     - Yes
233     - Yes
234     - Global
235   * - :variable:`rocksdb_enable_iterate_bounds`
236     - Yes
237     - Yes
238     - Global, Local
239   * - :variable:`rocksdb_enable_pipelined_write`
240     - Yes
241     - No
242     - Global
243   * - :variable:`rocksdb_enable_remove_orphaned_dropped_cfs`
244     - Yes
245     - Yes
246     - Global
247   * - :variable:`rocksdb_enable_ttl`
248     - Yes
249     - No
250     - Global
251   * - :variable:`rocksdb_enable_ttl_read_filtering`
252     - Yes
253     - Yes
254     - Global
255   * - :variable:`rocksdb_enable_thread_tracking`
256     - Yes
257     - No
258     - Global
259   * - :variable:`rocksdb_enable_write_thread_adaptive_yield`
260     - Yes
261     - No
262     - Global
263   * - :variable:`rocksdb_error_if_exists`
264     - Yes
265     - No
266     - Global
267   * - :variable:`rocksdb_error_on_suboptimal_collation`
268     - Yes
269     - No
270     - Global
271   * - :variable:`rocksdb_flush_log_at_trx_commit`
272     - Yes
273     - Yes
274     - Global, Session
275   * - :variable:`rocksdb_flush_memtable_on_analyze`
276     - Yes
277     - Yes
278     - Global, Session
279   * - :variable:`rocksdb_force_compute_memtable_stats`
280     - Yes
281     - Yes
282     - Global
283   * - :variable:`rocksdb_force_compute_memtable_stats_cachetime`
284     - Yes
285     - Yes
286     - Global
287   * - :variable:`rocksdb_force_flush_memtable_and_lzero_now`
288     - Yes
289     - Yes
290     - Global
291   * - :variable:`rocksdb_force_flush_memtable_now`
292     - Yes
293     - Yes
294     - Global
295   * - :variable:`rocksdb_force_index_records_in_range`
296     - Yes
297     - Yes
298     - Global, Session
299   * - :variable:`rocksdb_hash_index_allow_collision`
300     - Yes
301     - No
302     - Global
303   * - :variable:`rocksdb_ignore_unknown_options`
304     - Yes
305     - No
306     - Global
307   * - :variable:`rocksdb_index_type`
308     - Yes
309     - No
310     - Global
311   * - :variable:`rocksdb_info_log_level`
312     - Yes
313     - Yes
314     - Global
315   * - :variable:`rocksdb_is_fd_close_on_exec`
316     - Yes
317     - No
318     - Global
319   * - :variable:`rocksdb_keep_log_file_num`
320     - Yes
321     - No
322     - Global
323   * - :variable:`rocksdb_large_prefix`
324     - Yes
325     - Yes
326     - Global
327   * - :variable:`rocksdb_lock_scanned_rows`
328     - Yes
329     - Yes
330     - Global, Session
331   * - :variable:`rocksdb_lock_wait_timeout`
332     - Yes
333     - Yes
334     - Global, Session
335   * - :variable:`rocksdb_log_file_time_to_roll`
336     - Yes
337     - No
338     - Global
339   * - :variable:`rocksdb_manifest_preallocation_size`
340     - Yes
341     - No
342     - Global
343   * - :variable:`rocksdb_manual_compaction_bottommost_level`
344     - Yes
345     - Yes
346     - Global, Session
347   * - :variable:`rocksdb_manual_wal_flush`
348     - Yes
349     - No
350     - Global
351   * - :variable:`rocksdb_master_skip_tx_api`
352     - Yes
353     - Yes
354     - Global, Session
355   * - :variable:`rocksdb_max_background_compactions`
356     - Yes
357     - Yes
358     - Global
359   * - :variable:`rocksdb_max_background_flushes`
360     - Yes
361     - No
362     - Global
363   * - :variable:`rocksdb_max_background_jobs`
364     - Yes
365     - Yes
366     - Global
367   * - :variable:`rocksdb_max_bottom_pri_background_compactions`
368     - Yes
369     - No
370     - Global
371   * - :variable:`rocksdb_max_latest_deadlocks`
372     - Yes
373     - Yes
374     - Global
375   * - :variable:`rocksdb_max_log_file_size`
376     - Yes
377     - No
378     - Global
379   * - :variable:`rocksdb_max_manifest_file_size`
380     - Yes
381     - No
382     - Global
383   * - :variable:`rocksdb_max_open_files`
384     - Yes
385     - No
386     - Global
387   * - :variable:`rocksdb_max_row_locks`
388     - Yes
389     - Yes
390     - Global
391   * - :variable:`rocksdb_max_subcompactions`
392     - Yes
393     - No
394     - Global
395   * - :variable:`rocksdb_max_total_wal_size`
396     - Yes
397     - No
398     - Global
399   * - :variable:`rocksdb_merge_buf_size`
400     - Yes
401     - Yes
402     - Global, Session
403   * - :variable:`rocksdb_merge_combine_read_size`
404     - Yes
405     - Yes
406     - Global, Session
407   * - :variable:`rocksdb_merge_tmp_file_removal_delay_ms`
408     - Yes
409     - Yes
410     - Global, Session
411   * - :variable:`rocksdb_new_table_reader_for_compaction_inputs`
412     - Yes
413     - No
414     - Global
415   * - :variable:`rocksdb_no_block_cache`
416     - Yes
417     - No
418     - Global
419   * - :variable:`rocksdb_no_create_column_family`
420     - Yes
421     - No
422     - Global
423   * - :variable:`rocksdb_override_cf_options`
424     - Yes
425     - No
426     - Global
427   * - :variable:`rocksdb_paranoid_checks`
428     - Yes
429     - No
430     - Global
431   * - :variable:`rocksdb_pause_background_work`
432     - Yes
433     - Yes
434     - Global
435   * - :variable:`rocksdb_perf_context_level`
436     - Yes
437     - Yes
438     - Global, Session
439   * - :variable:`rocksdb_persistent_cache_path`
440     - Yes
441     - No
442     - Global
443   * - :variable:`rocksdb_persistent_cache_size_mb`
444     - Yes
445     - No
446     - Global, Session
447   * - :variable:`rocksdb_pin_l0_filter_and_index_blocks_in_cache`
448     - Yes
449     - No
450     - Global
451   * - :variable:`rocksdb_print_snapshot_conflict_queries`
452     - Yes
453     - Yes
454     - Global
455   * - :variable:`rocksdb_rate_limiter_bytes_per_sec`
456     - Yes
457     - Yes
458     - Global
459   * - :variable:`rocksdb_read_free_rpl`
460     - Yes
461     - Yes
462     - Global
463   * - :variable:`rocksdb_read_free_rpl_tables`
464     - Yes
465     - Yes
466     - Global, Session
467   * - :variable:`rocksdb_records_in_range`
468     - Yes
469     - Yes
470     - Global, Session
471   * - :variable:`rocksdb_reset_stats`
472     - Yes
473     - Yes
474     - Global
475   * - :variable:`rocksdb_rollback_on_timeout`
476     - Yes
477     - Yes
478     - Global
479   * - :variable:`rocksdb_rpl_skip_tx_api`
480     - Yes
481     - Yes
482     - Global
483   * - :variable:`rocksdb_seconds_between_stat_computes`
484     - Yes
485     - Yes
486     - Global
487   * - :variable:`rocksdb_signal_drop_index_thread`
488     - Yes
489     - Yes
490     - Global
491   * - :variable:`rocksdb_sim_cache_size`
492     - Yes
493     - Yes
494     - Global
495   * - :variable:`rocksdb_skip_bloom_filter_on_read`
496     - Yes
497     - Yes
498     - Global, Session
499   * - :variable:`rocksdb_skip_fill_cache`
500     - Yes
501     - Yes
502     - Global, Session
503   * - :variable:`rocksdb_skip_locks_if_skip_unique_check`
504     - Yes
505     - Yes
506     - Global
507   * - :variable:`rocksdb_sst_mgr_rate_bytes_per_sec`
508     - Yes
509     - No
510     - Global
511   * - :variable:`rocksdb_stats_dump_period_sec`
512     - Yes
513     - No
514     - Global
515   * - :variable:`rocksdb_stats_level`
516     - Yes
517     - Yes
518     - Global
519   * - :variable:`rocksdb_stats_recalc_rate`
520     - Yes
521     - Yes
522     - Global, Session
523   * - :variable:`rocksdb_store_row_debug_checksums`
524     - Yes
525     - Yes
526     - Global, Session
527   * - :variable:`rocksdb_strict_collation_check`
528     - Yes
529     - Yes
530     - Global
531   * - :variable:`rocksdb_strict_collation_exceptions`
532     - Yes
533     - Yes
534     - Global
535   * - :variable:`rocksdb_table_cache_numshardbits`
536     - Yes
537     - No
538     - Global
539   * - :variable:`rocksdb_table_stats_background_thread_nice_value`
540     - Yes
541     - Yes
542     - Global
543   * - :variable:`rocksdb_table_stats_max_num_rows_scanned`
544     - Yes
545     - Yes
546     - Global
547   * - :variable:`rocksdb_table_stats_recalc_threshold_count`
548     - Yes
549     - Yes
550     - Global
551   * - :variable:`rocksdb_table_stats_recalc_threshold_pct`
552     - Yes
553     - Yes
554     - Global
555   * - :variable:`rocksdb_table_stats_sampling_pct`
556     - Yes
557     - Yes
558     - Global
559   * - :variable:`rocksdb_table_stats_use_table_scan`
560     - Yes
561     - Yes
562     - Global
563   * - :variable:`rocksdb_tmpdir`
564     - Yes
565     - Yes
566     - Global, Session
567   * - :variable:`rocksdb_two_write_queues`
568     - Yes
569     - No
570     - Global
571   * - :variable:`rocksdb_trace_block_cache_access`
572     - Yes
573     - Yes
574     - Global
575   * - :variable:`rocksdb_trace_queries`
576     - Yes
577     - Yes
578     - Global
579   * - :variable:`rocksdb_trace_sst_api`
580     - Yes
581     - Yes
582     - Global, Session
583   * - :variable:`rocksdb_track_and_verify_wals_in_manifest`
584     - Yes
585     - No
586     - Global
587   * - :variable:`rocksdb_unsafe_for_binlog`
588     - Yes
589     - Yes
590     - Global, Session
591   * - :variable:`rocksdb_update_cf_options`
592     - Yes
593     - Yes
594     - Global
595   * - :variable:`rocksdb_use_adaptive_mutex`
596     - Yes
597     - No
598     - Global
599   * - :variable:`rocksdb_use_default_sk_cf`
600     - Yes
601     - No
602     - Global
603   * - :variable:`rocksdb_use_direct_io_for_flush_and_compaction`
604     - Yes
605     - No
606     - Global
607   * - :variable:`rocksdb_use_direct_reads`
608     - Yes
609     - No
610     - Global
611   * - :variable:`rocksdb_use_fsync`
612     - Yes
613     - No
614     - Global
615   * - :variable:`rocksdb_validate_tables`
616     - Yes
617     - No
618     - Global
619   * - :variable:`rocksdb_verify_row_debug_checksums`
620     - Yes
621     - Yes
622     - Global, Session
623   * - :variable:`rocksdb_wal_bytes_per_sync`
624     - Yes
625     - Yes
626     - Global
627   * - :variable:`rocksdb_wal_dir`
628     - Yes
629     - No
630     - Global
631   * - :variable:`rocksdb_wal_recovery_mode`
632     - Yes
633     - Yes
634     - Global
635   * - :variable:`rocksdb_wal_size_limit_mb`
636     - Yes
637     - No
638     - Global
639   * - :variable:`rocksdb_wal_ttl_seconds`
640     - Yes
641     - No
642     - Global
643   * - :variable:`rocksdb_whole_key_filtering`
644     - Yes
645     - No
646     - Global
647   * - :variable:`rocksdb_write_batch_max_bytes`
648     - Yes
649     - Yes
650     - Global, Session
651   * - :variable:`rocksdb_write_disable_wal`
652     - Yes
653     - Yes
654     - Global, Session
655   * - :variable:`rocksdb_write_ignore_missing_column_families`
656     - Yes
657     - Yes
658     - Global, Session
659   * - :variable:`rocksdb_write_policy`
660     - Yes
661     - No
662     - Global
663
664.. variable:: rocksdb_access_hint_on_compaction_start
665
666  :version 5.7.19-17: Implemented
667  :cli: ``--rocksdb-access-hint-on-compaction-start``
668  :dyn: No
669  :scope: Global
670  :vartype: String or Numeric
671  :default: ``NORMAL`` or ``1``
672
673Specifies the file access pattern once a compaction is started,
674applied to all input files of a compaction.
675Possible values are:
676
677* ``0`` = ``NONE``
678* ``1`` = ``NORMAL`` (default)
679* ``2`` = ``SEQUENTIAL``
680* ``3`` = ``WILLNEED``
681
682.. variable:: rocksdb_advise_random_on_open
683
684  :version 5.7.19-17: Implemented
685  :cli: ``--rocksdb-advise-random-on-open``
686  :dyn: No
687  :scope: Global
688  :vartype: Boolean
689  :default: ``ON``
690
691Specifies whether to hint the underlying file system
692that the file access pattern is random,
693when a data file is opened.
694Enabled by default.
695
696.. variable:: rocksdb_allow_concurrent_memtable_write
697
698  :version 5.7.19-17: Implemented
699  :cli: ``--rocksdb-allow-concurrent-memtable-write``
700  :dyn: No
701  :scope: Global
702  :vartype: Boolean
703  :default: ``OFF``
704
705Specifies whether to allow multiple writers to update memtables in parallel.
706Disabled by default.
707
708.. variable:: rocksdb_allow_to_start_after_corruption
709
710  :version 5.7.21-20: Implemented
711  :cli: ``--rocksdb_allow_to_start_after_corruption``
712  :dyn: No
713  :scope: Global
714  :vartype: Boolean
715  :default: ``OFF``
716
717Specifies whether to allow server to restart once MyRocks reported data
718corruption. Disabled by default.
719
720Once corruption is detected server writes marker file (named
721ROCKSDB_CORRUPTED) in the data directory and aborts. If marker file exists,
722then mysqld exits on startup with an error message. The restart failure will
723continue until the problem is solved or until mysqld is started with this
724variable turned on in the command line.
725
726.. note:: Not all memtables support concurrent writes.
727
728.. variable:: rocksdb_allow_mmap_reads
729
730  :version 5.7.19-17: Implemented
731  :cli: ``--rocksdb-allow-mmap-reads``
732  :dyn: No
733  :scope: Global
734  :vartype: Boolean
735  :default: ``OFF``
736
737Specifies whether to allow the OS to map a data file into memory for reads.
738Disabled by default.
739If you enable this,
740make sure that :variable:`rocksdb_use_direct_reads` is disabled.
741
742.. variable:: rocksdb_allow_mmap_writes
743
744  :version 5.7.19-17: Implemented
745  :cli: ``--rocksdb-allow-mmap-writes``
746  :dyn: No
747  :scope: Global
748  :vartype: Boolean
749  :default: ``OFF``
750
751Specifies whether to allow the OS to map a data file into memory for writes.
752Disabled by default.
753
754.. variable:: rocksdb_alter_column_default_inplace
755
756  :version 5.7.35-38: Implemented
757  :cli: ``--rocksdb-alter-column-default-inplace`
758  :dyn: Yes
759  :scope: Global
760  :vartype: Boolean
761  :default: ``ON``
762
763Allow inplace alter for alter column default operation.
764.. variable:: rocksdb_base_background_compactions
765
766  :version 5.7.19-17: Implemented
767  :version 5.7.20-18: Replaced by :variable:`rocksdb_max_background_jobs`
768  :cli: ``--rocksdb-base-background-compactions``
769  :dyn: No
770  :scope: Global
771  :vartype: Numeric
772  :default: ``1``
773
774Specifies the suggested number of concurrent background compaction jobs,
775submitted to the default LOW priority thread pool in RocksDB.
776Default is ``1``.
777Allowed range of values is from ``-1`` to ``64``.
778Maximum depends on the :variable:`rocksdb_max_background_compactions`
779variable. This variable has been replaced in |Percona Server| :rn:`5.7.20-18`
780by :variable:`rocksdb_max_background_jobs`, which automatically decides how
781many threads to allocate towards flush/compaction.
782
783
784.. variable:: rocksdb_blind_delete_primary_key
785
786   :version 5.7.30-33: Implemented
787   :cli: ``--rocksdb-blind-delete-primary-key``
788   :dyn: Yes
789   :scope: Global, Session
790   :vartype: Boolean
791   :default: ``OFF``
792
793Skips verifying if rows exists before executing deletes. The following conditions
794must be met:
795
796* The variable is enabled
797* Only a single table listed in the ``DELETE`` statement
798* The table has only a primary key with no secondary keys
799
800.. variable:: rocksdb_block_cache_size
801
802  :version 5.7.19-17: Implemented
803  :cli: ``--rocksdb-block-cache-size``
804  :dyn: No
805  :scope: Global
806  :vartype: Numeric
807  :default: ``536870912``
808
809Specifies the size of the LRU block cache for RocksDB.
810This memory is reserved for the block cache,
811which is in addition to any filesystem caching that may occur.
812
813Minimum value is ``1024``,
814because that's the size of one block.
815
816Default value is ``536870912``.
817
818Maximum value is ``9223372036854775807``.
819
820.. variable:: rocksdb_block_restart_interval
821
822  :version 5.7.19-17: Implemented
823  :cli: ``--rocksdb-block-restart-interval``
824  :dyn: No
825  :scope: Global
826  :vartype: Numeric
827  :default: ``16``
828
829Specifies the number of keys for each set of delta encoded data.
830Default value is ``16``.
831Allowed range is from ``1`` to ``2147483647``.
832
833.. variable:: rocksdb_block_size
834
835  :version 5.7.19-17: Implemented
836  :version 5.7.20-18: Minimum value has changed from ``0`` to ``1024``
837  :cli: ``--rocksdb-block-size``
838  :dyn: No
839  :scope: Global
840  :vartype: Numeric
841  :default: ``4096``
842
843Specifies the size of the data block for reading RocksDB data files.
844Default value is ``4096``.
845Allowed range is from ``1024`` to ``18446744073709551615``.
846
847.. variable:: rocksdb_block_size_deviation
848
849  :version 5.7.19-17: Implemented
850  :cli: ``--rocksdb-block-size-deviation``
851  :dyn: No
852  :scope: Global
853  :vartype: Numeric
854  :default: ``10``
855
856Specifies the threshold for free space allowed in a data block
857(see :variable:`rocksdb_block_size`).
858If there is less space remaining,
859close the block (and write to new block).
860Default value is ``10``, meaning that the block is not closed
861until there is less than 10 bits of free space remaining.
862
863Allowed range is from ``1`` to ``2147483647``.
864
865.. variable:: rocksdb_bulk_load_allow_sk
866
867  :version 5.7.23-23: Implemented
868  :cli: ``--rocksdb-bulk-load-allow-sk``
869  :dyn: Yes
870  :scope: Global, Session
871  :vartype: Boolean
872  :default: ``OFF``
873
874Enabling this variable allows secondary keys to be added using the bulk loading
875feature. This variable can be toggled only when bulk load is disabled, i.e.
876when :variable:`rocksdb_bulk_load` is ``OFF``.
877
878.. variable:: rocksdb_bulk_load_allow_unsorted
879
880  :version 5.7.20-18: Implemented
881  :cli: ``--rocksdb-bulk-load-allow-unsorted``
882  :dyn: Yes
883  :scope: Global, Session
884  :vartype: Boolean
885  :default: ``OFF``
886
887By default, the bulk loader requires its input to be sorted in the primary
888key order. If enabled, unsorted inputs are allowed too, which are then
889sorted by the bulkloader itself, at a performance penalty.
890
891.. variable:: rocksdb_bulk_load
892
893  :version 5.7.19-17: Implemented
894  :cli: ``--rocksdb-bulk-load``
895  :dyn: Yes
896  :scope: Global, Session
897  :vartype: Boolean
898  :default: ``OFF``
899
900Specifies whether to use bulk load:
901MyRocks will ignore checking keys for uniqueness
902or acquiring locks during transactions.
903Disabled by default.
904Enable this only if you are certain that there are no row conflicts,
905for example, when setting up a new MyRocks instance from a MySQL dump.
906
907Enabling this variable will also enable
908the :variable:`rocksdb_commit_in_the_middle` variable.
909
910.. variable:: rocksdb_bulk_load_size
911
912  :version 5.7.19-17: Implemented
913  :cli: ``--rocksdb-bulk-load-size``
914  :dyn: Yes
915  :scope: Global. Session
916  :vartype: Numeric
917  :default: ``1000``
918
919Specifies the number of keys to accumulate
920before committing them to the storage engine when bulk load is enabled
921(see :variable:`rocksdb_bulk_load`).
922Default value is ``1000``,
923which means that a batch can contain up to 1000 records
924before they are implicitly committed.
925Allowed range is from ``1`` to ``1073741824``.
926
927.. variable:: rocksdb_bytes_per_sync
928
929  :version 5.7.19-17: Implemented
930  :version 5.7.21-20: Changed to dynamic
931  :cli: ``--rocksdb-bytes-per-sync``
932  :dyn: Yes
933  :scope: Global
934  :vartype: Numeric
935  :default: ``0``
936
937Specifies how often should the OS sync files to disk
938as they are being written, asynchronously, in the background.
939This operation can be used to smooth out write I/O over time.
940Default value is ``0`` meaning that files are never synced.
941Allowed range is up to ``18446744073709551615``.
942
943.. variable:: rocksdb_cache_dump
944
945  :version 5.7.30-33: Implemented
946  :cli: ``-rocksdb-cache-dump``
947  :dyn: No
948  :scope: Global
949  :vartype: Boolean
950  :default: ``ON``
951
952Includes RocksDB block cache content in core dump. This variable is
953enabled by default.
954
955.. variable:: rocksdb_cache_index_and_filter_blocks
956
957  :version 5.7.19-17: Implemented
958  :cli: ``--rocksdb-cache-index-and-filter-blocks``
959  :dyn: No
960  :scope: Global
961  :vartype: Boolean
962  :default: ``ON``
963
964Specifies whether RocksDB should use the block cache for caching the index
965and bloomfilter data blocks from each data file.
966Enabled by default.
967If you disable this feature,
968RocksDB will allocate additional memory to maintain these data blocks.
969
970.. variable:: rocksdb_checksums_pct
971
972  :version 5.7.19-17: Implemented
973  :cli: ``--rocksdb-checksums-pct``
974  :dyn: Yes
975  :scope: Global, Session
976  :vartype: Numeric
977  :default: ``100``
978
979Specifies the percentage of rows to be checksummed.
980Default value is ``100`` (checksum all rows).
981Allowed range is from ``0`` to ``100``.
982
983.. variable:: rocksdb_collect_sst_properties
984
985  :version 5.7.19-17: Implemented
986  :cli: ``--rocksdb-collect-sst-properties``
987  :dyn: No
988  :scope: Global
989  :vartype: Boolean
990  :default: ``ON``
991
992Specifies whether to collect statistics on each data file
993to improve optimizer behavior.
994Enabled by default.
995
996.. variable:: rocksdb_commit_in_the_middle
997
998  :version 5.7.19-17: Implemented
999  :cli: ``--rocksdb-commit-in-the-middle``
1000  :dyn: Yes
1001  :scope: Global
1002  :vartype: Boolean
1003  :default: ``OFF``
1004
1005Specifies whether to commit rows implicitly
1006when a batch contains more than the value of
1007:variable:`rocksdb_bulk_load_size`.
1008This is disabled by default
1009and will be enabled if :variable:`rocksdb_bulk_load` is enabled.
1010
1011.. variable:: rocksdb_commit_time_batch_for_recovery
1012
1013  :version 5.7.23-23: Implemented
1014  :cli: ``--rocksdb-commit-time-batch-for-recovery``
1015  :dyn: Yes
1016  :scope: Global, Session
1017  :vartype: Boolean
1018  :default: ``OFF``
1019
1020Specifies whether to write the commit time write batch into the database or
1021not.
1022
1023.. note:: If the commit time write batch is only useful for recovery, then
1024          writing to WAL is enough.
1025
1026.. variable:: rocksdb_compact_cf
1027
1028  :version 5.7.19-17: Implemented
1029  :cli: ``--rocksdb-compact-cf``
1030  :dyn: Yes
1031  :scope: Global
1032  :vartype: String
1033  :default:
1034
1035Specifies the name of the column family to compact.
1036
1037.. variable:: rocksdb_compaction_readahead_size
1038
1039  :version 5.7.19-17: Implemented
1040  :cli: ``--rocksdb-compaction-readahead-size``
1041  :dyn: Yes
1042  :scope: Global
1043  :vartype: Numeric
1044  :default: ``0``
1045
1046Specifies the size of reads to perform ahead of compaction.
1047Default value is ``0``.
1048Set this to at least 2 megabytes (``16777216``)
1049when using MyRocks with spinning disks
1050to ensure sequential reads instead of random.
1051Maximum allowed value is ``18446744073709551615``.
1052
1053.. note:: If you set this variable to a non-zero value,
1054   :variable:`rocksdb_new_table_reader_for_compaction_inputs` is enabled.
1055
1056.. variable:: rocksdb_compaction_sequential_deletes
1057
1058  :version 5.7.19-17: Implemented
1059  :cli: ``--rocksdb-compaction-sequential-deletes``
1060  :dyn: Yes
1061  :scope: Global
1062  :vartype: Numeric
1063  :default: ``0``
1064
1065Specifies the threshold to trigger compaction on a file
1066if it has more than this number of sequential delete markers.
1067Default value is ``0`` meaning that compaction is not triggered
1068regardless of the number of delete markers.
1069Maximum allowed value is ``2000000`` (two million delete markers).
1070
1071.. note:: Depending on workload patterns,
1072   MyRocks can potentially maintain large numbers of delete markers,
1073   which increases latency of queries.
1074   This compaction feature will reduce latency,
1075   but may also increase the MyRocks write rate.
1076   Use this variable together with
1077   :variable:`rocksdb_compaction_sequential_deletes_file_size`
1078   to only perform compaction on large files.
1079
1080.. variable:: rocksdb_compaction_sequential_deletes_count_sd
1081
1082  :version 5.7.19-17: Implemented
1083  :cli: ``--rocksdb-compaction-sequential-deletes-count-sd``
1084  :dyn: Yes
1085  :scope: Global
1086  :vartype: Boolean
1087  :default: ``OFF``
1088
1089Specifies whether to count single deletes as delete markers
1090recognized by :variable:`rocksdb_compaction_sequential_deletes`.
1091Disabled by default.
1092
1093.. variable:: rocksdb_compaction_sequential_deletes_file_size
1094
1095  :version 5.7.19-17: Implemented
1096  :cli: ``--rocksdb-compaction-sequential-deletes-file-size``
1097  :dyn: Yes
1098  :scope: Global
1099  :vartype: Numeric
1100  :default: ``0``
1101
1102Specifies the minimum file size required to trigger compaction on it
1103by :variable:`rocksdb_compaction_sequential_deletes`.
1104Default value is ``0``,
1105meaning that compaction is triggered regardless of file size.
1106Allowed range is from ``-1`` to ``9223372036854775807``.
1107
1108.. variable:: rocksdb_compaction_sequential_deletes_window
1109
1110  :version 5.7.19-17: Implemented
1111  :cli: ``--rocksdb-compaction-sequential-deletes-window``
1112  :dyn: Yes
1113  :scope: Global
1114  :vartype: Numeric
1115  :default: ``0``
1116
1117Specifies the size of the window for counting delete markers
1118by :variable:`rocksdb_compaction_sequential_deletes`.
1119Default value is ``0``.
1120Allowed range is up to ``2000000`` (two million).
1121
1122.. variable:: rocksdb_concurrent_prepare
1123
1124  :version 5.7.20-18: Implemented
1125  :cli: ``--rocksdb-concurrent_prepare``
1126  :dyn: No
1127  :scope: Global
1128  :vartype: Boolean
1129  :default: ``ON``
1130
1131When enabled this variable allows/encourages threads that are using
1132two-phase commit to ``prepare`` in parallel. Variable has been
1133deprecated in the |Percona Server| 5.7.21-20, as it has been
1134renamed in upstream to :variable:`rocksdb_two_write_queues`.
1135
1136.. variable:: rocksdb_create_checkpoint
1137
1138  :version 5.7.19-17: Implemented
1139  :cli: ``--rocksdb-create-checkpoint``
1140  :dyn: Yes
1141  :scope: Global
1142  :vartype: String
1143  :default:
1144
1145Specifies the directory where MyRocks should create a checkpoint.
1146Empty by default.
1147
1148.. variable:: rocksdb_create_if_missing
1149
1150  :version 5.7.19-17: Implemented
1151  :cli: ``--rocksdb-create-if-missing``
1152  :dyn: No
1153  :scope: Global
1154  :vartype: Boolean
1155  :default: ``ON``
1156
1157Specifies whether MyRocks should create its database if it does not exist.
1158Enabled by default.
1159
1160.. variable:: rocksdb_create_missing_column_families
1161
1162  :version 5.7.19-17: Implemented
1163  :cli: ``--rocksdb-create-missing-column-families``
1164  :dyn: No
1165  :scope: Global
1166  :vartype: Boolean
1167  :default: ``OFF``
1168
1169Specifies whether MyRocks should create new column families
1170if they do not exist.
1171Disabled by default.
1172
1173.. variable:: rocksdb_datadir
1174
1175  :version 5.7.19-17: Implemented
1176  :cli: ``--rocksdb-datadir``
1177  :dyn: No
1178  :scope: Global
1179  :vartype: String
1180  :default: ``./.rocksdb``
1181
1182Specifies the location of the MyRocks data directory.
1183By default, it is created in the current working directory.
1184
1185.. variable:: rocksdb_db_write_buffer_size
1186
1187  :version 5.7.19-17: Implemented
1188  :cli: ``--rocksdb-db-write-buffer-size``
1189  :dyn: No
1190  :scope: Global
1191  :vartype: Numeric
1192  :default: ``0``
1193
1194Specifies the maximum size of all memtables used to store writes in MyRocks
1195across all column families. When this size is reached, the data is flushed
1196to persistent media.
1197The default value is ``0``.
1198The allowed range is up to ``18446744073709551615``.
1199
1200.. variable:: rocksdb_deadlock_detect
1201
1202  :version 5.7.19-17: Implemented
1203  :cli: ``--rocksdb-deadlock-detect``
1204  :dyn: Yes
1205  :scope: Global, Session
1206  :vartype: Boolean
1207  :default: ``OFF``
1208
1209Specifies whether MyRocks should detect deadlocks.
1210Disabled by default.
1211
1212.. variable:: rocksdb_deadlock_detect_depth
1213
1214  :version 5.7.20-18: Implemented
1215  :cli: ``--rocksdb-deadlock-detect-depth``
1216  :dyn: Yes
1217  :scope: Global, Session
1218  :vartype: Numeric
1219  :default: ``50``
1220
1221Specifies the number of transactions deadlock detection will traverse
1222through before assuming deadlock.
1223
1224.. variable:: rocksdb_debug_optimizer_no_zero_cardinality
1225
1226  :version 5.7.19-17: Implemented
1227  :cli: ``--rocksdb-debug-optimizer-no-zero-cardinality``
1228  :dyn: Yes
1229  :scope: Global
1230  :vartype: Boolean
1231  :default: ``ON``
1232
1233Specifies whether MyRocks should prevent zero cardinality
1234by always overriding it with some value.
1235
1236.. variable:: rocksdb_debug_ttl_ignore_pk
1237
1238  :version 5.7.20-18: Implemented
1239  :cli: ``--rocksdb-debug-ttl-ignore-pk``
1240  :dyn: Yes
1241  :scope: Global
1242  :vartype: Boolean
1243  :default: ``OFF``
1244
1245For debugging purposes only. If true, compaction filtering will not occur
1246on Primary Key TTL data. This variable is a no-op in non-debug builds.
1247
1248.. variable:: rocksdb_debug_ttl_read_filter_ts
1249
1250  :version 5.7.20-18: Implemented
1251  :cli: ``--rocksdb_debug-ttl-read-filter-ts``
1252  :dyn: Yes
1253  :scope: Global
1254  :vartype: Numeric
1255  :default: ``0``
1256
1257For debugging purposes only.  Overrides the TTL read
1258filtering time to time + :variable:`debug_ttl_read_filter_ts`.
1259A value of ``0`` denotes that the variable is not set.
1260This variable is a no-op in non-debug builds.
1261
1262.. variable:: rocksdb_debug_ttl_rec_ts
1263
1264  :version 5.7.20-18: Implemented
1265  :cli: ``--rocksdb-debug-ttl-rec-ts``
1266  :dyn: Yes
1267  :scope: Global
1268  :vartype: Numeric
1269  :default: ``0``
1270
1271For debugging purposes only.  Overrides the TTL of
1272records to ``now()`` + :variable:`debug_ttl_rec_ts`.
1273The value can be +/- to simulate a record inserted in the past vs a record
1274inserted in the "future". A value of ``0`` denotes that the
1275variable is not set.
1276This variable is a no-op in non-debug builds.
1277
1278.. variable:: rocksdb_debug_ttl_snapshot_ts
1279
1280  :version 5.7.20-18: Implemented
1281  :cli: ``--rocksdb_debug_ttl_ignore_pk``
1282  :dyn: Yes
1283  :scope: Global
1284  :vartype: Numeric
1285  :default: ``0``
1286
1287For debugging purposes only.  Sets the snapshot during
1288compaction to ``now()`` + :variable:`rocksdb_debug_set_ttl_snapshot_ts`.
1289The value can be +/- to simulate a snapshot in the past vs a
1290snapshot created in the "future". A value of ``0`` denotes
1291that the variable is not set. This variable is a no-op in
1292non-debug builds.
1293
1294.. variable:: rocksdb_default_cf_options
1295
1296  :version 5.7.19-17: Implemented
1297  :cli: ``--rocksdb-default-cf-options``
1298  :dyn: No
1299  :scope: Global
1300  :vartype: String
1301  :default:
1302
1303Specifies the default column family options for MyRocks.
1304Empty by default.
1305
1306.. variable:: rocksdb_delayed_write_rate
1307
1308  :version 5.7.19-17: Implemented
1309  :cli: ``--rocksdb-delayed-write-rate``
1310  :dyn: Yes
1311  :scope: Global
1312  :vartype: Numeric
1313  :default: ``16777216``
1314
1315Specifies the write rate in bytes per second, which should be used
1316if MyRocks hits a soft limit or threshold for writes.
1317Default value is ``16777216`` (16 MB/sec).
1318Allowed range is from ``0`` to ``18446744073709551615``.
1319
1320.. variable:: rocksdb_delete_cf
1321
1322  :version 5.7.30-33: Implemented
1323  :cli: ``--rocksdb-delete-cf``
1324  :dyn: Yes
1325  :scope: Global
1326  :vartype: String
1327  :default: ""
1328
1329Deletes the column family by name. The default value is "", an empty
1330string.
1331
1332For example: ::
1333
1334    SET @@global.ROCKSDB_DELETE_CF = 'cf_primary_key';
1335
1336.. variable:: rocksdb_delete_obsolete_files_period_micros
1337
1338  :version 5.7.19-17: Implemented
1339  :cli: ``--rocksdb-delete-obsolete-files-period-micros``
1340  :dyn: No
1341  :scope: Global
1342  :vartype: Numeric
1343  :default: ``21600000000``
1344
1345Specifies the period in microseconds to delete obsolete files
1346regardless of files removed during compaction.
1347Default value is ``21600000000`` (6 hours).
1348Allowed range is up to ``9223372036854775807``.
1349
1350.. variable:: rocksdb_enable_bulk_load_api
1351
1352  :version 5.7.19-17: Implemented
1353  :cli: ``--rocksdb-enable-bulk-load-api``
1354  :dyn: No
1355  :scope: Global
1356  :vartype: Boolean
1357  :default: ``ON``
1358
1359Specifies whether to use the ``SSTFileWriter`` feature for bulk loading,
1360This feature bypasses the memtable,
1361but requires keys to be inserted into the table
1362in either ascending or descending order.
1363Enabled by default.
1364If disabled, bulk loading uses the normal write path via the memtable
1365and does not require keys to be inserted in any order.
1366
1367.. variable:: rocksdb_enable_insert_with_update_caching
1368
1369   :version 5.7.30-33: Implemented
1370   :cli: ``--rocksdb-enable-insert-with-update-caching``
1371   :dyn: Yes
1372   :scope: Global
1373   :vartype: Boolean
1374   :default: ``ON``
1375
1376Specifies whether to enable optimization where the read is cached from a
1377failed insertion attempt in INSERT ON DUPLICATE KEY UPDATE.. variable:: rocksdb_enable_iterate_bounds
1378
1379.. variable:: rocksdb_enable_iterate_bounds
1380
1381  :version 5.7.30-33: Implemented
1382  :cli: ``--rocksdb-enable-iterate-bounds``
1383  :dyn: Yes
1384  :scope: Global, Local
1385  :vartype: Boolean
1386  :default: ``TRUE``
1387
1388Enables the rocksdb iterator upper bounds and lower bounds in read options.
1389
1390The default value is ``TRUE``.
1391
1392.. variable:: rocksdb_enable_pipelined_write
1393
1394    :version 5.7.35-38: Implemented
1395    :cli: ``--rocksdb-enable-pipelined-write``
1396    :dyn: No
1397    :scope: Global
1398    :vartype: Boolean
1399    :default: ``OFF``
1400
1401DBOptions::enable_pipelined_write for RocksDB.
1402
1403If ``enable_pipelined_write`` is ``true``, a separate write thread is maintained for WAL write and memtable write. A write thread first enters the WAL writer queue and then the memtable writer queue. A pending thread on the WAL writer queue only waits for the previous WAL write operations but does not wait for memtable write operations. Enabling the feature may improve write throughput and reduce latency of the prepare phase of a two-phase commit.
1404
1405.. variable:: rocksdb_enable_remove_orphaned_dropped_cfs
1406
1407  :version 5.7.30-33: Implemented
1408  :cli: ``--rocksdb-enable-remove-orphaned-dropped-cfs``
1409  :dyn: Yes
1410  :scope: Global
1411  :vartype: Boolean
1412  :default: ``TRUE``
1413
1414Enables the removal of dropped column families (cfs) from metadata if the cfs do
1415not exist in the cf manager.
1416
1417The default value is ``TRUE``.
1418
1419.. variable:: rocksdb_enable_ttl
1420
1421  :version 5.7.19-17: Implemented
1422  :cli: ``--rocksdb-enable-ttl``
1423  :dyn: No
1424  :scope: Global
1425  :vartype: Boolean
1426  :default: ``ON``
1427
1428Specifies whether to keep expired TTL records during compaction.
1429Enabled by default.
1430If disabled, expired TTL records will be dropped during compaction.
1431
1432.. variable:: rocksdb_enable_ttl_read_filtering
1433
1434  :version 5.7.20-18: Implemented
1435  :cli: ``--rocksdb-enable-ttl-read-filtering``
1436  :dyn: Yes
1437  :scope: Global
1438  :vartype: Boolean
1439  :default: ``ON``
1440
1441For tables with TTL, expired records are skipped/filtered
1442out during processing and in query results. Disabling
1443this will allow these records to be seen, but as a result
1444rows may disappear in the middle of transactions as they
1445are dropped during compaction. **Use with caution.**
1446
1447.. variable:: rocksdb_enable_thread_tracking
1448
1449  :version 5.7.19-17: Implemented
1450  :cli: ``--rocksdb-enable-thread-tracking``
1451  :dyn: No
1452  :scope: Global
1453  :vartype: Boolean
1454  :default: ``OFF``
1455
1456Specifies whether to enable tracking the status of threads
1457accessing the database.
1458Disabled by default.
1459If enabled, thread status will be available via ``GetThreadList()``.
1460
1461.. variable:: rocksdb_enable_write_thread_adaptive_yield
1462
1463  :version 5.7.19-17: Implemented
1464  :cli: ``--rocksdb-enable-write-thread-adaptive-yield``
1465  :dyn: No
1466  :scope: Global
1467  :vartype: Boolean
1468  :default: ``OFF``
1469
1470Specifies whether the MyRocks write batch group leader
1471should wait up to the maximum allowed time
1472before blocking on a mutex.
1473Disabled by default.
1474Enable it to increase throughput for concurrent workloads.
1475
1476.. variable:: rocksdb_error_if_exists
1477
1478  :version 5.7.19-17: Implemented
1479  :cli: ``--rocksdb-error-if-exists``
1480  :dyn: No
1481  :scope: Global
1482  :vartype: Boolean
1483  :default: ``OFF``
1484
1485Specifies whether to report an error when a database already exists.
1486Disabled by default.
1487
1488.. variable:: rocksdb_error_on_suboptimal_collation
1489
1490  :version 5.7.23-23: Implemented
1491  :cli: ``--rocksdb-error-on-suboptimal-collation``
1492  :dyn: No
1493  :scope: Global
1494  :vartype: Boolean
1495  :default: ``ON``
1496
1497Specifies whether to report an error instead of a warning if an index is
1498created on a char field where the table has a sub-optimal collation (case
1499insensitive). Enabled by default.
1500
1501.. variable:: rocksdb_flush_log_at_trx_commit
1502
1503  :version 5.7.19-17: Implemented
1504  :cli: ``--rocksdb-flush-log-at-trx-commit``
1505  :dyn: Yes
1506  :scope: Global, Session
1507  :vartype: Numeric
1508  :default: ``1``
1509
1510Specifies whether to sync on every transaction commit,
1511similar to `innodb_flush_log_at_trx_commit <https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_flush_log_at_trx_commit>`__.
1512Enabled by default, which ensures ACID compliance.
1513
1514
1515Possible values:
1516
1517* ``0``: Do not sync on transaction commit.
1518  This provides better performance, but may lead to data inconsistency
1519  in case of a crash.
1520
1521* ``1``: Sync on every transaction commit.
1522  This is set by default and recommended
1523  as it ensures data consistency,
1524  but reduces performance.
1525
1526* ``2``: Sync every second.
1527
1528.. variable:: rocksdb_flush_memtable_on_analyze
1529
1530  :version 5.7.19-17: Implemented
1531  :version 5.7.21-20: Variable removed
1532  :cli: ``--rocksdb-flush-memtable-on-analyze``
1533  :dyn: Yes
1534  :scope: Global, Session
1535  :vartype: Boolean
1536  :default: ``ON``
1537
1538Specifies whether to flush the memtable when running ``ANALYZE`` on a table.
1539Enabled by default.
1540This ensures accurate cardinality
1541by including data in the memtable for calculating stats.
1542
1543.. variable:: rocksdb_force_compute_memtable_stats
1544
1545  :version 5.7.19-17: Implemented
1546  :cli: ``--rocksdb-force-compute-memtable-stats``
1547  :dyn: Yes
1548  :scope: Global
1549  :vartype: Boolean
1550  :default: ``ON``
1551
1552Specifies whether data in the memtables should be included
1553for calculating index statistics
1554used by the query optimizer.
1555Enabled by default.
1556This provides better accuracy, but may reduce performance.
1557
1558.. variable:: rocksdb_force_compute_memtable_stats_cachetime
1559
1560  :version 5.7.20-18: Implemented
1561  :cli: ``--rocksdb-force-compute-memtable-stats-cachetime``
1562  :dyn: Yes
1563  :scope: Global
1564  :vartype: Numeric
1565  :default: 60000000
1566
1567Specifies for how long the cached value of memtable statistics should
1568be used instead of computing it every time during the query plan analysis.
1569
1570.. variable:: rocksdb_force_flush_memtable_and_lzero_now
1571
1572  :version 5.7.19-17: Implemented
1573  :cli: ``--rocksdb-force-flush-memtable-and-lzero-now``
1574  :dyn: Yes
1575  :scope: Global
1576  :vartype: Boolean
1577  :default: ``OFF``
1578
1579Works similar to :variable:`force_flush_memtable_now`
1580but also flushes all L0 files.
1581
1582.. variable:: rocksdb_force_flush_memtable_now
1583
1584  :version 5.7.19-17: Implemented
1585  :cli: ``--rocksdb-force-flush-memtable-now``
1586  :dyn: Yes
1587  :scope: Global
1588  :vartype: Boolean
1589  :default: ``OFF``
1590
1591Forces MyRocks to immediately flush all memtables out to data files.
1592
1593.. warning:: Use with caution!
1594   Write requests will be blocked until all memtables are flushed.
1595
1596.. variable:: rocksdb_force_index_records_in_range
1597
1598  :version 5.7.19-17: Implemented
1599  :cli: ``--rocksdb-force-index-records-in-range``
1600  :dyn: Yes
1601  :scope: Global, Session
1602  :vartype: Numeric
1603  :default: ``1``
1604
1605Specifies the value used to override the number of rows
1606returned to query optimizer when ``FORCE INDEX`` is used.
1607Default value is ``1``.
1608Allowed range is from ``0`` to ``2147483647``.
1609Set to ``0`` if you do not want to override the returned value.
1610
1611.. variable:: rocksdb_hash_index_allow_collision
1612
1613  :version 5.7.19-17: Implemented
1614  :cli: ``--rocksdb-hash-index-allow-collision``
1615  :dyn: No
1616  :scope: Global
1617  :vartype: Boolean
1618  :default: ``ON``
1619
1620Specifies whether hash collisions are allowed.
1621Enabled by default, which uses less memory.
1622If disabled, full prefix is stored to prevent hash collisions.
1623
1624.. variable:: rocksdb_ignore_unknown_options
1625
1626  :version 5.7.20-18: Implemented
1627  :cli: ``--rocksdb-ignore-unknown-options``
1628  :dyn: No
1629  :scope: Global
1630  :vartype: Boolean
1631  :default: ``ON``
1632
1633When enabled, it allows RocksDB to receive unknown options and not exit.
1634
1635.. variable:: rocksdb_index_type
1636
1637  :version 5.7.19-17: Implemented
1638  :cli: ``--rocksdb-index-type``
1639  :dyn: No
1640  :scope: Global
1641  :vartype: Enum
1642  :default: ``kBinarySearch``
1643
1644Specifies the type of indexing used by MyRocks:
1645
1646* ``kBinarySearch``: Binary search (default).
1647
1648* ``kHashSearch``: Hash search.
1649
1650.. variable:: rocksdb_info_log_level
1651
1652  :version 5.7.19-17: Implemented
1653  :cli: ``--rocksdb-info-log-level``
1654  :dyn: Yes
1655  :scope: Global
1656  :vartype: Enum
1657  :default: ``error_level``
1658
1659Specifies the level for filtering messages written by MyRocks
1660to the ``mysqld`` log.
1661
1662* ``debug_level``: Maximum logging (everything including debugging
1663  log messages)
1664* ``info_level``
1665* ``warn_level``
1666* ``error_level`` (default)
1667* ``fatal_level``: Minimum logging (only fatal error messages logged)
1668
1669.. variable:: rocksdb_is_fd_close_on_exec
1670
1671  :version 5.7.19-17: Implemented
1672  :cli: ``--rocksdb-is-fd-close-on-exec``
1673  :dyn: No
1674  :scope: Global
1675  :vartype: Boolean
1676  :default: ``ON``
1677
1678Specifies whether child processes should inherit open file jandles.
1679Enabled by default.
1680
1681.. variable:: rocksdb_large_prefix
1682
1683  :version 5.7.20-18: Implemented
1684  :cli: ``--rocksdb-large-prefix``
1685  :dyn: Yes
1686  :scope: Global
1687  :vartype: Boolean
1688  :default: ``OFF``
1689
1690When enabled, this option allows index key prefixes longer than 767 bytes
1691(up to 3072 bytes). This option mirrors the `innodb_large_prefix
1692<https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix>`_
1693The values for :variable:`rocksdb_large_prefix` should be the same between
1694source and replica.
1695
1696.. variable:: rocksdb_keep_log_file_num
1697
1698  :version 5.7.19-17: Implemented
1699  :cli: ``--rocksdb-keep-log-file-num``
1700  :dyn: No
1701  :scope: Global
1702  :vartype: Numeric
1703  :default: ``1000``
1704
1705Specifies the maximum number of info log files to keep.
1706Default value is ``1000``.
1707Allowed range is from ``1`` to ``18446744073709551615``.
1708
1709.. variable:: rocksdb_lock_scanned_rows
1710
1711  :version 5.7.19-17: Implemented
1712  :cli: ``--rocksdb-lock-scanned-rows``
1713  :dyn: Yes
1714  :scope: Global, Session
1715  :vartype: Boolean
1716  :default: ``OFF``
1717
1718Specifies whether to hold the lock on rows that are scanned during ``UPDATE``
1719and not actually updated.
1720Disabled by default.
1721
1722.. variable:: rocksdb_lock_wait_timeout
1723
1724  :version 5.7.19-17: Implemented
1725  :cli: ``--rocksdb-lock-wait-timeout``
1726  :dyn: Yes
1727  :scope: Global, Session
1728  :vartype: Numeric
1729  :default: ``1``
1730
1731Specifies the number of seconds MyRocks should wait to acquire a row lock
1732before aborting the request.
1733Default value is ``1``.
1734Allowed range is up to ``1073741824``.
1735
1736.. variable:: rocksdb_log_file_time_to_roll
1737
1738  :version 5.7.19-17: Implemented
1739  :cli: ``--rocksdb-log-file-time-to-roll``
1740  :dyn: No
1741  :scope: Global
1742  :vartype: Numeric
1743  :default: ``0``
1744
1745Specifies the period (in seconds) for rotating the info log files.
1746Default value is ``0``, meaning that the log file is not rotated.
1747Allowed range is up to ``18446744073709551615``.
1748
1749.. variable:: rocksdb_manifest_preallocation_size
1750
1751  :version 5.7.19-17: Implemented
1752  :cli: ``--rocksdb-manifest-preallocation-size``
1753  :dyn: No
1754  :scope: Global
1755  :vartype: Numeric
1756  :default: ``0``
1757
1758Specifies the number of bytes to preallocate for the MANIFEST file
1759used by MyRocks to store information
1760about column families, levels, active files, etc.
1761Default value is ``0``.
1762Allowed range is up to ``18446744073709551615``.
1763
1764.. note:: A value of ``4194304`` (4 MB) is reasonable
1765   to reduce random I/O on XFS.
1766
1767.. variable:: rocksdb_manual_compaction_bottommost_level
1768
1769  :version 5.7.35-38: Implemented
1770  :cli: ``--rocksdb-manual-compaction-bottommost-level``
1771  :dyn: Yes
1772  :scope: Global, Session
1773  :vartype: Enum
1774  :default: ``kForceOptimized``
1775
1776Option for skipping bottommost level compaction during manual compaction. The values are the following:
1777
1778* ``kSkip`` - Skip bottommost level compaction
1779
1780* ``kIfHaveCompactionFilter`` - Only compact the bottommost level if there is a compaction filter
1781
1782* ``kForce`` - Always compact the bottommost level
1783
1784* ``kForceOptimized`` - The default value. Always compact the bottommost level but in the bottommost level avoid double-compacting files created
1785
1786.. variable:: rocksdb_manual_wal_flush
1787
1788  :version 5.7.20-18: Implemented
1789  :cli: ``--rocksdb-manual-wal-flush``
1790  :dyn: No
1791  :scope: Global
1792  :vartype: Boolean
1793  :default: ``ON``
1794
1795This variable can be used to disable automatic/timed WAL flushing and instead
1796rely on the application to do the flushing.
1797
1798.. variable:: rocksdb_master_skip_tx_api
1799
1800   :version 5.7.30-33: Implemented
1801   :cli: ``--rocksdb-master-skip-tx-api``
1802   :dyn: Yes
1803   :scope: Global, Session
1804   :vartype: Boolean
1805   :default: ``OFF``
1806
1807When enabled, uses the WriteBatch API, which is faster. The session does not
1808hold any lock on row access. This variable is not effective on replica.
1809
1810.. note::
1811
1812    Due to the disabled row locks, improper use of the variable can cause data
1813    corruption or inconsistency.
1814
1815.. variable:: rocksdb_max_background_compactions
1816
1817  :version 5.7.19-17: Implemented
1818  :version 5.7.20-18: Replaced by :variable:`rocksdb_max_background_jobs`
1819  :version 5.7.31-34: Re-implemented
1820  :cli: ``--rocksdb-max-background-compactions``
1821  :dyn: Yes
1822  :scope: Global
1823  :vartype: Numeric
1824  :default: ``-1``
1825
1826Sets DBOptions:: max_background_compactions for RocksDB.
1827Default value is ``-1``. Allowed range is up to ``64``.
1828This variable has been replaced in |Percona Server| :rn:`5.7.20-18`
1829by :variable:`rocksdb_max_background_jobs`, which automatically decides how
1830many threads to allocate towards flush/compaction.
1831This variable has been re-implemented in |Percona Server| 5.7.31-34.
1832
1833.. variable:: rocksdb_max_background_flushes
1834
1835  :version 5.7.19-17: Implemented
1836  :version 5.7.20-18: Replaced by :variable:`rocksdb_max_background_jobs`
1837  :version 5.7.31-34: Re-implemented
1838  :cli: ``--rocksdb-max-background-flushes``
1839  :dyn: No
1840  :scope: Global
1841  :vartype: Numeric
1842  :default: ``-1``
1843
1844Sets DBOptions:: max_background_flushes for RocksDB.
1845Default value is ``-1``. Allowed range is up to ``64``.
1846This variable has been replaced in |Percona Server| :rn:`5.7.20-18`
1847by :variable:`rocksdb_max_background_jobs`, which automatically decides how
1848many threads to allocate towards flush/compaction.
1849This variable has been re-implemented in |Percona Server| 5.7.31-34.
1850
1851.. variable:: rocksdb_max_background_jobs
1852
1853  :version 5.7.20-18: Implemented
1854  :cli: ``--rocksdb-max-background-jobs``
1855  :dyn: Yes
1856  :scope: Global
1857  :vartype: Numeric
1858  :default: ``2``
1859
1860This variable has been introduced in |Percona Server| :rn:`5.7.20-18`
1861to replace :variable:`rocksdb_base_background_compactions`,
1862:variable:`rocksdb_max_background_compactions`, and
1863:variable:`rocksdb_max_background_flushes` variables. This variable specifies
1864the maximum number of background jobs. It automatically decides
1865how many threads to allocate towards flush/compaction. It was implemented to
1866reduce the number of (confusing) options users and can tweak and push the
1867responsibility down to RocksDB level.
1868
1869.. variable:: rocksdb_max_bottom_pri_background_compactions
1870
1871  :version: 5.7.31-34: Implemented
1872  :cli: ``--rocksdb_max_bottom_pri_background_compactions``
1873  :dyn: No
1874  :vartype: Unsigned Integer
1875  :default: ``0``
1876
1877Creates a specified number of threads, sets a lower CPU priority, and letting compactions use them. The maximum compaction concurrency is capped by ``rocksdb_max_background_compactions`` or ``rocksdb_max_background_jobs``
1878
1879The minimum value is ``0`` and the maximum value is ``64``.
1880
1881.. variable:: rocksdb_max_latest_deadlocks
1882
1883  :version 5.7.20-18: Implemented
1884  :cli: ``--rocksdb-max-latest-deadlocks``
1885  :dyn: Yes
1886  :scope: Global
1887  :vartype: Numeric
1888  :default: ``5``
1889
1890Specifies the maximum number of recent deadlocks to store.
1891
1892.. variable:: rocksdb_max_log_file_size
1893
1894  :version 5.7.19-17: Implemented
1895  :cli: ``--rocksdb-max-log-file-size``
1896  :dyn: No
1897  :scope: Global
1898  :vartype: Numeric
1899  :default: ``0``
1900
1901Specifies the maximum size for info log files,
1902after which the log is rotated.
1903Default value is ``0``, meaning that only one log file is used.
1904Allowed range is up to ``18446744073709551615``.
1905
1906Also see :variable:`rocksdb_log_file_time_to_roll`.
1907
1908.. variable:: rocksdb_max_manifest_file_size
1909
1910  :version 5.7.19-17: Implemented
1911  :cli: ``--rocksdb-manifest-log-file-size``
1912  :dyn: No
1913  :scope: Global
1914  :vartype: Numeric
1915  :default: ``18446744073709551615``
1916
1917Specifies the maximum size of the MANIFEST data file,
1918after which it is rotated.
1919Default value is also the maximum, making it practically unlimited:
1920only one manifest file is used.
1921
1922.. variable:: rocksdb_max_open_files
1923
1924  :version 5.7.19-17: Implemented
1925  :version 5.7.19-17: Default value changed to ``1000``
1926  :cli: ``--rocksdb-max-open-files``
1927  :dyn: No
1928  :scope: Global
1929  :vartype: Numeric
1930  :default: ``1000``
1931
1932Specifies the maximum number of file handles opened by MyRocks.
1933Values in the range between ``0`` and ``open_files_limit``
1934are taken as they are. If :variable:`rocksdb_max_open_files` value is
1935greater than ``open_files_limit``, it will be reset to 1/2 of
1936``open_files_limit``, and a warning will be emitted to the ``mysqld``
1937error log. A value of ``-2`` denotes auto tuning: just sets
1938:variable:`rocksdb_max_open_files` value to 1/2 of ``open_files_limit``.
1939Finally, ``-1`` means no limit, i.e. an infinite number of file handles.
1940
1941.. warning::
1942
1943  Setting :variable:`rocksdb_max_open_files` to ``-1`` is dangerous,
1944  as server may quickly run out of file handles in this case.
1945
1946.. variable:: rocksdb_max_row_locks
1947
1948  :version 5.7.19-17: Implemented
1949  :version 5.7.21-21: Default value has changed from ``1073741824`` to ``1048576``
1950  :version 5.7.32-35: Scope changed to ``Global``
1951  :cli: ``--rocksdb-max-row-locks``
1952  :dyn: Yes
1953  :scope: Global
1954  :vartype: Numeric
1955  :default: ``1048576``
1956
1957Specifies the limit on the maximum number of row locks a transaction can have
1958before it fails.
1959Default value is also the maximum, making it practically unlimited:
1960transactions never fail due to row locks.
1961
1962.. variable:: rocksdb_max_subcompactions
1963
1964  :version 5.7.19-17: Implemented
1965  :cli: ``--rocksdb-max-subcompactions``
1966  :dyn: No
1967  :scope: Global
1968  :vartype: Numeric
1969  :default: ``1``
1970
1971Specifies the maximum number of threads allowed for each compaction job.
1972Default value of ``1`` means no subcompactions (one thread per compaction job).
1973Allowed range is up to ``64``.
1974
1975.. variable:: rocksdb_max_total_wal_size
1976
1977  :version 5.7.19-17: Implemented
1978  :cli: ``--rocksdb-max-total-wal-size``
1979  :dyn: No
1980  :scope: Global
1981  :vartype: Numeric
1982  :default: ``0``
1983
1984Specifies the maximum total size of WAL (write-ahead log) files,
1985after which memtables are flushed.
1986Default value is ``0``: WAL size limit is chosen dynamically.
1987Allowed range is up to ``9223372036854775807``.
1988
1989.. variable:: rocksdb_merge_buf_size
1990
1991  :version 5.7.19-17: Implemented
1992  :cli: ``--rocksdb-merge-buf-size``
1993  :dyn: Yes
1994  :scope: Global, Session
1995  :vartype: Numeric
1996  :default: ``67108864``
1997
1998Specifies the size (in bytes) of the merge-sort buffers
1999used to accumulate data during secondary key creation.
2000New entries are written directly to the lowest level in the database,
2001instead of updating indexes through the memtable and L0.
2002These values are sorted using merge-sort,
2003with buffers set to 64 MB by default (``67108864``).
2004Allowed range is from ``100`` to ``18446744073709551615``.
2005
2006.. variable:: rocksdb_merge_combine_read_size
2007
2008  :version 5.7.19-17: Implemented
2009  :cli: ``--rocksdb-merge-combine-read-size``
2010  :dyn: Yes
2011  :scope: Global, Session
2012  :vartype: Numeric
2013  :default: ``1073741824``
2014
2015Specifies the size (in bytes) of the merge-combine buffer
2016used for the merge-sort algorithm
2017as described in :variable:`rocksdb_merge_buf_size`.
2018Default size is 1 GB (``1073741824``).
2019Allowed range is from ``100`` to ``18446744073709551615``.
2020
2021.. variable:: rocksdb_merge_tmp_file_removal_delay_ms
2022
2023  :version 5.7.20-18: Implemented
2024  :cli: ``--rocksdb_merge_tmp_file_removal_delay_ms``
2025  :dyn: Yes
2026  :scope: Global, Session
2027  :vartype: Numeric
2028  :default: ``0``
2029
2030Fast secondary index creation creates merge files when needed. After finishing
2031secondary index creation, merge files are removed. By default, the file removal
2032is done without any sleep, so removing GBs of merge files within <1s may
2033happen, which will cause trim stalls on Flash. This variable can be used to
2034rate limit the delay in milliseconds.
2035
2036.. variable:: rocksdb_new_table_reader_for_compaction_inputs
2037
2038  :version 5.7.19-17: Implemented
2039  :cli: ``--rocksdb-new-table-reader-for-compaction-inputs``
2040  :dyn: No
2041  :scope: Global
2042  :vartype: Boolean
2043  :default: ``OFF``
2044
2045Specifies whether MyRocks should create a new file descriptor and table reader
2046for each compaction input.
2047Disabled by default.
2048Enabling this may increase memory consumption,
2049but will also allow pre-fetch options to be specified for compaction
2050input files without impacting table readers used for user queries.
2051
2052.. variable:: rocksdb_no_block_cache
2053
2054  :version 5.7.19-17: Implemented
2055  :cli: ``--rocksdb-no-block-cache``
2056  :dyn: No
2057  :scope: Global
2058  :vartype: Boolean
2059  :default: ``OFF``
2060
2061Specifies whether to disable the block cache for column families.
2062Variable is disabled by default,
2063meaning that using the block cache is allowed.
2064
2065.. variable:: rocksdb_no_create_column_family
2066
2067  :version 5.7.23-24: Implemented
2068  :cli: ``--rocksdb-no-create-column-family``
2069  :dyn: No
2070  :scope: Global
2071  :vartype: Boolean
2072  :default: ``OFF``
2073
2074Specifies whether column families can created implicitly via an index comment.
2075If this variable is set to ``ON``, then column families must already exist or
2076must be present within the :variable:`rocksdb_override_cf_options` for a user to
2077assign and index to a column family.
2078
2079.. variable:: rocksdb_override_cf_options
2080
2081  :version 5.7.19-17: Implemented
2082  :cli: ``--rocksdb-override-cf-options``
2083  :dyn: No
2084  :scope: Global
2085  :vartype: String
2086  :default:
2087
2088Specifies option overrides for each column family.
2089Empty by default.
2090
2091.. variable:: rocksdb_paranoid_checks
2092
2093  :version 5.7.19-17: Implemented
2094  :cli: ``--rocksdb-paranoid-checks``
2095  :dyn: No
2096  :scope: Global
2097  :vartype: Boolean
2098  :default: ``ON``
2099
2100Specifies whether MyRocks should re-read the data file
2101as soon as it is created to verify correctness.
2102Enabled by default.
2103
2104.. variable:: rocksdb_pause_background_work
2105
2106  :version 5.7.19-17: Implemented
2107  :cli: ``--rocksdb-pause-background-work``
2108  :dyn: Yes
2109  :scope: Global
2110  :vartype: Boolean
2111  :default: ``OFF``
2112
2113Specifies whether MyRocks should pause all background operations.
2114Disabled by default. There is no practical reason for a user to ever
2115use this variable because it is intended as a test synchronization tool
2116for the MyRocks MTR test suites.
2117
2118.. warning::
2119
2120  If someone were to set a :variable:`rocksdb_force_flush_memtable_now` to
2121  ``1`` while :variable:`rocksdb_pause_background_work` is set to ``1``,
2122  the client that issued the ``rocksdb_force_flush_memtable_now=1`` will be
2123  blocked indefinitely until :variable:`rocksdb_pause_background_work`
2124  is set to ``0``.
2125
2126.. variable:: rocksdb_perf_context_level
2127
2128  :version 5.7.19-17: Implemented
2129  :cli: ``--rocksdb-perf-context-level``
2130  :dyn: Yes
2131  :scope: Global, Session
2132  :vartype: Numeric
2133  :default: ``0``
2134
2135Specifies the level of information to capture with the Perf Context plugins.
2136Default value is ``0``.
2137Allowed range is up to ``4``.
2138
2139.. variable:: rocksdb_persistent_cache_path
2140
2141  :version 5.7.19-17: Implemented
2142  :cli: ``--rocksdb-persistent-cache-path``
2143  :dyn: No
2144  :scope: Global
2145  :vartype: String
2146  :default:
2147
2148Specifies the path to the persistent cache.
2149Set this together with :variable:`rocksdb_persistent_cache_size_mb`.
2150
2151.. variable:: rocksdb_persistent_cache_size_mb
2152
2153  :version 5.7.19-17: Implemented
2154  :cli: ``--rocksdb-persistent-cache-size-mb``
2155  :dyn: No
2156  :scope: Global
2157  :vartype: Numeric
2158  :default: ``0``
2159
2160Specifies the size of the persisten cache in megabytes.
2161Default is ``0`` (persistent cache disabled).
2162Allowed range is up to ``18446744073709551615``.
2163Set this together with :variable:`rocksdb_persistent_cache_path`.
2164
2165.. variable:: rocksdb_pin_l0_filter_and_index_blocks_in_cache
2166
2167  :version 5.7.19-17: Implemented
2168  :cli: ``--rocksdb-pin-l0-filter-and-index-blocks-in-cache``
2169  :dyn: No
2170  :scope: Global
2171  :vartype: Boolean
2172  :default: ``ON``
2173
2174Specifies whether MyRocks pins the filter and index blocks in the cache
2175if :variable:`rocksdb_cache_index_and_filter_blocks` is enabled.
2176Enabled by default.
2177
2178.. variable:: rocksdb_print_snapshot_conflict_queries
2179
2180  :version 5.7.19-17: Implemented
2181  :cli: ``--rocksdb-print-snapshot-conflict-queries``
2182  :dyn: Yes
2183  :scope: Global
2184  :vartype: Boolean
2185  :default: ``OFF``
2186
2187Specifies whether queries that generate snapshot conflicts
2188should be logged to the error log.
2189Disabled by default.
2190
2191.. variable:: rocksdb_rate_limiter_bytes_per_sec
2192
2193  :version 5.7.19-17: Implemented
2194  :cli: ``--rocksdb-rate-limiter-bytes-per-sec``
2195  :dyn: Yes
2196  :scope: Global
2197  :vartype: Numeric
2198  :default: ``0``
2199
2200Specifies the maximum rate at which MyRocks can write to media
2201via memtable flushes and compaction.
2202Default value is ``0`` (write rate is not limited).
2203Allowed range is up to ``9223372036854775807``.
2204
2205.. variable:: rocksdb_read_free_rpl
2206
2207  :version 5.7.30-33: Implemented
2208  :cli: ``--rocksdb-read-free-rpl``
2209  :dyn: Yes
2210  :scope: Global
2211  :vartype: Enum
2212  :default: ``OFF``
2213
2214Use read-free replication, which allows no row lookup during
2215replication, on the replica.
2216
2217The options are the following:
2218
2219* OFF - Disables the variable
2220* PK_SK - Enables the variable on all tables with a primary key
2221* PK_ONLY - Enables the variable on tables where the only key is the primary key
2222
2223.. variable:: rocksdb_read_free_rpl_tables
2224
2225  :version 5.7.30-33: Disabled
2226  :version 5.7.19-17: Implemented
2227  :cli: ``--rocksdb-read-free-rpl-tables``
2228  :dyn: Yes
2229  :scope: Global, Session
2230  :vartype: String
2231  :default:
2232
2233Lists tables (as a regular expression)
2234that should use read-free replication on the replica
2235(that is, replication without row lookups).
2236Empty by default.
2237
2238This variable is disabled in |Percona Server| 5.7.30-33. We recommend
2239that you use ``rocksdb_read_free_rpl`` instead of this variable.
2240
2241.. variable:: rocksdb_records_in_range
2242
2243  :version 5.7.19-17: Implemented
2244  :cli: ``--rocksdb-records-in-range``
2245  :dyn: Yes
2246  :scope: Global, Session
2247  :vartype: Numeric
2248  :default: ``0``
2249
2250Specifies the value to override the result of ``records_in_range()``.
2251Default value is ``0``.
2252Allowed range is up to ``2147483647``.
2253
2254.. variable:: rocksdb_reset_stats
2255
2256  :version 5.7.19-17: Implemented
2257  :cli: ``--rocksdb-reset-stats``
2258  :dyn: Yes
2259  :scope: Global
2260  :vartype: Boolean
2261  :default: ``OFF``
2262
2263Resets MyRocks internal statistics dynamically
2264(without restarting the server).
2265
2266.. variable:: rocksdb_rollback_on_timeout
2267
2268   :version 5.7.30-33: Implemented
2269   :cli: ``--rocksdb-rollback-on-timeout``
2270   :dyn: Yes
2271   :scope: Global
2272   :vartype: Boolean
2273   :default: ``OFF``
2274
2275By default, only the last statement on a transaction is rolled back. If
2276``--rocksdb-rollback-on-timeout=ON``, a transaction timeout causes a rollback of
2277the entire transaction.
2278
2279.. variable:: rocksdb_rpl_skip_tx_api
2280
2281  :version 5.7.19-17: Implemented
2282  :version 5.7.20-19: Variable removed
2283  :version 5.7.21-21: Re-implemented
2284  :cli: ``--rocksdb-rpl-skip-tx-api``
2285  :dyn: No
2286  :scope: Global
2287  :vartype: Boolean
2288  :default: ``OFF``
2289
2290Specifies whether write batches should be used for replication thread
2291instead of the transaction API.
2292Disabled by default.
2293
2294There are two conditions which are necessary to
2295use it: row replication format and replica
2296operating in super read only mode.
2297
2298.. variable:: rocksdb_seconds_between_stat_computes
2299
2300  :version 5.7.19-17: Implemented
2301  :cli: ``--rocksdb-seconds-between-stat-computes``
2302  :dyn: Yes
2303  :scope: Global
2304  :vartype: Numeric
2305  :default: ``3600``
2306
2307Specifies the number of seconds to wait
2308between recomputation of table statistics for the optimizer.
2309During that time, only changed indexes are updated.
2310Default value is ``3600``.
2311Allowed is from ``0`` to ``4294967295``.
2312
2313.. variable:: rocksdb_signal_drop_index_thread
2314
2315  :version 5.7.19-17: Implemented
2316  :cli: ``--rocksdb-signal-drop-index-thread``
2317  :dyn: Yes
2318  :scope: Global
2319  :vartype: Boolean
2320  :default: ``OFF``
2321
2322Signals the MyRocks drop index thread to wake up.
2323
2324.. variable:: rocksdb_sim_cache_size
2325
2326  :version 5.7.20-18: Implemented
2327  :cli: ``--rocksdb-sim-cache-size``
2328  :dyn: No
2329  :scope: Global
2330  :vartype: Numeric
2331  :default: ``0``
2332
2333Enables the simulated cache, which allows us to figure out the hit/miss rate
2334with a specific cache size without changing the real block cache.
2335
2336.. variable:: rocksdb_skip_bloom_filter_on_read
2337
2338  :version 5.7.19-17: Implemented
2339  :cli: ``--rocksdb-skip-bloom-filter-on_read``
2340  :dyn: Yes
2341  :scope: Global, Session
2342  :vartype: Boolean
2343  :default: ``OFF``
2344Specifies whether bloom filters should be skipped on reads.
2345Disabled by default (bloom filters are not skipped).
2346
2347.. variable:: rocksdb_skip_fill_cache
2348
2349  :version 5.7.19-17: Implemented
2350  :cli: ``--rocksdb-skip-fill-cache``
2351  :dyn: Yes
2352  :scope: Global, Session
2353  :vartype: Boolean
2354  :default: ``OFF``
2355
2356Specifies whether to skip caching data on read requests.
2357Disabled by default (caching is not skipped).
2358
2359.. variable:: rocksdb_skip_locks_if_skip_unique_check
2360
2361  :version 5.7.35-38: Implemented
2362  :cli: ``--rocksdb-skip-locks-if-skip-unique-check``
2363  :dyn: Yes
2364  :scope: Global
2365  :vartype: Boolean
2366  :default: OFF
2367
2368Skips row locking when unique checks are disabled.
2369
2370.. variable:: rocksdb_sst_mgr_rate_bytes_per_sec
2371
2372  :version 5.7.19-17: Implemented
2373  :version 5.7.20-18: Default value changed from ``67108864`` to ``0``
2374  :cli: ``--rocksdb-sst-mgr-rate-bytes-per-sec``
2375  :dyn: Yes
2376  :scope: Global, Session
2377  :vartype: Numeric
2378  :default: ``0``
2379
2380Specifies the maximum rate for writing to data files.
2381Default value is ``0``. This option is not effective on HDD.
2382Allowed range is from ``0`` to ``18446744073709551615``.
2383
2384.. variable:: rocksdb_stats_dump_period_sec
2385
2386  :version 5.7.19-17: Implemented
2387  :cli: ``--rocksdb-stats-dump-period-sec``
2388  :dyn: No
2389  :scope: Global
2390  :vartype: Numeric
2391  :default: ``600``
2392
2393Specifies the period in seconds for performing a dump of the MyRocks statistics
2394to the info log.
2395Default value is ``600``.
2396Allowed range is up to ``2147483647``.
2397
2398.. variable:: rocksdb_stats_level
2399
2400  :version 5.7.30-33: Implemented
2401  :cli: ``--rocksdb-stats-level``
2402  :dyn: Yes
2403  :scope: Global
2404  :vartype: Numeric
2405  :default: ``0``
2406
2407Controls the RocksDB statistics level. The default value is "0" (kExceptHistogramOrTimers),
2408 which is the fastest level. The maximum value is "4".
2409
2410.. variable:: rocksdb_stats_recalc_rate
2411
2412  :version 5.7.23-23: Implemented
2413  :cli: ``--rocksdb-stats-recalc-rate``
2414  :dyn: No
2415  :scope: Global
2416  :vartype: Numeric
2417  :default: ``0``
2418
2419Specifies the number of indexes to recalculate per second. Recalculating index
2420statistics periodically ensures it to match the actual sum from SST files.
2421Default value is ``0``. Allowed range is up to ``4294967295``.
2422
2423.. variable:: rocksdb_store_row_debug_checksums
2424
2425  :version 5.7.19-17: Implemented
2426  :cli: ``--rocksdb-store-row-debug-checksums``
2427  :dyn: Yes
2428  :scope: Global, Session
2429  :vartype: Boolean
2430  :default: ``OFF``
2431
2432Specifies whether to include checksums when writing index or table records.
2433Disabled by default.
2434
2435.. variable:: rocksdb_strict_collation_check
2436
2437  :version 5.7.19-17: Implemented
2438  :cli: ``--rocksdb-strict-collation-check``
2439  :dyn: Yes
2440  :scope: Global
2441  :vartype: Boolean
2442  :default: ``ON``
2443
2444Specifies whether to check and verify
2445that table indexes have proper collation settings.
2446Enabled by default.
2447
2448.. variable:: rocksdb_strict_collation_exceptions
2449
2450  :version 5.7.19-17: Implemented
2451  :cli: ``--rocksdb-strict-collation-exceptions``
2452  :dyn: Yes
2453  :scope: Global
2454  :vartype: String
2455  :default:
2456
2457Lists tables (as a regular expression) that should be excluded
2458from verifying case-sensitive collation
2459enforced by :variable:`rocksdb_strict_collation_check`.
2460Empty by default.
2461
2462.. variable:: rocksdb_table_cache_numshardbits
2463
2464  :version 5.7.19-17: Implemented
2465  :version 5.7.20-18: Max value changed from ``2147483647`` to ``19``
2466  :cli: ``--rocksdb-table-cache-numshardbits``
2467  :dyn: No
2468  :scope: Global
2469  :vartype: Numeric
2470  :default: ``6``
2471
2472Specifies the number if table caches.
2473Default value is ``6``.
2474Allowed range is from ``0`` to ``19``.
2475
2476.. variable:: rocksdb_table_stats_background_thread_nice_value
2477
2478   :version 5.7.30-33: Implemented
2479   :cli: ``--rocksdb-table-stats-background-thread-nice-value``
2480   :dyn: Yes
2481   :scope: Global
2482   :vartype: Numeric
2483   :default: ``19``
2484
2485The nice value for index stats.
2486The minimum = -20 (THREAD_PRIO_MIN)
2487The maximum = 19 (THREAD_PRIO_MAX)
2488
2489.. variable:: rocksdb_table_stats_max_num_rows_scanned
2490
2491   :version 5.7.30-33: Implemented
2492   :cli: ``--rocksdb-table-stats-max-num-rows-scanned``
2493   :dyn: Yes
2494   :scope: Global
2495   :vartype: Numeric
2496   :default: ``0``
2497
2498The maximum number of rows to scan in a table scan based on
2499a cardinality calculation.
2500The minimum is ``0`` (every modification triggers a stats recalculation).
2501The maximum is ``18,446,744,073,709,551,615``.
2502
2503.. variable:: rocksdb_table_stats_recalc_threshold_count
2504
2505   :version 5.7.30-33: Implemented
2506   :cli: ``--rocksdb-table-stats-recalc-threshold-count``
2507   :dyn: Yes
2508   :scope: Global
2509   :vartype: Numeric
2510   :default: ``100``
2511
2512The number of modified rows to trigger a stats recalculation. This is a
2513dependent variable for stats recalculation.
2514The minimum is ``0``.
2515The maximum is ``18,446,744,073,709,551,615``.
2516
2517.. variable:: rocksdb_table_stats_recalc_threshold_pct
2518
2519   :version 5.7.30-33: Implemented
2520   :cli: ``--rocksdb-table-stats-recalc-threshold-pct``
2521   :dyn: Yes
2522   :scope: Global
2523   :vartype: Numeric
2524   :default: ``10``
2525
2526The percentage of the number of modified rows over the total number of rows
2527to trigger stats recalculations. This is a dependent variable for stats
2528recalculation.
2529The minimum value is ``0``
2530The maximum value is ``100`` (RDB_TBL_STATS_RECALC_THRESHOLD_PCT_MAX).
2531
2532.. variable:: rocksdb_table_stats_sampling_pct
2533
2534  :version 5.7.19-17: Implemented
2535  :cli: ``--rocksdb-table-stats-sampling-pct``
2536  :dyn: Yes
2537  :scope: Global
2538  :vartype: Numeric
2539  :default: ``10``
2540
2541Specifies the percentage of entries to sample
2542when collecting statistics about table properties.
2543Default value is ``10``.
2544Allowed range is from ``0`` to ``100``.
2545
2546.. variable:: rocksdb_table_stats_use_table_scan
2547
2548  :version 5.7.30-33: Implemented
2549  :cli: ``--rocksdb-table-stats-use-table-scan``
2550  :dyn: Yes
2551  :scope: Global
2552  :vartype: Boolean
2553  :default: ``FALSE``
2554
2555Enables table-scan-based index calculations.
2556The default value is ``FALSE``.
2557
2558.. variable:: rocksdb_tmpdir
2559
2560  :version 5.7.19-17: Implemented
2561  :cli: ``--rocksdb-tmpdir``
2562  :dyn: Yes
2563  :scope: Global, Session
2564  :vartype: String
2565  :default:
2566
2567Specifies the path to the directory for temporary files during DDL operations.
2568
2569.. variable:: rocksdb_trace_block_cache_access
2570
2571   :version 5.7.30-33: Implemented
2572   :cli: ``--rocksdb-trace-block-cache-access``
2573   :dyn: Yes
2574   :scope: Global
2575   :vartype: String
2576   :default: ``""``
2577
2578Defines the block cache trace option string. The format is
2579"sampling frequency: max_trace_file_size:trace_file_name." The
2580sampling frequency value and max_trace_file_size value
2581are positive integers. The block accesses are saved to
2582the ``rocksdb_datadir/block_cache_traces/trace_file_name``.
2583The default value is ``""``, an empty string.
2584
2585.. variable:: rocksdb_trace_queries
2586
2587  :version 5.7.35-38: Implemented
2588  :cli: ``--rocksdb-trace-queries``
2589  :dyn: Yes
2590  :scope: Global
2591  :vartype: String
2592  :default: ""
2593
2594Trace option string. The format is sampling_frequency:max_trace_file_size:trace_file_name. The sampling_frequency value and max_trace_file_size value are positive integers. The queries are saved to the rocksdb_datadir/queries_traces/trace_file_name.
2595
2596The file size unit is measured in bytes.
2597
2598The sampling frequency specifies that one request is sampled from ``sampling_frequency`` requests. If the request is ``1``, all the requests are traced. If the request is ``5``, then for every five requests, one request is traced.
2599
2600.. variable:: rocksdb_trace_sst_api
2601
2602  :version 5.7.19-17: Implemented
2603  :cli: ``--rocksdb-trace-sst-api``
2604  :dyn: Yes
2605  :scope: Global, Session
2606  :vartype: Boolean
2607  :default: ``OFF``
2608
2609Specifies whether to generate trace output in the log
2610for each call to ``SstFileWriter``.
2611Disabled by default.
2612
2613.. variable:: rocksdb_track_and_verify_wals_in_manifest
2614
2615  :version 5.7.35-38: Implemented
2616  :cli: ``--rocksdb-track-and-verify-wals-in-manifest``
2617  :dyn: No
2618  :scope: Global
2619  :vartype: Boolean
2620  :default: ``ON``
2621
2622DBOptions::track_and_verify_wals_in_manifest for RocksDB
2623
2624If true, the log numbers and sizes of the synced WALs are tracked in Manifest, then, during a DB recovery, if a synced WAL is missing from the disk, or the size of the WAL does not match the recorded size in Manifest, an error is reported adn the recovery is aborted.
2625
2626.. note::
2627
2628    This option does not work with a secondary instance.
2629
2630.. variable:: rocksdb_two_write_queues
2631
2632  :version 5.7.21-20: Implemented
2633  :cli: ``--rocksdb-two_write_queues``
2634  :dyn: No
2635  :scope: Global
2636  :vartype: Boolean
2637  :default: ``ON``
2638
2639When enabled this variable allows/encourages threads that are using
2640two-phase commit to ``prepare`` in parallel.
2641
2642.. variable:: rocksdb_unsafe_for_binlog
2643
2644  :version 5.7.19-17: Implemented
2645  :cli: ``--rocksdb-unsafe-for-binlog``
2646  :dyn: Yes
2647  :scope: Global, Session
2648  :vartype: Boolean
2649  :default: ``OFF``
2650
2651Specifies whether to allow statement-based binary logging
2652which may break consistency.
2653Disabled by default.
2654
2655.. variable:: rocksdb_update_cf_options
2656
2657  :version 5.7.19-17: Implemented
2658  :cli: ``--rocksdb-update-cf-options``
2659  :dyn: No
2660  :scope: Global
2661  :vartype: String
2662  :default:
2663
2664Specifies option updates for each column family.
2665Empty by default.
2666
2667.. variable:: rocksdb_use_adaptive_mutex
2668
2669  :version 5.7.19-17: Implemented
2670  :cli: ``--rocksdb-use-adaptive-mutex``
2671  :dyn: No
2672  :scope: Global
2673  :vartype: Boolean
2674  :default: ``OFF``
2675
2676Specifies whether to use adaptive mutex
2677which spins in user space before resorting to the kernel.
2678Disabled by default.
2679
2680.. variable:: rocksdb_use_default_sk_cf
2681
2682  :version 5.7.32-35: Implemented
2683  :cli: ``--rocksdb-use-default-sk-cf``
2684  :dyn: No
2685  :scope: Global
2686  :vartype: Boolean
2687  :default: OFF
2688
2689Use ``default_sk`` column family for secondary keys.
2690
2691.. variable:: rocksdb_use_direct_io_for_flush_and_compaction
2692
2693  :version 5.7.19-17: Implemented
2694  :cli: ``--rocksdb-use-direct-io-for-flush-and-compaction``
2695  :dyn: No
2696  :scope: Global
2697  :vartype: Boolean
2698  :default: ``OFF``
2699
2700Specifies whether to write to data files directly,
2701without caches or buffers.
2702Disabled by default.
2703
2704.. variable:: rocksdb_use_direct_reads
2705
2706  :version 5.7.19-17: Implemented
2707  :cli: ``--rocksdb-use-direct-reads``
2708  :dyn: No
2709  :scope: Global
2710  :vartype: Boolean
2711  :default: ``OFF``
2712
2713Specifies whether to read data files directly,
2714without caches or buffers.
2715Disabled by default.
2716If you enable this,
2717make sure that :variable:`rocksdb_allow_mmap_reads` is disabled.
2718
2719.. variable:: rocksdb_use_fsync
2720
2721  :version 5.7.19-17: Implemented
2722  :cli: ``--rocksdb-use-fsync``
2723  :dyn: No
2724  :scope: Global
2725  :vartype: Boolean
2726  :default: ``OFF``
2727
2728Specifies whether MyRocks should use ``fsync`` instead of ``fdatasync``
2729when requesting a sync of a data file.
2730Disabled by default.
2731
2732.. variable:: rocksdb_validate_tables
2733
2734  :version 5.7.19-17: Implemented
2735  :cli: ``--rocksdb-validate-tables``
2736  :dyn: No
2737  :scope: Global
2738  :vartype: Numeric
2739  :default: ``1``
2740
2741Specifies whether to verify that MySQL ``.frm`` files match MyRocks tables.
2742
2743* ``0``: do not verify.
2744* ``1``: verify and fail on error (default).
2745* ``2``: verify and continue with error.
2746
2747.. variable:: rocksdb_verify_row_debug_checksums
2748
2749  :version 5.7.19-17: Implemented
2750  :cli: ``--rocksdb-verify-row-debug-checksums``
2751  :dyn: Yes
2752  :scope: Global, Session
2753  :vartype: Boolean
2754  :default: ``OFF``
2755
2756Specifies whether to verify checksums when reading index or table records.
2757Disabled by default.
2758
2759.. variable:: rocksdb_wal_bytes_per_sync
2760
2761  :version 5.7.19-17: Implemented
2762  :version 5.7.21-20: Changed to dynamic
2763  :cli: ``--rocksdb-wal-bytes-per-sync``
2764  :dyn: Yes
2765  :scope: Global
2766  :vartype: Numeric
2767  :default: ``0``
2768
2769Specifies how often should the OS sync WAL (write-ahead log) files to disk
2770as they are being written, asynchronously, in the background.
2771This operation can be used to smooth out write I/O over time.
2772Default value is ``0``, meaning that files are never synced.
2773Allowed range is up to ``18446744073709551615``.
2774
2775.. variable:: rocksdb_wal_dir
2776
2777  :version 5.7.19-17: Implemented
2778  :cli: ``--rocksdb-wal-dir``
2779  :dyn: No
2780  :scope: Global
2781  :vartype: String
2782  :default:
2783
2784Specifies the path to the directory where MyRocks stores WAL files.
2785
2786.. variable:: rocksdb_wal_recovery_mode
2787
2788  :version 5.7.19-17: Implemented
2789  :cli: ``--rocksdb-wal-recovery-mode``
2790  :dyn: Yes
2791  :scope: Global
2792  :vartype: Numeric
2793  :default: ``2``
2794
2795.. note::
2796
2797    In version 5.7.31-34 and later, the default is changed from ``1`` to ``2``.
2798
2799Specifies the level of tolerance when recovering write-ahead logs (WAL) files
2800after a system crash.
2801
2802The following are the options:
2803
2804 * ``0``: if the last WAL entry is corrupted, truncate the entry and either start the server normally or refuse to start.
2805
2806 * ``1``: if a WAL entry is corrupted, the server fails to   start and does not recover from the crash.
2807
2808 * ``2`` (default): if a corrupted WAL entry is detected, truncate all entries after the detected corrupted entry. You can select this setting for replication replicas.
2809
2810 * ``3``: If a corrupted WAL entry is detected, skip only the corrupted entry and continue the apply WAL entries. This option can be dangerous.
2811
2812.. variable:: rocksdb_wal_size_limit_mb
2813
2814  :version 5.7.19-17: Implemented
2815  :cli: ``--rocksdb-wal-size-limit-mb``
2816  :dyn: No
2817  :scope: Global
2818  :vartype: Numeric
2819  :default: ``0``
2820
2821Specifies the maximum size of all WAL files in megabytes
2822before attempting to flush memtables and delete the oldest files.
2823Default value is ``0`` (never rotated).
2824Allowed range is up to ``9223372036854775807``.
2825
2826.. variable:: rocksdb_wal_ttl_seconds
2827
2828  :version 5.7.19-17: Implemented
2829  :cli: ``--rocksdb-wal-ttl-seconds``
2830  :dyn: No
2831  :scope: Global
2832  :vartype: Numeric
2833  :default: ``0``
2834
2835Specifies the timeout in seconds before deleting archived WAL files.
2836Default is ``0`` (WAL files are not archived).
2837Allowed range is up to ``9223372036854775807``.
2838
2839.. variable:: rocksdb_whole_key_filtering
2840
2841  :version 5.7.19-17: Implemented
2842  :cli: ``--rocksdb-whole-key-filtering``
2843  :dyn: No
2844  :scope: Global
2845  :vartype: Boolean
2846  :default: ``ON``
2847
2848Specifies whether the bloomfilter should use the whole key for filtering
2849instead of just the prefix.
2850Enabled by default.
2851Make sure that lookups use the whole key for matching.
2852
2853.. variable:: rocksdb_write_batch_max_bytes
2854
2855  :version 5.7.20-18: Implemented
2856  :cli: ``--rocksdb-write-batch-max-bytes``
2857  :dyn: Yes
2858  :scope: Global, Session
2859  :vartype: Numeric
2860  :default: ``0``
2861
2862Specifies the maximum size of a RocksDB write batch in bytes. ``0`` means no
2863limit. In case user exceeds the limit following error will be shown:
2864``ERROR HY000: Status error 10 received from RocksDB: Operation aborted: Memory
2865limit reached``.
2866
2867.. variable:: rocksdb_write_disable_wal
2868
2869  :version 5.7.19-17: Implemented
2870  :cli: ``--rocksdb-write-disable-wal``
2871  :dyn: Yes
2872  :scope: Global, Session
2873  :vartype: Boolean
2874  :default: ``OFF``
2875
2876Lets you temporarily disable writes to WAL files,
2877which can be useful for bulk loading.
2878
2879.. variable:: rocksdb_write_ignore_missing_column_families
2880
2881  :version 5.7.19-17: Implemented
2882  :cli: ``--rocksdb-write-ignore-missing-column-families``
2883  :dyn: Yes
2884  :scope: Global, Session
2885  :vartype: Boolean
2886  :default: ``OFF``
2887
2888Specifies whether to ignore writes to column families that do not exist.
2889Disabled by default (writes to non-existent column families are not ignored).
2890
2891.. variable:: rocksdb_write_policy
2892
2893  :version 5.7.23-23: Implemented
2894  :cli: ``--rocksdb-write-policy``
2895  :dyn: No
2896  :scope: Global
2897  :vartype: String
2898  :default: ``write_committed``
2899
2900Specifies when two-phase commit data are actually written into the database.
2901Allowed values are ``write_committed``, ``write_prepared``, and
2902``write_unprepared``.
2903
2904Default value is ``write_committed`` which means data are written at commit
2905time. If the value is set to ``write_prepared``, then data are written after
2906the prepare phase of a two-phase transaction. If the value is set to
2907``write_unprepared``, then data are written before the prepare phase.
2908