Repository navigation
fix(daemon): keep FTS triggers active during ingest - #1437
Conversation
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 9 minutes and 9 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 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 |
Summary
Remove the steady-state dropped-trigger window from daemon ingest writes. Normal archive write effects now ensure missing FTS triggers without dropping existing triggers, and default ingest keeps FTS triggers active instead of suspending them globally.
Problem
After #1435 restored the production FTS index and #1436 bounded status health counts, restarting through Sinnix exposed the deeper recurrence source: the daemon was still using global FTS trigger suspension during live ingest, and write effects called
restore_fts_triggers_sync, which drops and recreates triggers. A restart or kill inside that window leaves all six FTS triggers missing, forcing an expensive startup rebuild and making search freshness fragile.Solution
ensure_fts_triggers_sync, which creates missing canonical FTS triggers without dropping live triggers._process_ingest_batch_synckeep FTS triggers active by default; the old suspend/restore behavior is now explicit opt-in only.restore_fts_triggers_syncfor explicit startup repair and full rebuild paths.Verification
pytest tests/unit/archive/test_write_gateway.py::test_write_gateway_normal_commit_does_not_drop_fts_triggers tests/unit/pipeline/test_ingest_batch.py::test_process_ingest_batch_sync_commits_fts_repair_and_invalidates_search_cache -q→ 2 passedpython -m ruff format --check polylogue/storage/fts/fts_lifecycle.py polylogue/archive/write_effects.py polylogue/pipeline/services/ingest_batch/_core.py tests/unit/archive/test_write_gateway.py tests/unit/pipeline/test_ingest_batch.py→ 5 files already formattedpython -m ruff check polylogue/storage/fts/fts_lifecycle.py polylogue/archive/write_effects.py polylogue/pipeline/services/ingest_batch/_core.py tests/unit/archive/test_write_gateway.py tests/unit/pipeline/test_ingest_batch.py→ All checks passedpython -m mypy polylogue/storage/fts/fts_lifecycle.py polylogue/archive/write_effects.py polylogue/pipeline/services/ingest_batch/_core.py tests/unit/archive/test_write_gateway.py tests/unit/pipeline/test_ingest_batch.py→ Successdevtools verify --quick→ exit_code 0, total_duration_s 37.18