Skip to content
Laurynas Biveinis edited this page Jan 9, 2024 · 2 revisions

The current version of this page is at https://github.com/facebook/mysql-5.6/wiki/Clone-Direct-I-O

Any SST files opened by the clone must open them in the same cached/direct I/O mode that RocksDB layer does, for the same performance considerations and to avoid mixing the modes on the same file. The RocksDB layer SST file access mode is governed by the rocksdb_use_direct_reads system variable for reads and rocksdb_use_direct_io_for_flush_and_compaction for writes. The clone will open SSTs with O_DIRECT as follows:

  • On the donor, iff rocksdb_use_direct_reads is on;
  • On the client, iff rocksdb_use_direct_io_for_flush_and_compaction is on. The clone plugin can be informed about the I/O mode of cloned files by setting callback flags and it uses this information to enable zero-copy optimization for local clones.

The above applies exclusively to SSTs. The WAL files, MANIFEST, etc. are always opened in cached mode by RocksDB and so will the clone.