• Affan Dar's avatar
    Adding DB::GetCurrentWalFile() API as a repliction/backup helper (#5765) · 229e6fbe
    Affan Dar authored
    Adding a light weight API to get last live WAL file name and size. Meant to be used as a helper for backup/restore tooling in a larger ecosystem such as MySQL with a MyRocks storage engine.
    Specifically within MySQL's backup/restore mechanism, this call can be made with a write lock on the mysql db to get a transactionally consistent snapshot of the current WAL file position along with other non-rocksdb log/data files.
    Without this, the alternative would be to take the aforementioned lock, scan the WAL dir for all files, find the last file and note its exact size as the rocksdb 'checkpoint'.
    Pull Request resolved: https://github.com/facebook/rocksdb/pull/5765
    Differential Revision: D17172717
    Pulled By: affandar
    fbshipit-source-id: f2fabafd4c0e6fc45f126670c8c88a9f84cb8a37