Skip to content

Commit 2b327b6

Browse files
knizhnikkelvich
authored andcommitted
Push responses to WAL sender
1 parent e6d3936 commit 2b327b6

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

multimaster.c

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

2487-
/* Track commit lsn */
2488-
flushpos = (MtmFlushPosition *) palloc(sizeof(MtmFlushPosition));
2489-
flushpos->node_id = node_id;
2490-
flushpos->local_end = XactLastCommitEnd;
2491-
flushpos->remote_end = end_lsn;
2492-
dlist_push_tail(&MtmLsnMapping, &flushpos->node);
2493-
2487+
if (end_lsn != InvalidXLogRecPtr) {
2488+
/* Track commit lsn */
2489+
flushpos = (MtmFlushPosition *) palloc(sizeof(MtmFlushPosition));
2490+
flushpos->node_id = node_id;
2491+
flushpos->local_end = XactLastCommitEnd;
2492+
flushpos->remote_end = end_lsn;
2493+
dlist_push_tail(&MtmLsnMapping, &flushpos->node);
2494+
}
24942495
MtmLock(LW_EXCLUSIVE);
24952496
dlist_foreach_modify(iter, &MtmLsnMapping)
24962497
{

pglogical_receiver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ pglogical_receiver_main(Datum main_arg)
571571
if (r == 0)
572572
{
573573
int64 now = feGetCurrentTimestamp();
574+
MtmUpdateLsnMapping(nodeId, InvalidXLogRecPtr);
574575
sendFeedback(conn, now, nodeId);
575576
continue;
576577
}

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