]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
LRM: release lock also on restart
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 18 Jan 2016 10:35:20 +0000 (11:35 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 18 Jan 2016 11:36:27 +0000 (12:36 +0100)
Wen restarting the LRM (e.g. on a update) we get an new pid and thus
have to wait for our own lock to timeout.
We can (and should) do that as there are no services or all services
are freezed. If they are freezed only our LRM may touch them so we
we can unfreeze them faster with this patch.

The expected log of the restart-lrm test does not change much as the
test system does not need to wait for a timeout.

This let's the LRM start working directly after a restart,
especially usefull on package updates.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/HA/LRM.pm
src/test/test-restart-lrm/log.expect

index 60ee44874219ee164f6c80ab0c962f131edcef6d..30df766e82279d88186bc6e5421bdf2084f12dd5 100644 (file)
@@ -282,6 +282,9 @@ sub do_one_iteration {
                            }
 
                            $shutdown = 1;
+
+                           # restart with no or freezed services, release the lock
+                           $haenv->release_ha_agent_lock();
                        }
                    }
                } else {
index 88cbd5aa55197045692173ecdc31fb0083861f3b..7e0a71e9374f668d4d93fb7ce13dd6a6e0c3e6ff 100644 (file)
@@ -26,5 +26,6 @@ info    120    node1/crm: service 'vm:103': state changed from 'started' to 'fre
 info    126    node3/lrm: exit (loop end)
 info    126    node3/lrm: status change startup => wait_for_agent_lock
 info    160    node1/crm: service 'vm:103': state changed from 'freeze' to 'started' 
+info    165    node3/lrm: got lock 'ha_agent_node3_lock'
 info    165    node3/lrm: status change wait_for_agent_lock => active
 info    720     hardware: exit simulation - done