Skip to content
Get started

Controlled updates

View as Markdown

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.

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.updatePending tells the game that an update waits, so it starts no new rounds or shows “update after this round”.
  • mk deploy --deadline 30m sets an upper limit. After it, the plugin swaps even if a game hangs.

The connector tells the registry which revision runs and whether one waits. The registry turns that into a label, such as minekube.com/update=pending. 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.

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.

Was this helpful?