Controlled updates
Today the Minekube plugin swaps a game as soon as a new revision arrives, so a running round starts over in the middle. Three planned primitives make updates controlled. When to swap and where new players go stays the decision of the network’s own code.
A game holds the update
Section titled “A game holds the update”const round = Effect.gen(function* () { yield* Paper.holdUpdates; // while this scope is open, an update waits // … the round …}).pipe(Effect.scoped);- The new revision is already loaded while it waits. When the last hold is released, the plugin swaps it in.
Paper.updatePendingtells the game that an update waits, so it starts no new rounds or shows “update after this round”.mk deploy --deadline 30msets an upper limit. After it, the plugin swaps even if a game hangs.
Servers report what they run
Section titled “Servers report what they run”The connector tells the registry which revision runs and whether one waits. The registry turns that into a label, such as minekube.com/. A network’s routing can then send new players to other servers while rounds end. mk deployments list shows how many servers run the new revision and how many wait.
Rollouts in waves
Section titled “Rollouts in waves”mk versions deploy <id> --batch 20% deploys a version to a part of the matching servers first. The next wave starts when those servers report that the new revision runs. If it fails to start on one, the rollout stops, and mk rollback goes back. Waves split by servers, not by requests: a server runs one revision.
A restart for a plugin update waits for the same holds.
Related
Section titled “Related”- Live swap: what a swap does today.
- Labels and selectors: the labels routing reads, in Connect.
Was this helpful?
Thanks for the feedback.