Skip to content

Commit aface56

Browse files
knizhnikkelvich
authored andcommitted
Undo changes around MtmRecoveryCaughtUp
1 parent 50a052c commit aface56

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

multimaster.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,6 @@ bool MtmRecoveryCaughtUp(int nodeId, XLogRecPtr slotLSN)
996996
if (MtmIsRecoveredNode(nodeId)) {
997997
XLogRecPtr walLSN = GetXLogInsertRecPtr();
998998
MtmLock(LW_EXCLUSIVE);
999-
#if 0
1000999
if (slotLSN == walLSN) {
10011000
if (BIT_CHECK(Mtm->nodeLockerMask, nodeId-1)) {
10021001
elog(WARNING,"Node %d is caught-up", nodeId);
@@ -1010,9 +1009,7 @@ bool MtmRecoveryCaughtUp(int nodeId, XLogRecPtr slotLSN)
10101009
BIT_CLEAR(Mtm->disabledNodeMask, nodeId-1);
10111010
Mtm->nNodes += 1;
10121011
caughtUp = true;
1013-
} else
1014-
#endif
1015-
if (!BIT_CHECK(Mtm->nodeLockerMask, nodeId-1)
1012+
} else if (!BIT_CHECK(Mtm->nodeLockerMask, nodeId-1)
10161013
&& slotLSN + MtmMinRecoveryLag > walLSN)
10171014
{
10181015
/*

pglogical_apply.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,12 @@ process_remote_commit(StringInfo in)
497497
uint8 flags;
498498
csn_t csn;
499499
const char *gid = NULL;
500-
bool caughtUp = false;
500+
bool caughtUp;
501501

502502
/* read flags */
503503
flags = pq_getmsgbyte(in);
504504
MtmReplicationNode = pq_getmsgbyte(in);
505-
/*caughtUp = pq_getmsgbyte(in) != 0;*/
505+
caughtUp = pq_getmsgbyte(in) != 0;
506506

507507
/* read fields */
508508
replorigin_session_origin_lsn = pq_getmsgint64(in); /* commit_lsn */

pglogical_proto.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,14 @@ pglogical_write_commit(StringInfo out, PGLogicalOutputData *data,
147147
return;
148148
}
149149
}
150-
MtmRecoveryCaughtUp(MtmReplicationNodeId, txn->end_lsn);
151-
152150
pq_sendbyte(out, 'C'); /* sending COMMIT */
153151

154152
MTM_INFO("PGLOGICAL_SEND commit: event=%d, gid=%s, commit_lsn=%lx, txn->end_lsn=%lx, xlog=%lx\n", flags, txn->gid, commit_lsn, txn->end_lsn, GetXLogInsertRecPtr());
155153

156154
/* send the flags field */
157155
pq_sendbyte(out, flags);
158156
pq_sendbyte(out, MtmNodeId);
159-
/*pq_sendbyte(out, MtmRecoveryCaughtUp(MtmReplicationNodeId, txn->end_lsn));*/
157+
pq_sendbyte(out, MtmRecoveryCaughtUp(MtmReplicationNodeId, txn->end_lsn));
160158

161159
/* send fixed fields */
162160
pq_sendint64(out, commit_lsn);

0 commit comments

Comments
 (0)