Add durable maintenance prepare and resume operations
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- api, backend, distributed-systems
Línea de trabajo
Comienza con ADR 0021 y la API del cliente en este issue, y luego rastrea las dependencias #71, #72, #73, #74 y #76. Define las transiciones de estado duraderas de prepare/resume y verifica cada condición de finalización indicada, incluido el comportamiento tras un reinicio, la idempotencia de epoch, la espera del external-fence y la reapertura de la admisión solo después de la convergencia en caliente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Part of #70. See ADR 0021.
Purpose
Add a durable maintenance mode that stays active after a process restart.
The current reset flow uses an in-memory fence. It releases leases, resets devices, and then reopens admission.
Host needs one prepare operation and one resume operation. Host must not call Simlock's internal cleanup steps.
Client API
type MaintenanceState =
| "preparing"
| "drained"
| "resuming"
| "awaiting-external-fence"
| "ready"
| "failed";
interface MaintenanceStatus {
epoch: string;
state: MaintenanceState;
activeLeaseCount: number;
activeMutationCount: number;
activation?: {
deviceId: string;
generation: number;
};
error?: SimlockError;
}
interface SimlockAdminClient {
prepareMaintenance(input: { epoch: string }): Promise<MaintenanceStatus>;
getMaintenanceStatus(input: { epoch: string }): Promise<MaintenanceStatus>;
confirmMaintenanceActivation(input: {
epoch: string;
deviceId: string;
generation: number;
}): Promise<MaintenanceStatus>;
resumeMaintenance(input: { epoch: string }): Promise<MaintenanceStatus>;
}
Prepare operation
prepareMaintenance must do these steps:
- Store the epoch and close lease and background-lifecycle admission in one serialized durable transition.
- Stop every background lifecycle producer.
- Release all leases.
- Wait for lifecycle mutations to finish.
- Reconcile only owned devices.
- Return
drainedwith both active counts at zero.
Read-only catalog and status operations can stay available.
Resume operation
resumeMaintenance is a durable loop:
- Load the stored epoch.
- Complete startup reconciliation.
- Advance the configured warm target from #76 through its single core convergence owner.
- If a reusable identity needs an execution fence, persist and return
awaiting-external-fencewith its device ID and generation. Keep Simlock drained. - Use the active epoch to confirm the same core activation transition that #76 defines.
- After idempotent confirmation, repeat
resumeMaintenancefor the same epoch and continue convergence. - Return
readyand reopen lease admission only after warm convergence settles.
Epoch rules
- Repeating an operation for the same epoch returns the same progress or result.
- A different epoch returns
MAINTENANCE_EPOCH_ACTIVEwithout a mutation. - A stale resume or activation message cannot change a newer epoch or generation.
- A non-epoch warm mutation cannot advance an identity while the epoch is active.
- A client disconnect stops only that client's wait.
- A daemon restart keeps the epoch active and lease admission closed.
- The epoch has no TTL. Failure or supervisor death keeps Simlock drained.
- Simlock can clear the active epoch only after
resumeMaintenancereturnsready. - Keep the terminal result for a configured recovery period so a lost response can be replayed.
Scope
Host owns session shutdown, artifact cleanup, and process restart order. Simlock owns allocator drain and device recovery.
The Host front-end must not expose these methods. Only the local managed adapter can call them through the Host admin boundary and the authenticated admin client from #71.
The adapter can call prepareMaintenance only while it holds an unforgeable in-process capability. Host creates this capability after it fences and drains device mutations, completes canonical session teardown, releases mapped Simlock leases, and proves zero live runner. Simlock receives only the epoch.
Completion conditions
- Prepare cannot admit a lease or background mutation after it stores the epoch.
- Prepare cannot return
drainedwhile a lease or lifecycle mutation exists. - Background refill, health recovery, quarantine retry, and the cleanup reaper cannot start work after the fence.
- Restart during maintenance does not reopen lease admission.
- Repeated prepare and resume calls do not repeat destructive work.
- Cleanup cannot target a leased, foreign, or unverified device.
- Resume stays drained while an external fence is pending.
- Non-epoch convergence and activation fail without mutation while maintenance is active.
- Resume reopens admission only after reconciliation, warm convergence, and required fence confirmation.
Depends on #71, #73, and #74. Reusable-identity activation also depends on #72. Warm convergence depends on #76.
- Lenguaje dominante
- TypeScript
- Estrellas
- 19
- Forks
- 1
- Merge medio
- 6 h 36 min
- PR fusionados (30 d)
- 170
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de callstackincubator/simlock
-
Lint does not enforce index.ts boundaries for cleanup/, routing/, warm-pool/ and contract/ helpersAbiertobug:new
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
callstackincubator/simlock#445 ·
Los mantenedores suelen responder en 1 día
-
bug:new
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
callstackincubator/simlock#424 ·
Los mantenedores suelen responder en 1 día
-
daemon-lifecycle e2e: the it.fails status test passes for the wrong reasonPosiblemente ocupada @V3RON la tomó hace 5 días. Abiertobug:triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
callstackincubator/simlock#422 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
request:new
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
callstackincubator/simlock#510 ·
Los mantenedores suelen responder en 1 día
-
task:draft
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
callstackincubator/simlock#491 ·
Los mantenedores suelen responder en 1 día
Todos los issues de callstackincubator/simlock
Issues similares
-
ui(ListToolbar): search takes the full row on a phone instead of sharing it with the result countAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
priority:high
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
immich-app/immich#32426 ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue hacktoberfest help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
libredb/libredb-studio#1756 ·
Los mantenedores suelen responder en 1 día