From 195ae681caef707fe75225ddd715b4043854b6a5 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 26 Nov 2018 16:52:05 +0100 Subject: [PATCH] is_any_mds_active: check if state is correct a MDS gets transferred to the active MDS info once it got selected as active, not once it really _is_ active, it can be there in the 'up:creating' state. So ensure that a MDS with 'u:active' could be found Signed-off-by: Thomas Lamprecht --- PVE/CephTools.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PVE/CephTools.pm b/PVE/CephTools.pm index d80e2b65..8ee34d14 100644 --- a/PVE/CephTools.pm +++ b/PVE/CephTools.pm @@ -379,7 +379,11 @@ sub is_any_mds_active { } my $active_mds = $fs->[0]->{mdsmap}->{info}; - return scalar(keys %$active_mds) > 0; + for my $mds (values %$active_mds) { + return 1 if $mds->{state} eq 'up:active'; + } + + return 0; } sub create_mds {