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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy