]> git.proxmox.com Git - pve-ha-manager.git/commit
lrm: fix getting stuck on restart
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 27 Apr 2022 10:19:55 +0000 (12:19 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 27 Apr 2022 11:57:37 +0000 (13:57 +0200)
commitad6456997ec39cd06c0378bdcca4d34ba2b31977
tree49f69d07e45b01a45855e5d7a85a9536e410696c
parentfe3781e8abd0cdb11875e76338f2a331d5d3e5bb
lrm: fix getting stuck on restart

run_workers is responsible for updating the state after workers have
exited. if the current LRM state is 'active', but a shutdown_request was
issued in 'restart' mode (like on package upgrades), this call is the
only one made in the LRM work() loop.

skipping it if there are active services means the following sequence of
events effectively keeps the LRM from restarting or making any progress:

- start HA migration on node A
- reload LRM on node A while migration is still running

even once the migration is finished, the service count is still >= 1
since the LRM never calls run_workers (directly or via
manage_resources), so the service having been migrated is never noticed.

maintenance mode (i.e., rebooting the node with shutdown policy migrate)
does call manage_resources and thus run_workers, and will proceed once
the last worker has exited.

reported by a user:

https://forum.proxmox.com/threads/lrm-hangs-when-updating-while-migration-is-running.108628

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/PVE/HA/LRM.pm