From: Kefu Chai <k.chai@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager 4/5] ceph: add require_min_compat_client upgrade check
Date: Tue, 28 Apr 2026 10:45:37 +0800 [thread overview]
Message-ID: <20260428024538.3559017-5-k.chai@proxmox.com> (raw)
In-Reply-To: <20260428024538.3559017-1-k.chai@proxmox.com>
Notice if require_min_compat_client is unset or older than the current
backend default, with a reminder to run 'ceph features' first to check
connected clients. Bumping the flag unlocks commands that use newer
on-map features such as pg-upmap-primary and the read-balancer;
enabling any of those features afterwards will exclude older clients.
The check is notice-only. Admins need to decide on a case-by-case
basis whether it is safe to bump.
See
https://docs.ceph.com/en/latest/rados/operations/require-min-compat-client/
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
---
PVE/Ceph/UpgradeCheck.pm | 49 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/PVE/Ceph/UpgradeCheck.pm b/PVE/Ceph/UpgradeCheck.pm
index 5c454fd1..09418df3 100644
--- a/PVE/Ceph/UpgradeCheck.pm
+++ b/PVE/Ceph/UpgradeCheck.pm
@@ -52,6 +52,7 @@ sub run_checks {
push @messages, $health_msgs->@*;
push @messages, check_require_osd_release($supported_release)->@*;
+ push @messages, check_require_min_compat_client($supported_release)->@*;
my ($version_msgs, $noout_wanted) = check_versions($supported_release, $upgraded);
push @messages, $version_msgs->@*;
@@ -394,4 +395,52 @@ sub check_require_osd_release {
return \@out;
}
+sub check_require_min_compat_client {
+ my ($supported_release) = @_;
+
+ my @out;
+
+ my $osdmap = eval { PVE::Ceph::Tools::get_osd_dump() };
+ if ($@ || !$osdmap) {
+ my $err = $@ || 'empty osd dump';
+ push @out, { level => 'warn', msg => "could not query osd dump: $err" };
+ return \@out;
+ }
+
+ my $current = $osdmap->{require_min_compat_client} // '';
+ my $expected_codename = PVE::Ceph::Releases::get_codename_for_major_release($supported_release)
+ // PVE::Ceph::Releases::get_default_ceph_release_codename();
+
+ if (!$current) {
+ push @out,
+ {
+ level => 'notice',
+ msg => "require_min_compat_client is unset. Check connected clients with"
+ . " 'ceph features', then 'ceph osd set-require-min-compat-client <release>'"
+ . " to unlock features like pg-upmap-primary and the read-balancer."
+ . " Enabling any of those features afterwards will exclude older clients.",
+ };
+ return \@out;
+ }
+
+ my $expected_release = release_number($expected_codename);
+ my $current_release = release_number($current);
+
+ if (!defined($current_release) || $current_release < $expected_release) {
+ push @out,
+ {
+ level => 'notice',
+ msg => "require_min_compat_client is '$current' (< '$expected_codename')."
+ . " If 'ceph features' shows no clients older than '$expected_codename',"
+ . " 'ceph osd set-require-min-compat-client $expected_codename' unlocks"
+ . " features like pg-upmap-primary and the read-balancer."
+ . " Enabling any of those features afterwards will exclude older clients.",
+ };
+ } else {
+ push @out, { level => 'pass', msg => "require_min_compat_client is at '$current'." };
+ }
+
+ return \@out;
+}
+
1;
--
2.47.3
next prev parent reply other threads:[~2026-04-28 2:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 2:45 [PATCH manager 0/5] ceph: add 'pveceph upgrade-check' subcommand Kefu Chai
2026-04-28 2:45 ` [PATCH manager 1/5] pve8to9: extract ceph checks into PVE::Ceph::UpgradeCheck Kefu Chai
2026-04-28 2:45 ` [PATCH manager 2/5] ceph: add pveceph upgrade-check command Kefu Chai
2026-04-28 2:45 ` [PATCH manager 3/5] ceph: add require_osd_release upgrade check Kefu Chai
2026-04-28 2:45 ` Kefu Chai [this message]
2026-04-28 2:45 ` [PATCH manager 5/5] ceph: drop duplicate release-to-codename map in upgrade checks Kefu Chai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260428024538.3559017-5-k.chai@proxmox.com \
--to=k.chai@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox