Chapter 1 - Worked answers
1. Acceptance and execution
CreateService stores desired service state and may create assigned tasks, but it does not call Docker. The API response establishes accepted intention in one MemoryService. The agent later polls and calls its runtime. A healthy replica requires an accepted report and, for operational evidence, an independent Docker/endpoint observation. A task ID correlates these facts without making them simultaneous. See controlplane.go1253–1323 and agent.go253–265 at the chapter's pinned links.
2. The state owner
Server main146 calls controlplane.NewMemoryService. Its constructor allocates maps, including services and tasks. The optional ORCH_SCHEMA_CHECK branch runs before this constructor and opens a migration runner only to read schema status. A successful migration changes PostgreSQL tables, not the constructor or backing store of those maps. Choosing durable storage is a composition/service-layer change, not a database URL setting.
3. The unsafe readiness assumption
The ready handler returns a fixed success response. Still missing are the pre-restart service/task IDs in the new API and the actual state of containers left on workers. Also check node credential continuity and the endpoint independently. If the API is empty while Docker has running containers, report that split observation; do not call the old workload recovered or safely removed. A controller restart using the same service instance would not test this failure.
4. Deployment choice
The disposable training cluster fits the baseline when its state may be discarded and the owner can inspect/clean all resources. The payroll workload's stated requirement is not met: fresh server maps lose desired state, and a database package is not integrated. A justified next step is to evaluate an established platform or design/test a separate durable service composition with feature parity and process recovery. Neither choice requires pretending the existing code is useless; its inspectable seams are valuable precisely because their limits are explicit.
These are reasoning answers checked against source. They do not claim an unrecorded live deployment or process-restart observation.
Return to Chapter 1.