Skip to content

Fsync during backfill #9623

Description

@michaelsproul

Description

This issue needs fleshing out, but basically our backfill database writes aren't crash-safe. We write across multiple databases (hot/cold/blobs) during backfill, and unlike in block import, we never fsync. This means the hot DB and cold DB can get out of sync, which is a form of DB corruption.

This is the cause of gaps in the cold DB's block roots array, which is never repaired.

This issue is hit occasionally by users who have crash-killed or OOM'd their node. It might be straight-forward to reproduce now that we know the issue is in backfill. My previous attempts to recreate it involved crashing a synced LH node, which (thankfully) doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions