Skip to content

Commit 4c54dc0

Browse files
committed
Fix pg_stat_wait on replics
1 parent 9f7123d commit 4c54dc0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: contrib/pg_stat_wait/collector.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void
5252
AllocateCollectorMem(void)
5353
{
5454
bool found;
55-
Size segsize= CollectorShmemSize();
55+
Size segsize = CollectorShmemSize();
5656

5757
pgsw = ShmemInitStruct("pg_stat_wait", segsize, &found);
5858

@@ -96,7 +96,7 @@ RegisterWaitsCollector(void)
9696
/* set up common data for all our workers */
9797
worker.bgw_flags = BGWORKER_SHMEM_ACCESS |
9898
BGWORKER_BACKEND_DATABASE_CONNECTION;
99-
worker.bgw_start_time = BgWorkerStart_RecoveryFinished;
99+
worker.bgw_start_time = BgWorkerStart_ConsistentState;
100100
worker.bgw_restart_time = BGW_NEVER_RESTART;
101101
worker.bgw_main = collector_main;
102102
worker.bgw_notify_pid = 0;
@@ -233,6 +233,7 @@ collector_main(Datum main_arg)
233233
BackgroundWorkerUnblockSignals();
234234

235235
hdr->latch = &MyProc->procLatch;
236+
236237
CurrentResourceOwner = ResourceOwnerCreate(NULL, "pg_stat_wait collector");
237238
collector_context = AllocSetContextCreate(TopMemoryContext,
238239
"pg_stat_wait context",

0 commit comments

Comments
 (0)