Repository navigation
fix(daemon): bound FTS health probes - #1445
Conversation
Health and status readiness reused the exact FTS invariant snapshot, which scans live FTS docsize tables and anti-joins messages. On the production archive those probes can take tens of seconds and make /healthz/ready time out while the daemon is otherwise serving and converging. Replace that path with structural checks over sqlite_master: source table presence, FTS table presence, and trigger presence. Exact freshness remains an explicit search/maintenance invariant; readiness now reports coverage_exact=false instead of pretending these bounded probes are row-count proof. Ref #1444
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughFTS readiness probing is refactored to use bounded schema checks instead of expensive snapshot sync and exact-count queries. The implementation adds structural table/trigger presence checks against ChangesFTS Readiness Bounded Probing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70deebefc2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Replace daemon FTS health/status readiness with bounded structural probes so
/healthz/readycannot scan the production archive while catch-up ingest is running.Problem
#1443 fixed the startup path, but live verification showed
/healthz/readyon the API socket still timed out. The route calledfts_readiness_info(), which delegated to the exact FTS invariant snapshot. On the live archive, those count and anti-join probes overmessages/messages_fts_docsizetook tens of seconds and could make readiness unusable even though the daemon was already listening and converging.Solution
polylogue/daemon/fts_status.pynow uses sqlite_master-only structural checks for the daemon health/status surface: source table existence, FTS table existence, and expected trigger presence for each FTS surface. It reportscoverage_exact=falseso the payload is explicit that health readiness is not row-count proof. Exact FTS freshness remains enforced by the search/maintenance invariant paths rather than by the readiness endpoint.The daemon status test now traces SQL and asserts the health readiness path does not issue
COUNT(*) FROM messages,COUNT(*) FROM messages_fts_docsize, or FTS docsize joins.Closes #1444
Verification
pytest tests/unit/daemon/test_daemon_status.py tests/unit/daemon/test_health_contract.py -q-> 30 passedpytest tests/unit/daemon/test_daemon_status.py tests/unit/daemon/test_health_contract.py tests/unit/daemon/test_daemon_cli.py tests/unit/daemon/test_fts_trigger_drift.py tests/unit/storage/test_fts_trigger_lifecycle.py tests/unit/storage/test_fts_repair_sql.py tests/unit/storage/test_fts5.py -q-> 141 passeddevtools verify --quick-> exit_code 0, total_duration_s 37.18Summary by CodeRabbit
Release Notes