The HA group migration is executed if the HA groups config is still
present in the HA config directory and individually updates every HA
resource, even if none of those are part of a HA group.

The call to update_service_config(...) for the HA resources without
group assignments cause unnecessary updates to the config and can become
costly with higher HA resource counts, which might prevent the CRM to
update its watchdog in time, so skip these updates.

Signed-off-by: Daniel Kral <[email protected]>
---
 src/PVE/HA/Manager.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/HA/Manager.pm b/src/PVE/HA/Manager.pm
index f5843dd4..80b29966 100644
--- a/src/PVE/HA/Manager.pm
+++ b/src/PVE/HA/Manager.pm
@@ -580,6 +580,9 @@ my $migrate_group_persistently = sub {
 
         PVE::HA::Groups::migrate_groups_to_resources($groups, $resources);
         for my $sid (keys %$resources) {
+            # prevent unnecessary updates for HA resources that do not change
+            next if !defined($resources->{$sid}->{group});
+
             my $param = { failback => $resources->{$sid}->{failback} };
 
             $haenv->update_service_config($sid, $param, 'group');
-- 
2.47.3



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to