Repository navigation
ensureFresh: split strict/best-effort variants, bound Find's ErrNotFound fallback - #134
Merged
Merged
Conversation
added 3 commits
August 20, 2026 17:18
…nd Find's ErrNotFound fallback (refs crn-pz5l9.1)
…ind's ErrNotFound fallback (refs crn-pz5l9.1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
cairn's internal index-freshness check (
ensureFresh) is split into twovariants. Six read paths (
Find,FindCorrection,Status,Search,Recall,CullCandidates) now use a best-effort variant: if the boundedself-heal reindex times out, they serve the (possibly lagging) index instead
of failing the call. The one path that gates a mutation (
EntryByID, used bycull-evict, promote-mark, and anchor-attach) is unchanged and still requires
a fully fresh index before proceeding.
Separately,
Find's "not found" fallback — which force-reindexes to confirma real miss — was previously unbounded and could stall for the full
lock-contention window (~33s). It's now bounded by the same timeout the
self-heal path already uses, and reports "not found" (rather than a timeout
error) if that bound is hit — a real miss and an unconfirmable-within-budget
miss now look the same to callers.
Review notes
internal/cairn/evict.go'sEntryByIDintentionally still calls thestrict variant — it's the sole pre-mutation gate for delete, tier
promotion, and anchor-attach, and should not be relaxed.
Find's not-found fallback reuses the existingself-heal timeout constant rather than introducing a new one.
Test plan
go build ./...&&go test ./... -race -count=1— all 7 packagesgreen, zero failures/skips.
reindex overrun,
EntryByIDstill hitting the strict deadline(regression guard), and a genuinely-missing id returning "not found"
within the bound instead of stalling.
release-gates/crn-tk8qd-gate.md🤖 Deployed by actual-factory