Skip to content

Commit 6ec617b

Browse files
committed
Push responses to WAL sender
1 parent 878d7de commit 6ec617b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

contrib/mmts/multimaster.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,13 +2475,14 @@ void MtmUpdateLsnMapping(int node_id, XLogRecPtr end_lsn)
24752475
XLogRecPtr local_flush = GetFlushRecPtr();
24762476
MemoryContext old_context = MemoryContextSwitchTo(TopMemoryContext);
24772477

2478-
/* Track commit lsn */
2479-
flushpos = (MtmFlushPosition *) palloc(sizeof(MtmFlushPosition));
2480-
flushpos->node_id = node_id;
2481-
flushpos->local_end = XactLastCommitEnd;
2482-
flushpos->remote_end = end_lsn;
2483-
dlist_push_tail(&MtmLsnMapping, &flushpos->node);
2484-
2478+
if (end_lsn != InvalidXLogRecPtr) {
2479+
/* Track commit lsn */
2480+
flushpos = (MtmFlushPosition *) palloc(sizeof(MtmFlushPosition));
2481+
flushpos->node_id = node_id;
2482+
flushpos->local_end = XactLastCommitEnd;
2483+
flushpos->remote_end = end_lsn;
2484+
dlist_push_tail(&MtmLsnMapping, &flushpos->node);
2485+
}
24852486
MtmLock(LW_EXCLUSIVE);
24862487
dlist_foreach_modify(iter, &MtmLsnMapping)
24872488
{

contrib/mmts/pglogical_receiver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ pglogical_receiver_main(Datum main_arg)
561561
if (r == 0)
562562
{
563563
int64 now = feGetCurrentTimestamp();
564+
MtmUpdateLsnMapping(nodeId, InvalidXLogRecPtr);
564565
sendFeedback(conn, now, nodeId);
565566
continue;
566567
}

0 commit comments

Comments
 (0)