Repository navigation
fix(daemon): bulk repair streaming full-ingest FTS - #1462
Conversation
Problem: after #1461, live deployment kept large hot Codex appends bounded, but same-size changed Codex sessions still need full parse and produced heavy per-row FTS trigger churn. A 37.8 MB catch-up chunk drove read_bytes past 24 GB and hit a database lock.\n\nWhat changed: live full ingest now suspends FTS triggers for files at the existing streaming threshold instead of waiting until 32 MiB. Those files already use the streaming blob path, and they now use one bounded FTS repair at commit instead of thousands of row-trigger updates.\n\nVerification: pytest tests/unit/sources/test_live_batch_support.py -q; ruff check polylogue/sources/live/batch.py tests/unit/sources/test_live_batch_support.py; mypy polylogue/sources/live/batch.py tests/unit/sources/test_live_batch_support.py; devtools verify --quick.\n\nRef #1447
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 34 minutes and 45 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 (2)
✨ 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 |
polylogue-gibn1, decisive: instrumented the sole consumer of summary.fts_repair_session_ids (_commit_sync_ingest_side_effects) and it never printed across five sessions and sixty messages in the failing convergence-evidence test. The repair is nested inside `if transaction_started`, so a route with an externally managed transaction skips FTS repair along with every other post-write side effect. Eliminated: repair_message_fts (defaults True everywhere, no daemon override), the repair queue itself (content_changed appends unconditionally), the invariant reader, and the triggers. Three independent places each assume another will populate the index: replay defers the reinsert, ingest-side repair never runs, and the path-scoped convergence check is a hardcoded `return False`. Read the #1498 cascade retro as CLAUDE.md requires; its closed list names the adjacent history (#1462, #1469, #1472, #1500, #1502), several of which narrowed FTS repair to avoid redundant work. Those PR bodies are the place to start. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HWcPJJJvuF25CqVwTFgSQC
Summary
Live full ingest now switches to suspended FTS triggers at the same size threshold where it already switches to streaming blob ingestion. This targets large same-size source rewrites that cannot use append planning but should not pay thousands of per-row FTS trigger updates.
Problem
After #1461 was deployed, the two hot Codex append cases were fixed in live monitoring:
changed_messages=89,elapsed_s=1.65,source_payload_read_bytes=598770changed_messages=278,elapsed_s=4.08,source_payload_read_bytes=2051406The next catch-up chunk still exposed a separate unsafe path. A 37.8 MB chunk containing same-size changed Codex sessions produced:
Those files were too large for cheap per-row FTS trigger churn but below the old 32 MiB trigger-suspension threshold.
Solution
Use the existing
_STREAMING_FULL_INGEST_BYTESthreshold for full-ingest FTS trigger suspension. Files large enough to stream through the blob path now also get bulk FTS repair at commit. This preserves daemon convergence scope; it only changes the write mechanics for large full replays.A regression verifies that a 9 MiB JSONL full-ingest source now calls
_process_ingest_batch_syncwithsuspend_fts_triggers=True,repair_message_fts=True, andrepair_action_fts=Trueby default.Verification
pytest tests/unit/sources/test_live_batch_support.py -q-> 14 passedruff check polylogue/sources/live/batch.py tests/unit/sources/test_live_batch_support.py-> passedmypy polylogue/sources/live/batch.py tests/unit/sources/test_live_batch_support.py-> passeddevtools verify --quick-> exit_code 0, total_duration_s 38.38Ref #1447