fix(cutover): persist rollback completion state
This commit is contained in:
@@ -486,5 +486,14 @@ export async function rollback(plan: CutoverPlan, system: CutoverSystem): Promis
|
|||||||
throw new Error(`Gateway PID identity mismatch; refusing to signal PID ${state.gatewayPid}`);
|
throw new Error(`Gateway PID identity mismatch; refusing to signal PID ${state.gatewayPid}`);
|
||||||
system.signal(state.gatewayPid, 'SIGTERM');
|
system.signal(state.gatewayPid, 'SIGTERM');
|
||||||
await system.waitGone(state.gatewayPid);
|
await system.waitGone(state.gatewayPid);
|
||||||
return restoreLegacy(plan, system);
|
const legacyPid = await restoreLegacy(plan, system);
|
||||||
|
await durableState(plan, {
|
||||||
|
version: STATE_VERSION,
|
||||||
|
phase: 'prepared',
|
||||||
|
legacyPid,
|
||||||
|
legacyCommand: plan.legacyCommand,
|
||||||
|
legacyIdentity: await system.identity(legacyPid),
|
||||||
|
legacyStart: plan.legacyStart,
|
||||||
|
});
|
||||||
|
return legacyPid;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user