← Inside orch contents

Chapter 22 — worked answers

1. Five before the maximum, four after

Current three exceeds minimum two. ceil(3×90/60)=ceil 4.5=5; maximum four clamps to four. The result changes desired replicas only if a caller executes the controller and ScaleService accepts the change; no cluster-fit or traffic result follows automatically.

2. Memory owns cooldown

lastScaleAt is created empty in NewController and written after successful scaling. A replacement controller lacks the previous timestamp even if the same MemoryService persists. A fresh default server additionally loses service state. Durable cooldown requires another owner and recovery test, not a larger duration setting.

3. Declared fields and nil results are bounded evidence

StabilizationWindow is validated but unused in this controller, so it proves neither retained history nor downscale damping. Provider errors are handled as skip_metrics with nil return, so successful RunOnce may represent no decision. Inspect emitted decision/reason and provider timestamps.

4. Provider and composition are separate gates

Specify percentage units, task/version aggregation, freshness limits, missing samples, authenticated bounded queries and reproducible fixtures. Then verify the executable constructs that provider/controller and routes accepted decisions through admission/quota/maintenance. Default startup has no such construction, so valid YAML is intent without an active consumer.

Return to Chapter 22.