-- A crashed API must not leave permanent booting state. Attempt identity fences -- late replies after a timed-out attempt is reclaimed by another API process. ALTER TABLE computers ADD COLUMN boot_attempt TEXT; ALTER TABLE computers ADD COLUMN boot_started_at TIMESTAMPTZ; UPDATE computers SET boot_started_at=updated_at WHERE state='booting'; CREATE INDEX computer_boot_deadline_idx ON computers(boot_started_at) WHERE state='booting';