ctdb: Improve debug in case of set_runstate failure
authorVolker Lendecke <vl@samba.org>
Sun, 24 Apr 2016 14:07:43 +0000 (16:07 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 16 May 2016 17:52:21 +0000 (19:52 +0200)
If this fails, we want to know which states it wanted to move to. Don't do the
return before the debug.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
ctdb/common/ctdb_util.c

index 39108bcffb92f0db170a980330de145f595b7482..154878b0f328cc342e3c2a3b75bd1ec2b2aa62d2 100644 (file)
@@ -642,12 +642,13 @@ enum ctdb_runstate runstate_from_string(const char *label)
 
 void ctdb_set_runstate(struct ctdb_context *ctdb, enum ctdb_runstate runstate)
 {
+       DEBUG(DEBUG_NOTICE,("Set runstate to %s (%d)\n",
+                           runstate_to_string(runstate), runstate));
+
        if (runstate <= ctdb->runstate) {
                ctdb_fatal(ctdb, "runstate must always increase");
        }
 
-       DEBUG(DEBUG_NOTICE,("Set runstate to %s (%d)\n",
-                           runstate_to_string(runstate), runstate));
        ctdb->runstate = runstate;
 }