8000 streaming engine 1/9: snapshots and page quarantine (#473) · Issue #543 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

streaming engine 1/9: snapshots and page quarantine (#473) #543

Closed

Description

@adityamukho

Part 1 of 9 of #473. Design: docs/superpowers/specs/2026-10-11-streaming-engine-design.md (branch docs/473-streaming-engine-spec), §4.

At open, a cursor takes the active generation's committed reader, a pin on that generation, an Arc of the pending store with its length at open, and the valid-time "now". A checkpoint replaces the pending store instead of clearing it, so the cursor's pending positions stay readable. PageAllocator does not hand out an id freed by the checkpoint that produced generation g while a pin on a generation below g exists. Pins and quarantine are in memory only: no format change, and nothing is pinned after a crash or reopen.

  • Pins and quarantine in PageAllocator (file, memory and browser backends)
  • Checkpoint swaps in a new pending store (facts, pending_keys, pending_indexes) instead of post_checkpoint_clear
  • Cursor snapshot: committed reader, pin, pending Arc + length, valid-time now; no lock held across next_batch
  • Whole snapshots: WriteTransaction::commit and WAL replay append a transaction in one batch; a checkpoint publishes committed and the new pending store under one FactData write lock (§4.1)
  • Quarantine also applies to rebuild_indexes' page pool and to BrowserDb's release of freed pages (take_released, BrowserDb: bound page growth via v8 free-list reuse; avoid v7→v8 migration bloat #440)
  • fact_log moves to the pin and opens without the write lock; checkpoints proceed while a log is open; API-013 deprecated (never raised, stays registered)
  • Tests: answer unchanged by writes and checkpoints that free pages a cursor reads; quarantined ids are reused after the pin drops; crash with an open cursor

Fixes the v3 side of #554 and #555 (data-integrity: those issues stay open until a release ships the fix; no closing keywords). Un-ignore their reproducers in tests/snapshot_atomicity_test.rs (branch test/snapshot-atomicity-repro).

PRs for this part target v3 and must not use a closing keyword for #473.

Activity

  1. added this to the v3.0.0 milestone on Oct 11, 2026
  2. added
    enhancementNew feature or request
    rustPull requests that update rust code
    durabilityData durability concern
    on Oct 11, 2026
  3. adityamukho commented on Oct 13, 2026

    @adityamukho
    CollaboratorAuthor

    PR 1 of 3 merged on v3: #578 (a727e08). Step 1 of the plan: a checkpoint publishes the new committed reader, its generation and a new pending store under one FactData write lock (spec §4.1), and the pending store is replaced, not cleared. Checklist item 4 (whole snapshots) is now done for the checkpoint side.

    Remaining: PR 2 (pins, page quarantine in PageAllocator and rebuild_indexes, fact log on the pin, API-013 deprecated) and PR 3 (query and cursor snapshots, BrowserDb release, crash test with an open cursor, docs).

  4. added 3 commits that reference this issue on Oct 13, 2026
  5. adityamukho commented on Oct 14, 2026

    @adityamukho
    CollaboratorAuthor

    Done on v3: PR #578 (PendingStore + one-lock publish), PR #579 (pins, allocator quarantine, fact log on the pin, API-013 deprecated), PR #580 (query/cursor snapshots, BrowserDb, crash test, docs); recursive-query regression from #580 fixed by #587. Docs site: project-minigraf/minigraf-docs#14.

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 concernenhancementNew feature or requestrustPull requests that update rust code

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0