# Runbook: Seat hold backlog

- Owner: Booking team (Mateo Lindqvist)
- Last reviewed: 2024-07-15
- Related: ADR-002 (seat holds)

## Symptoms

- Operators report sailings showing as full while the passenger list is short.
- The `seat_hold_expired_unreleased` metric is above zero for more than five minutes.
- The alert "Hold sweeper stalled" has fired.

## Why it happens

Expired holds are released by the hold sweeper, which runs every 30 seconds. If the sweeper stops,
for example after a failed deployment or a lost database connection, expired holds stay in the
`seat_hold` table and keep their seats claimed.

## Steps

1. Check the sweeper's last successful run on the booking dashboard. If it ran within the last
   minute, the backlog is caused by holds with payments in progress; go to step 5.
2. Restart the sweeper deployment. It releases every expired hold without a payment in progress on
   its first run.
3. Watch `seat_hold_expired_unreleased` fall to zero within two minutes.
4. If it does not, check the sweeper's logs for database errors and page the platform team.
5. For holds with payments in progress older than 20 minutes, check the payment with the payment
   webhook runbook before touching the hold. Never delete a hold with a payment in progress by hand:
   the payment may still succeed.

## After the incident

Record the duration of the backlog and the number of sailings affected in the incident log.
