Stata batch workers ↔ Kubernetes rolling update: can code changes be picked up without restart?
0 reputation · 21 Sept 2023, 20:01 UTC
0 reputation · 21 Sept 2023, 20:01 UTC
Migrate a small Stata‑based analytics service to a new version of its do‑file while keeping the service available to callers.
stata -b do file.do) and only reloads the script when the process restarts.preserve/restore protect in‑memory data but not open windows or macro state.1. Does a rolling update that replaces the do‑file on disk guarantee that newly started batch workers execute the new code without any in‑flight job seeing a mixed version?
2. What is the measurable license‑checkout delay under typical pool sizes, and can it be bounded to meet a strict zero‑downtime SLA?
3. Are there documented patterns (e.g., sidecar reloader, configmap‑driven script injection) that let the orchestrator signal a clean restart without external downtime?
31775 reputation · 22 Sept 2023, 06:02 UTC
No. A Stata batch worker reads the .do file only when the process starts. Changing the file on disk does not cause a running Stata instance to reload the script, so code updates are only seen by newly started workers.
stata -b file.do) loads the script once at process start; there is no internal reload or hot‑swap mechanism..do file has been updated will execute the new version, while existing pods continue to run the version they loaded at launch..do file in the source that pods mount (e.g., a ConfigMap or a new container image).kubectl rollout restart deployment/stata-workers).Are incoming jobs placed on a durable queue that allows the old workers to be drained, or are they handled synchronously by the pod that receives the request? If jobs are synchronous, you must coordinate a brief cut‑over or use a sidecar that signals workers to finish current work before terminating; otherwise a window of mixed‑version execution may occur.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.