1.Alert response: queue consumer lag
When it fits: Use this when a paging alert fires for a backlog, the fix is usually a restart, and the risk is that someone restarts the wrong thing during a deploy.
Runbook: ledger-writer consumer lag above 50,000
Trigger: PagerDuty alert LedgerWriterLagHigh (lag above 50,000 messages for 10 minutes)
Service: [[ledger-writer]]
Owner: Payments platform rotation
Verified on: 2026-10-09 by Kwame Asante, method: executed in staging with a synthetic backlog of 80,000 messages
Drift triggers: consumer group rename, move off the payments-prod cluster, change to the deploy tool's restart command
Blast radius: merchant balances lag behind reality; payouts scheduled for 16:00 UTC can go out short
Preconditions
- Access:
payments-oncallrole, production VPN - Check first: is a deploy of ledger-writer in progress? If yes, stop and ask in #payments-deploys before restarting.
Steps
kafka-consumer-groups --bootstrap-server kafka-1.payments-prod.internal:9092 --describe --group ledger-writerExpected: LAG per partition. If one partition holds most of the lag, go to Known failure modes.shipctl restart ledger-writer --env prod --rollingExpected: "3/3 instances healthy" within 4 minutes.- Re-run step 1 after 5 minutes. Expected: total lag falling by at least 5,000 per minute.
Verification
- Lag under 1,000 on the Ledger Writer dashboard, and the 16:00 payout job shows "inputs fresh".
Rollback
- A restart has no rollback. If lag grows after the restart, do not restart again. Escalate.
Escalation
- After 20 minutes without falling lag: Payments platform secondary
- Then: Data infrastructure rotation (Kafka itself), then the incident commander
Communication
- "Merchant balances are delayed by up to [N] minutes. Payouts are not affected yet. Next update in 30 minutes."
Known failure modes
- One partition holding all the lag usually means a poison message. See [[ledger-writer: skip a poison message]].
Change log
- 2026-10-09: replaced the old
kubectl rollout restartstep after the move to shipctl.