Rolling updates and service rollback
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Use only the fictional worksheet for this exercise. Before a separately authorized read-only server query, verify the effective endpoint including environment overrides, project or cluster identity, and access scope. Never deploy the fragments, use real credentials or transmit private inspection output.
Offline rollout plan:service web: 4 replicas, version A -> version Bparallelism: 1; order: stop-first; failure action: pausemonitoring window: explicitly reviewed for app behaviorbatch 1: replacement running; transaction fails externallyDecision: hold further promotion; investigate; review rollbackAlternative start-first requires overlap capacity.Staged observation: docker service ps bm28_webStop-first replaces a task after stopping its predecessor, so nominal running capacity can temporarily drop. Start-first starts a replacement before stopping the old task, requiring extra capacity and compatibility with simultaneous versions; a fixed host port may prevent overlap. Parallelism controls concurrent task updates, and failure monitoring controls which failures the updater recognizes. An external business transaction failing does not necessarily trigger automatic update failure. Operators need independent end-to-end gates and a response procedure. A service rollback can restore its previous service specification, not all other services, database writes or changed schema. Record immutable images, compatible config and secrets, and tested rollback procedures before starting. Avoid promising no interruption based solely on update settings. For six replicas and parallelism two, the nominal stop-first minimum is four other running tasks; start-first can require two extra task slots, for eight concurrent tasks. Neither number guarantees healthy traffic. An external failed transaction must trigger an independent hold even if the updater reports success.
Common mistake
Do not treat a running replacement as proof of successful business behavior. Do not blindly roll back after an incompatible migration.
Manual practice
For six replicas and parallelism two, compute the nominal remaining old or other running tasks during a stop-first batch assuming no other failures. Identify capacity needed for start-first overlap and a condition requiring human review.
Worksheet: lab-fixtures/docker-swarm-orchestration/07-rolling-updates/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Rolling updates and service rollback — Knowledge check
Interpret cluster orchestration evidence and make a safe operational decision.
Assuming no other failures, how many other tasks remain nominally running during a stop-first batch of one out of four?
What must start-first accommodate?
What does service rollback not automatically reverse?