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

Commit 2dd95cb

Browse files
committed
extra check to skip replication after logical message was written to WAL
1 parent 96d2a24 commit 2dd95cb

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

contrib/mmts/multimaster.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,7 @@ bool MtmRefreshClusterStatus(bool nowait, int testNodeId)
16601660
/* Interrupt voting for active transaction and abort them */
16611661
for (ts = Mtm->transListHead; ts != NULL; ts = ts->next) {
16621662
MTM_LOG3("Active transaction gid='%s', coordinator=%d, xid=%d, status=%d, gtid.xid=%d",
1663-
ts->gid, ts->gtid.nхode, ts->xid, ts->status, ts->gtid.xid);
1663+
ts->gid, ts->gtid.node, ts->xid, ts->status, ts->gtid.xid);
16641664
if (MtmIsCoordinator(ts)) {
16651665
if (!ts->votingCompleted && disabled != 0 && ts->status != TRANSACTION_STATUS_ABORTED) {
16661666
MtmAbortTransaction(ts);
@@ -3826,6 +3826,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
38263826
{
38273827
MTM_LOG1("Xact accessed temp table, stopping replication");
38283828
MtmTx.isDistributed = false; /* Skip */
3829+
MtmTx.snapshot = INVALID_CSN;
38293830
}
38303831

38313832
}

contrib/mmts/pglogical_proto.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,14 @@ pglogical_write_begin(StringInfo out, PGLogicalOutputData *data,
112112

113113
if (!isRecovery && csn == INVALID_CSN) {
114114
MtmIsFilteredTxn = true;
115-
} else {
115+
MTM_LOG3("%d: pglogical_write_begin XID=%d filtered", MyProcPid, txn->xid);
116+
} else {
117+
MTM_LOG3("%d: pglogical_write_begin XID=%d sent", MyProcPid, txn->xid);
118+
MtmIsFilteredTxn = false;
116119
pq_sendbyte(out, 'B'); /* BEGIN */
117120
pq_sendint(out, MtmNodeId, 4);
118121
pq_sendint(out, isRecovery ? InvalidTransactionId : txn->xid, 4);
119122
pq_sendint64(out, csn);
120-
MtmIsFilteredTxn = false;
121123
MtmTransactionRecords = 0;
122124
}
123125
}
@@ -126,6 +128,12 @@ static void
126128
pglogical_write_message(StringInfo out,
127129
const char *prefix, Size sz, const char *message)
128130
{
131+
if (MtmIsFilteredTxn)
132+
{
133+
MTM_LOG3("%d: pglogical_write_message filtered", MyProcPid);
134+
return;
135+
}
136+
129137
pq_sendbyte(out, 'G');
130138
pq_sendbytes(out, message, sz);
131139
pq_sendbyte(out, '\0');

0 commit comments

Comments
 (0)