From beae30cadbed09e79047c959002ee6e65001868e Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Wed, 29 Jul 2026 08:54:33 +0200 Subject: [PATCH 1/3] mxrolling-reboot: add load-aware rolling kernel reboot for mxqd nodes Reboot mxqd cluster nodes into a new kernel without killing running jobs and without draining the whole cluster at once. For each outdated node it drains mxqd (stop, then wait for the mxqd process to exit), installs a one-time systemd unit that runs mxqdctl-hostconfig start on the next boot and removes itself again, selects the kernel with mxgrub and reboots (kexec by default, or a normal reboot for firmware changes), all detached via systemd-run so long drains survive an SSH disconnect. Pacing is load-aware from the mxq server status page: at most BUSY_MAX nodes (default 2) when the cluster is fully busy, otherwise up to half of the currently idle nodes. Nodes already on the target kernel are detected via uname -r and skipped, so re-running is safe. The interactive (mxqi) nodes are handled as a separate, throttled pool: at most MXQI_MAX of them (default 1) are upgraded at a time and at least MXQI_MIN_UP (default 1) is always kept up and serving, so interactive sessions can always be started. mxqi nodes are auto-detected from /etc/hostconfig as the mxqd nodes whose prerequisites request 'mxqi'. Co-Authored-By: Claude Opus 4.8 --- mxq-rolling-reboot/README.md | 104 ++++++ mxq-rolling-reboot/mxrolling-reboot | 504 ++++++++++++++++++++++++++++ 2 files changed, 608 insertions(+) create mode 100644 mxq-rolling-reboot/README.md create mode 100755 mxq-rolling-reboot/mxrolling-reboot diff --git a/mxq-rolling-reboot/README.md b/mxq-rolling-reboot/README.md new file mode 100644 index 0000000..f467e50 --- /dev/null +++ b/mxq-rolling-reboot/README.md @@ -0,0 +1,104 @@ +# mxrolling-reboot + +Rolling kernel reboot of the `mxqd` cluster nodes: reboots every node into a +new kernel **without killing running jobs** and **without draining the whole +cluster at once**. + +## What it does + +For each node still running the old kernel it launches, detached via +`systemd-run`, the sequence: + +1. `mxqdctl-hostconfig stop` — mxqd stops accepting new jobs and exits once its + running jobs finished. +2. wait for the `mxqd` process(es) to disappear — i.e. wait (indefinitely) for + the node to be fully drained. `mxqdctl-hostconfig stop` only *signals* mxqd + and returns immediately, so this explicit wait is what makes the reboot + safe. +3. install a one-time systemd unit that runs `mxqdctl-hostconfig start` on the + next boot and then removes itself again (see below). +4. `mxgrub