Skip to content

Commit 129a907

Browse files
committed
Do not send hearbeats when arbiter is existing
1 parent 313dd35 commit 129a907

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

contrib/mmts/arbiter.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ static char const* const messageText[] =
129129

130130
static BackgroundWorker MtmSender = {
131131
"mtm-sender",
132-
BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION, /* do not need connection to the database */
132+
BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION,
133133
BgWorkerStart_ConsistentState,
134134
MULTIMASTER_BGW_RESTART_TIMEOUT,
135135
MtmTransSender
136136
};
137137

138138
static BackgroundWorker MtmRecevier = {
139139
"mtm-receiver",
140-
BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION, /* do not need connection to the database */
140+
BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION,
141141
BgWorkerStart_ConsistentState,
142142
MULTIMASTER_BGW_RESTART_TIMEOUT,
143143
MtmTransReceiver
@@ -337,9 +337,11 @@ static void MtmCheckResponse(MtmArbiterMessage* resp)
337337
static void MtmScheduleHeartbeat()
338338
{
339339
// Assert(!last_sent_heartbeat || last_sent_heartbeat + MSEC_TO_USEC(MtmHeartbeatRecvTimeout) >= MtmGetSystemTime());
340-
enable_timeout_after(heartbeat_timer, MtmHeartbeatSendTimeout);
341-
send_heartbeat = true;
342-
PGSemaphoreUnlock(&Mtm->votingSemaphore);
340+
if (!stop) {
341+
enable_timeout_after(heartbeat_timer, MtmHeartbeatSendTimeout);
342+
send_heartbeat = true;
343+
PGSemaphoreUnlock(&Mtm->votingSemaphore);
344+
}
343345
}
344346

345347
static void MtmSendHeartbeat()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy