Recover from a stuck REBUILDING status after a killed full reindex #24

Closed
opened 2026-10-08 12:10:41 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-10-08 12:10:41 +00:00 (Migrated from github.com)

If a full reindex of all tables is killed partway through (pod restart, OOM, deploy), or two full reindexes overlap, the tables it marked REBUILDING stay that way. Only another all-tables full reindex clears that status. Until then:

  • the listener keeps writing every delete as an AWAITING_REINDEX row, so those rows pile up without limit;
  • drift detection is off for those tables;
  • two overlapping runs drain each other's captured rows.

No data is lost: search stays correct, and the next full reindex applies the captured deletes. Found in the PR #20 review (issue #14).

Fix: before starting, detect whether a full reindex is still running, using the FULL_REINDEX run record. Refuse a second concurrent run. Recover a stale REBUILDING (a dead run) by restoring the table status and turning its AWAITING_REINDEX rows PENDING so basepull replays them. No schema change.

Part of #12.

If a full reindex of all tables is killed partway through (pod restart, OOM, deploy), or two full reindexes overlap, the tables it marked `REBUILDING` stay that way. Only another all-tables full reindex clears that status. Until then: - the listener keeps writing every delete as an `AWAITING_REINDEX` row, so those rows pile up without limit; - drift detection is off for those tables; - two overlapping runs drain each other's captured rows. No data is lost: search stays correct, and the next full reindex applies the captured deletes. Found in the PR #20 review (issue #14). Fix: before starting, detect whether a full reindex is still running, using the `FULL_REINDEX` run record. Refuse a second concurrent run. Recover a stale `REBUILDING` (a dead run) by restoring the table status and turning its `AWAITING_REINDEX` rows `PENDING` so basepull replays them. No schema change. Part of #12.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: QRun-IO/qbit-quick-search#24