8000 test: drive the fault-injection backend through the full save/WAL/recovery paths · Issue #390 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

test: drive the fault-injection backend through the full save/WAL/recovery paths #390

Closed

Description

@adityamukho

Problem

src/storage/backend/fault_inject.rs (FaultInjectingBackend) exists, but only a small fault_injection_tests module in persistent_facts.rs uses it. No integration test covers these failures at every point in save(), WAL append, checkpoint and recovery:

  • short writes
  • torn pages
  • fsync failure (EIO)
  • ENOSPC

fsync failure matters most. After a failed fsync, the page cache may already have dropped the dirty pages. Retrying the fsync can then report success even though the data was never written (the PostgreSQL "fsyncgate" problem).

Ask

  • Add a test matrix that injects each fault at each write or sync call during transact, checkpoint and save(). After each fault, reopen the database. The data must be either the last committed state or a clear error, and must never be wrong.
  • Decide and write down what happens after an fsync failure. The safe choice is to poison the handle and make the caller reopen, not to retry.
  • Add an ENOSPC test in which the disk fills halfway through a checkpoint.

Activity

  1. added this to the v3.0.0 milestone on Sep 26, 2026
  2. adityamukho commented on Oct 10, 2026

    @adityamukho
    CollaboratorAuthor

    Done on v3 in #515: a test-only fault plan, the src/fault_matrix.rs matrix (EIO, torn/short writes, sticky ENOSPC, failed fsync with and without lost writes, at every write and sync of transact, checkpoint, close and rebuild), and the decision that a failed checkpoint is never retried on the same handle (STG-046, documented in ERROR_REFERENCE and Minigraf::checkpoint). It found #513 (fixed in #514, backported in #516).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    durabilityData durability concernstabilityStability/panic issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0