Skip to content

fix: Initialise cache readiness once; replicas settle it synchronously (#198 #217) - #223

Closed
jrosskopf wants to merge 2 commits into
mainfrom
fix/gh-198-startup-readiness
Closed

jrosskopf wants to merge 2 commits into
mainfrom
fix/gh-198-startup-readiness

Conversation

@jrosskopf

@jrosskopf jrosskopf commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Readiness registry is initialised once at DatabaseManager startup (before the HTTP thread); warm-up no longer re-runs initializeReadiness (it clear()ed live state, letting /health briefly report ready).
  • Read-only replicas set Ready/Unbuilt synchronously, so a never-built table answers cache_not_built from the first request instead of cache_warming for ~2 s.

Test plan

  • test_warmup_readiness.py::TestStartupRaceIssue198 (tight-poll from first bind x6 restarts; single-init log invariant)
  • test_cache_catalog_f1.py::TestReplicaNeverBuilt (3 replica restarts, 60 tight-polled requests each)
  • make test (serial ctest, 979/979), scheduler/concurrency integration tests

Refs #198 #217


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…_warming (red) (#198 #217)

- Tight-poll /health and /cached from first bind across restarts
- Replica of a never-built table must answer cache_not_built immediately
- Log line on initializeReadiness so the single-init invariant is observable
#198 #217)

- warmUpCaches/warmUpCachesAsync no longer re-run initializeReadiness (it clear()ed live state)
- Read-only replicas set Ready/Unbuilt at DatabaseManager startup, before the HTTP thread
- Correct the /health expectation in the replica test; document in caching.md
@jrosskopf

Copy link
Copy Markdown
Contributor Author

Superseded by #230 (combined and merged).

@jrosskopf jrosskopf closed this Nov 21, 2026
@jrosskopf
jrosskopf deleted the fix/gh-198-startup-readiness branch November 21, 2026 03:27
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