Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+8-7
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

+1
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)