public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ceph: fix version check shortcut
Date: Fri,  5 Nov 2021 15:23:47 +0100	[thread overview]
Message-ID: <20211105142347.2746122-1-d.csapak@proxmox.com> (raw)

with 'get_node_kv', we get a hash which contains the value for
all nodes in the cluster (with the nodename as key), so we have to use
the value from the hash corresponding to our nodename.

also the 'str' property is inside the 'version' hash

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
i noticed on my ceph cluster many warnings from pvestatd, because of this
 PVE/Ceph/Services.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/PVE/Ceph/Services.pm b/PVE/Ceph/Services.pm
index ad41dbe4..5340f5fc 100644
--- a/PVE/Ceph/Services.pm
+++ b/PVE/Ceph/Services.pm
@@ -52,9 +52,10 @@ sub broadcast_ceph_versions {
 
     if ($version) {
 	if (my $old = PVE::Cluster::get_node_kv("ceph-versions")) {
-	    $old = eval { decode_json($old) };
+	    my $nodename = PVE::INotify::nodename();
+	    $old = eval { decode_json($old->{$nodename}) };
 	    warn $@ if $@; # should not happen
-	    if (defined($old) && $old->{buildcommit} eq $buildcommit && $old->{str} eq $version) {
+	    if (defined($old) && $old->{buildcommit} eq $buildcommit && $old->{version}->{str} eq $version) {
 		return; # up to date, nothing to do so avoid (not exactly cheap) broadcast
 	    }
 	}
-- 
2.30.2





             reply	other threads:[~2021-11-05 14:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05 14:23 Dominik Csapak [this message]
2021-11-07 20:07 ` [pve-devel] applied: " Thomas Lamprecht

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=20211105142347.2746122-1-d.csapak@proxmox.com \
    --to=d.csapak@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal