[pve-devel] [PATCH manager] call cfs_update() before retrieving cluster status

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Apr 18 10:54:53 CEST 2019


otherwise this potentially returns outdated information (like the
cluster being quorate when corosync has crashed on all nodes 5 minutes
ago).

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 PVE/API2/Cluster.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm
index 5b6149a7..cbd7d3de 100644
--- a/PVE/API2/Cluster.pm
+++ b/PVE/API2/Cluster.pm
@@ -500,6 +500,9 @@ __PACKAGE__->register_method({
     code => sub {
 	my ($param) = @_;
 
+	# make sure we get current info
+	PVE::Cluster::cfs_update();
+
 	# we also add info from pmxcfs
 	my $clinfo = PVE::Cluster::get_clinfo(); 
 	my $members = PVE::Cluster::get_members();
-- 
2.20.1





More information about the pve-devel mailing list