]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
exec_resource_agent: process error state early
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 24 Feb 2016 07:33:58 +0000 (08:33 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 24 Feb 2016 09:30:54 +0000 (10:30 +0100)
We want to give the error state priority over EWRONG_NODE as a
service may be in the error state because of EWRONG_NODE

Change the error message a bit as we now can not distinguish
running and stopped services.

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

index b2d7d371ac840c1e7605afd22cd2611747cc08ba..fcbc33f853c918439d54a5d0f040609b6480b151 100644 (file)
@@ -645,6 +645,15 @@ sub exec_resource_agent {
        return EUNKNOWN_SERVICE;
     }
 
+    # process error state early
+    if ($cmd eq 'error') {
+
+       $haenv->log('err', "service $sid is in an error state and needs manual " .
+                   "intervention. Look up 'ERROR RECOVERY' in the documentation.");
+
+       return SUCCESS; # error always succeeds
+    }
+
     if ($service_config->{node} ne $nodename) {
        $haenv->log('err', "service '$sid' not on this node");
        return EWRONG_NODE;
@@ -715,15 +724,6 @@ sub exec_resource_agent {
 
        return SUCCESS;
 
-    } elsif ($cmd eq 'error') {
-
-       if ($running) {
-           $haenv->log("err", "service $sid is in an error state while running");
-       } else {
-           $haenv->log("warning", "service $sid is not running and in an error state");
-       }
-       return SUCCESS; # error always succeeds
-
     }
 
     $haenv->log("err", "implement me (cmd '$cmd')");
index 283ca8c3e726cc1ecbe15cd607a580e20474c3df..eb87f9fe09f6e663c9e7cf9b716d8a334b5db8af 100644 (file)
@@ -30,7 +30,7 @@ warn    143    node2/lrm: unable to start service fa:130
 err     143    node2/lrm: unable to start service fa:130 on local node after 1 retries
 err     160    node1/crm: recovery policy for service fa:130 failed, entering error state!
 info    160    node1/crm: service 'fa:130': state changed from 'started' to 'error'
-warn    163    node2/lrm: service fa:130 is not running and in an error state
+err     163    node2/lrm: service fa:130 is in an error state and needs manual intervention. Look up 'ERROR RECOVERY' in the documentation.
 info    220      cmdlist: execute service fa:130 disabled
 info    220    node1/crm: service 'fa:130': state changed from 'error' to 'stopped'
 info    820     hardware: exit simulation - done