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

Commit acd3a72

Browse files
knizhnikkelvich
authored andcommitted
Do not send hearbeats when arbiter is existing
1 parent aaa5ee8 commit acd3a72

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

arbiter.c

+7-5
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)