Files
orca/cloud/dev/scripts/relay-reserve-cell-refusal.mjs
T
Jinwoo Hong 7cc2859e90 fix(relay-ops): let same-cap rolls run while another cell is reserve; refuse a reserve roll target by name (#30707)
* fix(relay-ops): let same-cap rolls run while another cell is reserve; refuse a reserve roll target by name

The director refuses cell-status for a step-5 reserve cell with a 404
{error: cell_in_reserve_mode}. The same-cap headroom check read it for
every general cell, so any roll failed while c7 was reserve. A reserve
cell that is not being rolled now counts as no free slots (its seats are
not in the database) and is listed with reserve: true. A reserve roll
target, in the headroom check, the same-cap job's first cell-status read
and the candidate tool, now fails with the design's procedure: flip it to
admitMode=db first, roll, then flip it back. Any other 404 still fails.

* fix(relay-ops): pin the headroom gate's imports as evidence code; name both cells in a two-cell reserve refusal
2026-10-19 06:57:06 -04:00

17 lines
725 B
JavaScript

// Step 5: the director refuses per-cell admin reads for a reserve cell with exactly this body;
// any other 404 stays a failure.
export const RESERVE_CELL_REFUSAL_ERROR = 'cell_in_reserve_mode'
export function isReserveCellRefusal(status, body) {
return status === 404 && body?.error === RESERVE_CELL_REFUSAL_ERROR
}
// Step-5 design default 4: a reserve cell is flipped back to db before a roll.
export function reserveCellRollRefusal(cellId) {
return new Error(
`${cellId ?? 'a cell this step reads'} is in reserve mode ` +
`(${RESERVE_CELL_REFUSAL_ERROR}): flip it to admitMode=db with the cell-flags ` +
'workflow and wait for it to record db before rolling it, then flip it back to reserve'
)
}