[pve-devel] [PATCH ha-manager v3 5/6] fix infinite started <=> migrate cycle

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Feb 19 18:41:06 CET 2016


If we get an 'EWRONG_NODE' error from the migration we have no sane
way out. If we place it then in the started state we also get the
'EWRONG_NODE' error again and it even will place the service in
the migration state again (when it's not restricted by a group) and
thus result in an infinite started <=> migrate cycle.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/HA/Manager.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/PVE/HA/Manager.pm b/src/PVE/HA/Manager.pm
index c03690f..83165f0 100644
--- a/src/PVE/HA/Manager.pm
+++ b/src/PVE/HA/Manager.pm
@@ -472,6 +472,10 @@ sub next_state_migrate_relocate {
 	if ($exit_code == SUCCESS) {
 	    &$change_service_state($self, $sid, 'started', node => $sd->{target});
 	    return;
+	} elsif ($exit_code == EWRONG_NODE) {
+	    $haenv->log('err', "service '$sid' - migration failed: service" .
+			" registered on wrong node!");
+	    &$change_service_state($self, $sid, 'error');
 	} else {
 	    $haenv->log('err', "service '$sid' - migration failed (exit code $exit_code)");
 	    &$change_service_state($self, $sid, 'started', node => $sd->{node});
-- 
2.1.4





More information about the pve-devel mailing list