mysql-5.6 icon indicating copy to clipboard operation
mysql-5.6 copied to clipboard

Fix issues 1200 and 1295, add rocksdb_compact_lzero_now global variable

Open mdcallag opened this issue 1 year ago • 2 comments

This fixes issue 1295 and has a workaround for issue 1200. https://github.com/facebook/mysql-5.6/issues/1200 https://github.com/facebook/mysql-5.6/issues/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 avatar May 11 '23 19:05 mdcallag