public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH manager] ceph: services: broadcast versions: improve requesting old version
Date: Thu, 10 Mar 2022 08:50:13 +0100	[thread overview]
Message-ID: <49319235-0c70-8706-4d77-239e73eacc0a@proxmox.com> (raw)
In-Reply-To: <20211130103812.58366-1-f.ebner@proxmox.com>

Ping

Am 30.11.21 um 11:38 schrieb Fabian Ebner:
> to avoid a "malformed JSON string" warning when there is no old
> version present (e.g. after starting a cluster).
> 
> get_node_kv will always return something that evaluates to true, so
> instead, test if the result has an entry for the current node. Also,
> it's enough to request the kv for the current node only.
> 
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  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 cda13c6a..e0f31e8e 100644
> --- a/PVE/Ceph/Services.pm
> +++ b/PVE/Ceph/Services.pm
> @@ -51,8 +51,9 @@ sub broadcast_ceph_versions {
>      my ($version, $buildcommit, $vers_parts) = PVE::Ceph::Tools::get_local_version(1);
>  
>      if ($version) {
> -	if (my $old = PVE::Cluster::get_node_kv("ceph-versions")) {
> -	    my $nodename = PVE::INotify::nodename();
> +	my $nodename = PVE::INotify::nodename();
> +	my $old = PVE::Cluster::get_node_kv("ceph-versions", $nodename);
> +	if (defined($old->{$nodename})) {
>  	    $old = eval { decode_json($old->{$nodename}) };
>  	    warn $@ if $@; # should not happen
>  	    if (defined($old) && $old->{buildcommit} eq $buildcommit && $old->{version}->{str} eq $version) {




  reply	other threads:[~2022-03-10  7:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 10:38 Fabian Ebner
2022-03-10  7:50 ` Fabian Ebner [this message]
2022-04-26  6:30 ` [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=49319235-0c70-8706-4d77-239e73eacc0a@proxmox.com \
    --to=f.ebner@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