Skip to main content

Module wal_filter

Module wal_filter 

Source
Expand description

Inspecting and rewriting WAL records during recovery.

When a DB opens, RocksDB replays every write-ahead log record that has not yet made it into an SST. A WAL filter sits in that loop: it sees each record before it is applied and decides whether the record is replayed as written, skipped, replaced with a different batch, or treated as the end of the usable log.

This is a recovery-time hook and nothing else. It runs on the thread inside DB::open, only for records that recovery actually reads, and never again once the DB is up. RocksDB documents it as single threaded.

Getting a filter wrong loses writes that were already acknowledged, so the usual reasons to reach for one are narrow: dropping writes for a column family that is being retired, rewriting a value encoding that changed between releases, or cutting recovery short at a known good point after a bad shutdown.

Install one with Options::set_wal_filter.

Structs§

ColumnFamilyLogNumbers
Which log each column family still needs replayed, handed to the filter once before any records are.

Enums§

WalRecordAction
What recovery should do with the WAL record that was just handed to the filter.

Traits§

WalFilter
A hook into WAL replay.