From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id ABB341FF146 for ; Tue, 28 Apr 2026 04:46:47 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8D2802719; Tue, 28 Apr 2026 04:46:47 +0200 (CEST) From: Kefu Chai 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 Message-ID: <20260428024538.3559017-5-k.chai@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260428024538.3559017-1-k.chai@proxmox.com> References: <20260428024538.3559017-1-k.chai@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777344258570 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.311 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: HHU6RKTI43GP4QHOUHYM53SSBO6RI5M6 X-Message-ID-Hash: HHU6RKTI43GP4QHOUHYM53SSBO6RI5M6 X-MailFrom: k.chai@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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 '" + . " 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