ctdb-daemon: Update logging for flag changes
authorMartin Schwenke <martin@meltin.net>
Thu, 8 Jul 2021 01:29:38 +0000 (11:29 +1000)
committerJule Anger <janger@samba.org>
Mon, 13 Sep 2021 11:47:10 +0000 (11:47 +0000)
When flags change, promote the message to NOTICE level and switch the
message to the style that is currently generated by
ctdb-recoverd.c:monitor_handler().  This will allow monitor_handler()
to go away in future.

Drop logging when flags do not change.  The recovery master now logs
when it pushes flags for a node, so the lack of a corresponding
"changed flags" message here indicates that no update was required.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14784
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit b6d25d079e30919457cacbfbbfd670bf88295a9c)

ctdb/server/ctdb_monitor.c

index a49162dd9d9ffd40cbb36b92e14773330301ffc4..84d8c2ce2991ce67acebeb372199fe3a5e3f3e2c 100644 (file)
@@ -485,11 +485,13 @@ int32_t ctdb_control_modflags(struct ctdb_context *ctdb, TDB_DATA indata)
        }
 
        if (node->flags == old_flags) {
-               DEBUG(DEBUG_INFO, ("Control modflags on node %u - Unchanged - flags 0x%x\n", c->pnn, node->flags));
                return 0;
        }
 
-       DEBUG(DEBUG_INFO, ("Control modflags on node %u - flags now 0x%x\n", c->pnn, node->flags));
+       D_NOTICE("Node %u has changed flags - 0x%x -> 0x%x\n",
+                c->pnn,
+                old_flags,
+                node->flags);
 
        if (node->flags == 0 && ctdb->runstate <= CTDB_RUNSTATE_STARTUP) {
                DEBUG(DEBUG_ERR, (__location__ " Node %u became healthy - force recovery for startup\n",