[pve-devel] applied: [PATCH manager] api/ceph: skip merging metadata if hostname is undefined

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Nov 21 10:59:16 CET 2019


It's a bit hard to figure out the exact constellation required for
this to happen, but we saw it in live systems when one node was dead
in a three node cluster.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 PVE/API2/Cluster/Ceph.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/API2/Cluster/Ceph.pm b/PVE/API2/Cluster/Ceph.pm
index 336207e3..9e3cce50 100644
--- a/PVE/API2/Cluster/Ceph.pm
+++ b/PVE/API2/Cluster/Ceph.pm
@@ -93,6 +93,8 @@ __PACKAGE__->register_method ({
 	    my $services = $rados->mon_command({ prefix => "$type metadata" });
 	    for my $service ( @$services ) {
 		my $hostname = $service->{hostname};
+		next if !defined($hostname); # can happen if node is dead
+
 		my $servicename =  $service->{name} // $service->{id};
 		my $id = "$servicename\@$hostname";
 
-- 
2.20.1





More information about the pve-devel mailing list