Brick Work

0023. Schema 4.2: a job owner is a pid on one boot with one start time; an order line keeps why it is unplaced

Context

Two findings from milestone B need a column each.

Options considered

  1. A time-based check, no schema change (branch fix/167-job-claim-boot): a live pid owns a job only if its process started before claimed_at, read from /proc/<pid>/stat and /proc/stat btime, with 2 s of slack. Codex found two holes, both verified against the code: - a forward wall-clock step moves btime, so a live owner can look newer than its claim and be taken over, and two processes then run the job; - a pid reused within the slack still counts as the owner.
  2. Schema 4.2: store the owner's identity and compare it exactly. One additive step, together with #155's column.
  3. Two separate schema steps, one per issue. That means two upgrades and two rollouts for the same users in the same week.

Decision

Option 2, one step 4.1 → 4.2 in store4/connect.UPGRADES, additive only, run at the first read-write start:

4.2 goes to prod under the data-cutover rule (ADR 0018's shape): a runbook with T (rehearsal on test from a fresh prod backup), P (prod) and R (rollback), in rasp-infra stack/brick-work/rollout-4.2.md. The prod rollout is the maintainer's.

Consequences

#167, #155, 0018, 0021; rasp-infra stack/brick-work/rollout-4.2.md.