Summary
When the indexer's pagination loop encounters an RPC error on a non-first page (e.g. page 3 of a 5-page batch), it exits the loop and advances the cursor to the tip. Events on the failed pages are silently skipped. The error is logged and counted in errors_total, but the specific ledger range that was missed is not recorded. There is no way to identify or backfill the gap without replaying the entire retention window.
Expected Behavior
Partial-page failures should record the affected ledger range so operators can trigger a targeted backfill.
Proposed Solution
- Add a
missed_ranges table to the schema: (from_ledger, to_ledger, reason, detected_at)
- When a page fetch fails mid-batch, insert a row into
missed_ranges
- Add a
GET /health field listing the count of unrecovered missed ranges
- Add a CLI command
lumenqraph-indexer recover-gaps that replays all recorded missed ranges
Affected Files
crates/lumenqraph-indexer/src/poller.rs
crates/lumenqraph-api/src/routes/health.rs
migrations/ (new migration)
Summary
When the indexer's pagination loop encounters an RPC error on a non-first page (e.g. page 3 of a 5-page batch), it exits the loop and advances the cursor to the tip. Events on the failed pages are silently skipped. The error is logged and counted in
errors_total, but the specific ledger range that was missed is not recorded. There is no way to identify or backfill the gap without replaying the entire retention window.Expected Behavior
Partial-page failures should record the affected ledger range so operators can trigger a targeted backfill.
Proposed Solution
missed_rangestable to the schema:(from_ledger, to_ledger, reason, detected_at)missed_rangesGET /healthfield listing the count of unrecovered missed rangeslumenqraph-indexer recover-gapsthat replays all recorded missed rangesAffected Files
crates/lumenqraph-indexer/src/poller.rscrates/lumenqraph-api/src/routes/health.rsmigrations/(new migration)