facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
28.09k stars 6.25k forks source link

Copy current WAL in consistent state during checkpoint #12671

Open andlr opened 3 months ago

andlr commented 3 months ago

Due to a few data race issues, sometimes active WAL file gets copied in inconsistent state during checkpoint operation. Database open from such checkpoint fails with one of these errors when wal_recovery_mode=kAbsoluteConsistency:

This happens because size of the active WAL file is captured at a random moment:

The fix does the following:

Fixes #12670