Skip to content

DB Corruption Panic on Sled 0.34 After Stopping Container #1533

@nachocodexx

Description

@nachocodexx

A Sled database (version 0.34) enters a corrupt state and cannot be opened after the Docker container using it was abruptly stopped. When attempting to restart the application, it panics with a Corruption error.


Current Behavior

When the application starts, the following output is observed in the logs before the process terminates:

  1. A WARN message indicating a corrupt or empty snapshot file:
    WARN sled::pagecache::snapshot: empty/corrupt snapshot file found
    
  2. The application panics when calling .unwrap() on a corruption error result:
    thread 'main' panicked at ... called `Result::unwrap()` on an `Err` value: Corruption { at: None, bt: () }
    

Expected Behavior

Sled should ideally be able to recover from an unexpected shutdown. Barring that, it should provide a clear recovery path or tooling to repair the database and salvage data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions