Require executing authority for lease renewal.

RenewLease now demands current durable authority, AttemptExecuting, and a
non-terminal phase so a live lease cannot be extended after authority loss.
Align the mutable API renew prose with that precondition.
This commit is contained in:
ms2k 2026-07-15 16:59:35 +09:00
commit 0834f291d9

View file

@ -307,9 +307,13 @@ ActivateAttempt(a) ==
resumedFromCheckpoint, stageState, pendingOutcome>>
RenewLease(a) ==
LET w == attemptWorker[a]
LET j == JobOf(a)
w == attemptWorker[a]
IN /\ leaseState[a] = LeaseLive
/\ leaseAge[a] > 0
/\ CurrentAuthority(a)
/\ attemptState[a] = AttemptExecuting
/\ phase[j] \notin TerminalPhases
/\ workerState[w] = WorkerUp
/\ CanReach(w, CoordSvc)
/\ leaseAge' = [leaseAge EXCEPT ![a] = 0]