Add function comment to is_wd_lifecheck_ready.
authorTatsuo Ishii <ishii@postgresql.org>
Tue, 22 Jul 2025 07:48:45 +0000 (16:48 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Tue, 22 Jul 2025 10:47:03 +0000 (19:47 +0900)
Also clarify a debug message. Previous it stated that the reason for
the function returns WD_NG was that pgpool has not send hearbeat
yet. Actually the reason could be that pgpool has not received
hearbeat yet too.

src/watchdog/wd_lifecheck.c

index b62a9b493f1dfc3d29f0ea0720547afb906a2c0f..5830d82af9085c187c5a914933b66b5064b7f227 100644 (file)
@@ -642,7 +642,14 @@ load_watchdog_nodes_from_json(char *json_data, int len)
        json_value_free(root);
 }
 
-
+/*----------
+ * is_wd_lifecheck_ready
+ *
+ * Check all registered watchdog nodes and returns WD_OK if:
+ * query mode: wd_ping_pgpool returns WD_OK
+ * hearbeat mode: has received from and
+ *                               sent to all node the heartbeat message
+ */
 static int
 is_wd_lifecheck_ready(void)
 {
@@ -680,7 +687,7 @@ is_wd_lifecheck_ready(void)
                        {
                                ereport(DEBUG1,
                                                (errmsg("watchdog checking life check is ready"),
-                                                errdetail("pgpool:%d at \"%s:%d\" has not send the heartbeat signal yet",
+                                                errdetail("pgpool:%d at \"%s:%d\" has not received from or sent to the heartbeat signal yet",
                                                                   i, node->hostName, node->pgpoolPort)));
                                rtn = WD_NG;
                        }