fix(cutover): persist rollback completion state

This commit is contained in:
chick
2026-07-18 18:02:59 +08:00
parent bd8a3fed5b
commit 63d167d720
+10 -1
View File
@@ -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;
} }