sigjmp_buf local_sigjmp_buf;
+ bool first = true;
+
/* For PostmasterRandom */
gettimeofday(&random_start_time, NULL);
MemoryContextSwitchTo(TopMemoryContext);
+ /*
+ * if the primary node id is not loaded by watchdog, search for it
+ */
+ if (Req_info->primary_node_id < 0)
+ {
+ /* Save primary node id */
+ Req_info->primary_node_id = find_primary_node_repeatedly();
+ }
+
/* fork a child for PCP handling */
pcp_unix_fd = create_unix_domain_socket(pcp_un_addr);
/* Add onproc exit to clean up the unix domain socket at exit */
health_check_pids[i] = worker_fork_a_child(PT_HEALTH_CHECK, do_health_check_child, &i);
}
- /*
- * check for child signals to ensure child startup before reporting successfull start
- */
- CHECK_REQUEST;
-
- ereport(LOG,
- (errmsg("%s successfully started. version %s (%s)", PACKAGE, VERSION, PGPOOLVERSION)));
-
- /*
- * if the primary node id is not loaded by watchdog, search for it
- */
- if (Req_info->primary_node_id < 0)
- {
- /* Save primary node id */
- Req_info->primary_node_id = find_primary_node();
- }
-
if (sigsetjmp(local_sigjmp_buf, 1) != 0)
{
/* Since not using PG_TRY, must reset error stack by hand */
{
CHECK_REQUEST;
+ /*
+ * check for child signals to ensure child startup before reporting
+ * successfull start.
+ */
+ if (first)
+ ereport(LOG,
+ (errmsg("%s successfully started. version %s (%s)", PACKAGE, VERSION, PGPOOLVERSION)));
+ first = false;
+
processState = SLEEPING;
for (;;)
{