You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ingest): FTS triggers left dropped when side-effect commit fails #728
In ingest_batch.py:896-900, if _commit_sync_ingest_side_effects fails in the finally block (after the main transaction was already committed by _commit_ingest_results), the except branch calls conn.rollback(). This rollback reverts only the trigger restoration and FTS repair (since the main data was already committed), meaning FTS triggers could remain dropped on disk.
On the next ingest, suspend_fts_triggers_sync does DROP TRIGGER IF EXISTS (safe no-op on already-missing triggers), and restore_fts_triggers_sync re-creates them. But the FTS index is stale until the next successful write — searches return incomplete results in the meantime.
Acceptance criteria
FTS trigger restoration and repair are committed in a transaction that is independent of the main data commit, OR
The error recovery path explicitly restores triggers before rolling back, OR
The next ingest cycle detects missing triggers and repairs them before any reads.
Regression test: simulate side-effect commit failure, verify FTS triggers are present and index is consistent after recovery.
Found by
2026-05-03 git history bug pattern analysis (wave 4 subagent analysis). Related to #618 (storage write-path unification).
Scope absorbed into #618 (storage write-path unification). The FTS trigger lifecycle, batch ordering, and crash gap are all part of the storage correctness workstream.
Activity
Sinity commentedon May 3, 2026
Scope absorbed into #618 (storage write-path unification). The FTS trigger lifecycle, batch ordering, and crash gap are all part of the storage correctness workstream.