ctdb-daemon: Log per-database summary of resent calls
authorMartin Schwenke <martin@meltin.net>
Fri, 15 Oct 2021 00:10:46 +0000 (11:10 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 31 May 2022 05:06:29 +0000 (05:06 +0000)
After a recovery that takes a significant amount of time the logs are
flooded with messages about every resent call.

Log a summary instead and demote per-call messages to INFO level.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_call.c

index 14baa797bd637cfc595ebcfeff2e2b0b5e8fad27..1d5dea32962b30f3bec86a6709012a1aea0b6824 100644 (file)
@@ -1398,8 +1398,10 @@ static void ctdb_call_resend(struct ctdb_call_state *state)
        state->c->hdr.destnode = ctdb->pnn;
 
        ctdb_queue_packet(ctdb, &state->c->hdr);
-       DEBUG(DEBUG_NOTICE,("resent ctdb_call for db %s reqid %u generation %u\n",
-                           state->ctdb_db->db_name, state->reqid, state->generation));
+       D_INFO("resent ctdb_call for db %s reqid %u generation %u\n",
+              state->ctdb_db->db_name,
+              state->reqid,
+              state->generation);
 }
 
 /*
@@ -1408,11 +1410,17 @@ static void ctdb_call_resend(struct ctdb_call_state *state)
 void ctdb_call_resend_db(struct ctdb_db_context *ctdb_db)
 {
        struct ctdb_call_state *state, *next;
+       unsigned int count = 0;
 
        for (state = ctdb_db->pending_calls; state; state = next) {
                next = state->next;
                ctdb_call_resend(state);
+               count++;
        }
+       D_NOTICE("Resent calls for database=%s, generation=%u, count=%u\n",
+                ctdb_db->db_name,
+                ctdb_db->generation,
+                count);
 }
 
 void ctdb_call_resend_all(struct ctdb_context *ctdb)