Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues 1200 and 1295, add rocksdb_compact_lzero_now global variable #1309

Open
wants to merge 1 commit into
base: fb-mysql-8.0.28
Choose a base branch
from

Commits on May 11, 2023

  1. Fix issues 1200 and 1295, add rocksdb_compact_lzero_now global variable

    This fixes issue 1295 and has a workaround for issue 1200.
    facebook#1200
    facebook#1295
    
    The fix for issue 1295 is to get the value of the base level from RocksDB
    rather than assuming that L0 compacts into L1 because L1 might not be
    the base level when dynamic leveled compaction is used -- in that case
    the base level can be Ln where n > 1 because L1 isn't needed yet.
    
    There are two workarounds for issue 1200. The hacky one is to sleep for
    1 second between requesting memtable flush and L0 -> base_level compaction.
    
    The alternative is to add a new global variable, rocksdb_compact_lzero_now,
    that when set will request L0 -> base_level compaction. This allows a client
    to first set rocksdb_force_flush_memtable_now, wait for that to finish, then
    set rocksdb_compact_lzero_now.
    
    Other changes:
    * rocksdb_force_flush_memtable_now default value changed to OFF to match
      what is done for rocksdb_force_flush_memtable_and_lzero_now and
      rocksdb_compact_lzero_now
    * confirm that the value to which these variables are set can be parsed,
      that wasn't done for all of them
    * don't raise an error when these are set to OFF, that will be a no-op
    
    Note: these variables are triggers, an action is taken when this is done:
    set global var = ON | true | 1
    
    But these variables always show the value 0 (OFF, false). Their value doesn't change.
    mdcallag committed May 11, 2023
    Configuration menu
    Copy the full SHA
    854f868 View commit details
    Browse the repository at this point in the history