Skip to content

feat(repair): use presence index for all repair cycles, not just cleanup#202

Open
RolfAris wants to merge 1 commit intoOpenAudio:mainfrom
RolfAris:feat/universal-repair-presence-index
Open

feat(repair): use presence index for all repair cycles, not just cleanup#202
RolfAris wants to merge 1 commit intoOpenAudio:mainfrom
RolfAris:feat/universal-repair-presence-index

Conversation

@RolfAris
Copy link
Copy Markdown
Contributor

@RolfAris RolfAris commented Apr 5, 2026

Extends #199 to cover all repair cycles, not just cleanup. Always on. The fallback on build failure is the safety mechanism.

buildRepairPresenceIndex moves from the qm_cids cleanup block to the start of runRepair and is passed to all three loops (uploads, previews, qm_cids). RepairQmCidsUseListIndex config field and env var removed.

On build failure, presenceIndex stays nil and every check falls back to per-key Attributes. knownPresent (#192) catches writes between listings.

Evidence

24h paired test: two nodes on this PR branch (one commit on main), same 1h interval (default:"1h"). One builds the index, the other doesn't.

Metric with index without
HeadObject (24h) 3,640 1,800,817
pull_mine_needed (last cycle) 146 144
pull_mine_fail (last cycle) 11,096 10,944
index entries 335,119 n/a
panics (24h) 0 0

99.8% HeadObject reduction. Identical repair behavior: same pulls needed, same failure rate.

Move the listing-derived presence index from cleanup-only to all repair
cycles (uploads, previews, qm_cids). Always on — no flag needed.

The index replaces per-key HeadObject with a single ListObjects
pagination at cycle start. Staleness between listings is covered by
the existing knownPresent write-path cache (PR OpenAudio#192).

On build failure, falls back to per-key HeadObject (same as before).
@RolfAris RolfAris force-pushed the feat/universal-repair-presence-index branch from 6c8e678 to 697ca0d Compare April 6, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant