Skip to content

[BUG] Snapshot restore may lose data when all data was flushed to SSTables #184

@ElioNeto

Description

@ElioNeto

Description

After per-CF WALs (#157), create_snapshot() writes an empty wal.log when no WAL data exists (all data already flushed). On restore, the engine finds no WAL records and the data appears lost.

Root cause

create_snapshot() saves WAL data before flushing, but if the WAL is already empty (all data flushed), it writes an empty wal.log as a sentinel. restore_snapshot() copies it back, and the engine starts with no data.

The SSTables are also copied, but VersionSet::get() doesn't read on-disk SSTables (see #180), making the restored data invisible.

Severity

Medium — blocks snapshot-based recovery for production use.

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions