Runbook: indexer reorg, replay, dedup, backfill #90

Closed
opened 2026-04-09 03:24:34 +00:00 by PlasticDigits · 4 comments
PlasticDigits commented 2026-04-09 03:24:34 +00:00 (Migrated from gitlab.com)

Evidence

  • SECURITY_REVIEW.md IX-03

Epic

#62

## Evidence - `SECURITY_REVIEW.md` IX-03 ## Epic #62
PlasticDigits commented 2026-04-09 03:24:35 +00:00 (Migrated from gitlab.com)

marked this issue as related to #62

marked this issue as related to #62
PlasticDigits commented 2026-04-13 12:29:15 +00:00 (Migrated from gitlab.com)

Epic #62 delivery

Added runbook docs/runbooks/indexer-reorg-replay-dedup.md: dedup via (tx_hash, pair_id) / ON CONFLICT DO NOTHING, safe replay for swaps, manual reorg recovery (stop indexer, restore DB or trim state, reset last_indexed_height / START_BLOCK), backfill cautions. Links SECURITY_REVIEW IX-03 and indexer/src/db/queries/state.rs.

@brouie please review.

## Epic #62 delivery Added runbook `docs/runbooks/indexer-reorg-replay-dedup.md`: dedup via `(tx_hash, pair_id)` / `ON CONFLICT DO NOTHING`, safe replay for swaps, **manual** reorg recovery (stop indexer, restore DB or trim state, reset `last_indexed_height` / `START_BLOCK`), backfill cautions. Links SECURITY_REVIEW IX-03 and `indexer/src/db/queries/state.rs`. @brouie please review.
PlasticDigits commented 2026-04-13 12:29:19 +00:00 (Migrated from gitlab.com)

mentioned in issue #62

mentioned in issue #62
Brouie commented 2026-04-20 07:00:02 +00:00 (Migrated from gitlab.com)

@PlasticDigits Verified on current main. docs/runbooks/indexer-reorg-replay-dedup.md present (32 lines). Content covers:

  • Cursor model (last_indexed_height in Postgres, state.rs reference)
  • Swap dedup via (tx_hash, pair_id) unique constraint with ON CONFLICT DO NOTHING (insert_swap)
  • Reorg detection (compare indexed tip vs trusted LCD/explorer)
  • Manual recovery steps: stop indexer, restore DB or trim state, reset last_indexed_height or use START_BLOCK
  • START_BLOCK guidance (use only on fresh or cursor-reset database)
  • Links IX-03 in SECURITY_REVIEW and indexer/src/db/queries/state.rs

Operator guidance is clear and actionable. Closing.

@PlasticDigits Verified on current main. docs/runbooks/indexer-reorg-replay-dedup.md present (32 lines). Content covers: - Cursor model (last_indexed_height in Postgres, state.rs reference) - Swap dedup via (tx_hash, pair_id) unique constraint with ON CONFLICT DO NOTHING (insert_swap) - Reorg detection (compare indexed tip vs trusted LCD/explorer) - Manual recovery steps: stop indexer, restore DB or trim state, reset last_indexed_height or use START_BLOCK - START_BLOCK guidance (use only on fresh or cursor-reset database) - Links IX-03 in SECURITY_REVIEW and indexer/src/db/queries/state.rs Operator guidance is clear and actionable. Closing.
Brouie (Migrated from gitlab.com) closed this issue 2026-04-20 07:00:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#90
No description provided.