Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 404450f

Browse files
committed
WaitLatch stats
1 parent b1a45d8 commit 404450f

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

arbiter.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
#include "replication/slot.h"
5858
#include "port/atomics.h"
5959
#include "tcop/utility.h"
60-
#include "libpq/ip.h"
60+
#include "common/ip.h"
61+
#include "pgstat.h"
6162

6263

6364
#ifndef USE_EPOLL
@@ -822,7 +823,7 @@ static void MtmMonitor(Datum arg)
822823
BackgroundWorkerInitializeConnection(MtmDatabaseName, NULL);
823824

824825
while (!stop) {
825-
int rc = WaitLatch(&MyProc->procLatch, WL_TIMEOUT | WL_POSTMASTER_DEATH, MtmHeartbeatRecvTimeout);
826+
int rc = WaitLatch(&MyProc->procLatch, WL_TIMEOUT | WL_POSTMASTER_DEATH, MtmHeartbeatRecvTimeout, PG_WAIT_EXTENSION);
826827
if (rc & WL_POSTMASTER_DEATH) {
827828
break;
828829
}

multimaster.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#include "fmgr.h"
1515
#include "miscadmin.h"
1616
#include "common/pg_socket.h"
17+
#include "pgstat.h"
18+
#include "utils/regproc.h"
1719

1820
#include "libpq-fe.h"
1921
#include "lib/stringinfo.h"
@@ -1290,7 +1292,7 @@ Mtm2PCVoting(MtmCurrentTrans* x, MtmTransState* ts)
12901292
{
12911293
MtmUnlock();
12921294
MTM_TXTRACE(x, "PostPrepareTransaction WaitLatch Start");
1293-
result = WaitLatch(&MyProc->procLatch, WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH, MtmHeartbeatSendTimeout);
1295+
result = WaitLatch(&MyProc->procLatch, WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH, MtmHeartbeatSendTimeout, PG_WAIT_EXTENSION);
12941296
MTM_TXTRACE(x, "PostPrepareTransaction WaitLatch Finish");
12951297
/* Emergency bailout if postmaster has died */
12961298
if (result & WL_POSTMASTER_DEATH) {

pglogical_receiver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,8 @@ pglogical_receiver_main(Datum main_arg)
400400
/* Wait necessary amount of time */
401401
rc = WaitLatch(&MyProc->procLatch,
402402
WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH,
403-
receiver_idle_time * 1L);
403+
receiver_idle_time * 1L,
404+
PG_WAIT_EXTENSION);
404405
ResetLatch(&MyProc->procLatch);
405406
/* Process signals */
406407
if (got_sighup)

referee.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "storage/latch.h"
2727
#include "storage/proc.h"
2828
#include "storage/ipc.h"
29+
#include "pgstat.h"
2930

3031
#include "multimaster.h"
3132

@@ -96,7 +97,7 @@ static void MtmRefereeLoop(char const** connections, int nConns)
9697
}
9798
}
9899
/* Wait some time */
99-
result = WaitLatch(&MyProc->procLatch, WL_TIMEOUT | WL_POSTMASTER_DEATH, MtmHeartbeatRecvTimeout);
100+
result = WaitLatch(&MyProc->procLatch, WL_TIMEOUT | WL_POSTMASTER_DEATH, MtmHeartbeatRecvTimeout, PG_WAIT_EXTENSION);
100101
if (result & WL_POSTMASTER_DEATH) {
101102
proc_exit(1);
102103
}

0 commit comments

Comments
 (0)