8000 test: add index corruption recovery and rebuild fixtures · Issue #215 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

test: add index corruption recovery and rebuild fixtures #215

Closed

Description

@adityamukho

Source

Extracted from the reliability audit snippet: indexing/storage recovery from index-file corruption and checksum behavior.

Programmatic test scope

Add deterministic corruption fixtures for on-disk indexes and verify recovery/rebuild behavior.

Cases to cover

  • Corrupted index checksum with intact fact pages.
  • Corrupted B+tree leaf/internal page bytes.
  • Root page pointer mismatch or impossible page ID.
  • Fact pages intact but one or more indexes unusable.

Acceptance criteria

  • Expected rebuild paths are covered by tests.
  • Irrecoverable corruption returns a clear error.
  • Query results after rebuild match pre-corruption expected facts.

Activity

  1. added
    enhancementNew feature or request
    rustPull requests that update rust code
    stabilityStability/panic issue
    corruptionData corruption risk
    on May 1, 2026
  2. adityamukho commented on May 2, 2026

    @adityamukho
    CollaboratorAuthor

    Audit finding: The index_checksum field (persistent_facts.rs:842) is misleadingly named — it checksums fact data pages (1 through new_total_fact_pages), NOT the B+tree index pages. A bit-flip in any index page (which starts at 1 + new_total_fact_pages) won't trigger a rebuild on reopen because needs_rebuild (line 248-249) only checks the fact-page checksum.

    The corruption fixtures in this issue should include a test case where index pages are corrupted but fact pages are intact — this currently passes silently (no rebuild triggered), producing wrong query results.

  3. added a commit that references this issue on May 16, 2026
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

    corruptionData corruption riskenhancementNew feature or requestrustPull requests that update rust codestabilityStability/panic issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0