8000 Add index integrity check (verify) and public rebuild-indexes-from-fact-pages · Issue #373 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

Add index integrity check (verify) and public rebuild-indexes-from-fact-pages #373

Closed

Description

@adityamukho

Summary

Split out of #370. An index that disagrees with the fact pages is currently silent: the file opens, scans work, and entity-bound queries return []. There is also no public way to rebuild the indexes from the fact pages.

Asks

  1. Integrity check. A (verify) command / API, and/or cheap on-open sampling, that compares index cardinalities (EAVT vs AEVT vs fact count) and spot-resolves FactRefs, so this state raises an error instead of returning wrong answers. The on-disk checksum can pass while refs are wrong (see the root cause fixed for bug: after a kill during an active run the EAVT index silently loses most entities' entries while AEVT stays intact — entity-bound lookups return [] and no rebuild path exists #370), so a checksum alone is not enough.
  2. Public rebuild. An operation (e.g. Minigraf::rebuild_indexes()) that rebuilds all four indexes from the fact pages. checkpoint() cannot serve as repair because it streams the existing indexes and copies any hole forward. This is also the only recovery path for files already rebuilt with the bad refs before the bug: after a kill during an active run the EAVT index silently loses most entities' entries while AEVT stays intact — entity-bound lookups return [] and no rebuild path exists #370 fix.

Context

Philosophy check

Aligned: single file, zero config, reliability over features. An explicit rebuild adds no new format or dependency.

Refs #370

Activity

  1. added this to the v3.0.0 milestone on Sep 25, 2026
  2. added
    known-issueBug present in a published release and not yet fixed in one; listed in the pinned known-issues issue
    on Sep 27, 2026
  3. added a commit that references this issue on Oct 6, 2026
  4. adityamukho commented on Oct 6, 2026

    @adityamukho
    CollaboratorAuthor

    Implemented on v3 in #458 (185196b): Minigraf::verify() and Minigraf::rebuild_indexes(). Opening a v2.x (format v7) file with v3.0.0 also rebuilds every index from the fact pages during the v7→v8 migration, so files damaged by the #370 bug are repaired on upgrade.

    Left open because it still affects v2.x: there is no repair on the 2.x line. It closes when v3.0.0 is published (see #421).

  5. adityamukho commented on Oct 14, 2026

    @adityamukho
    CollaboratorAuthor

    Fixed on v3 in #458 (Minigraf::verify(), Minigraf::rebuild_indexes(); v7→v8 migration rebuilds every index). Closed under the close-on-merge rule for the unreleased v3 branch (CONTRIBUTING.md, #585). It stays listed in #421 for v2.x, with fix version v3.0.0.

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

    data-integrityData integrity issueenhancementNew feature or requestknown-issueBug present in a published release and not yet fixed in one; listed in the pinned known-issues issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0