Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit92c7c87

Browse files
knizhnikkelvich
authored andcommitted
Fix reace condition in tw_pahse.c
1 parent1d9e382 commit92c7c87

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

‎arbiter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,9 @@ static void MtmSendHeartbeat()
371371
}else {
372372
/* Connectivity mask can be cleared by MtmWatchdog: in this case sockets[i] >= 0 */
373373
if (BIT_CHECK(Mtm->connectivityMask,i)) {
374-
MtmDisconnect(i);
374+
close(sockets[i]);
375+
sockets[i]=-1;
376+
MtmReconnectNode(i+1);
375377
//MtmOnNodeConnect(i+1);
376378
}
377379
MTM_LOG4("Send heartbeat to node %d with timestamp %ld",i+1,now);

‎multimaster.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,6 +2021,13 @@ void MtmOnNodeConnect(int nodeId)
20212021
MtmUnlock();
20222022
}
20232023

2024+
voidMtmReconnectNode(intnodeId)
2025+
{
2026+
MtmLock(LW_EXCLUSIVE);
2027+
BIT_SET(Mtm->reconnectMask,nodeId-1);
2028+
MtmUnlock();
2029+
}
2030+
20242031

20252032

20262033
/*
@@ -3301,7 +3308,7 @@ bool MtmFilterTransaction(char* record, int size)
33013308
}
33023309

33033310
if (duplicate) {
3304-
MTM_LOG2("Ignore transaction %s from node %d flags=%x, our restartLSN for node: %lx,restart_lsn = (origin node %d == MtmReplicationNodeId %d) ? end_lsn=%lx, origin_lsn=%lx",
3311+
MTM_LOG1("Ignore transaction %s from node %d flags=%x, our restartLSN for node: %lx,restart_lsn = (origin node %d == MtmReplicationNodeId %d) ? end_lsn=%lx, origin_lsn=%lx",
33053312
gid,replication_node,flags,Mtm->nodes[origin_node-1].restartLSN,origin_node,MtmReplicationNodeId,end_lsn,origin_lsn);
33063313
}else {
33073314
MTM_LOG2("Apply transaction %s from node %d lsn %lx, flags=%x, origin node %d, original lsn=%lx, current lsn=%lx",

‎multimaster.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ extern void MtmUnlock(void);
358358
externvoidMtmLockNode(intnodeId,LWLockModemode);
359359
externvoidMtmUnlockNode(intnodeId);
360360
externvoidMtmDropNode(intnodeId,booldropSlot);
361+
externvoidMtmReconnectNode(intnodeId);
361362
externvoidMtmRecoverNode(intnodeId);
362363
externvoidMtmOnNodeDisconnect(intnodeId);
363364
externvoidMtmOnNodeConnect(intnodeId);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp