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

Commit 9657046

Browse files
knizhnikkelvich
authored andcommitted
Do not update restartLSN for prepare transaction records
1 parent 4ea829d commit 9657046

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

multimaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3723,7 +3723,6 @@ bool MtmFilterTransaction(char* record, int size)
37233723
switch (event)
37243724
{
37253725
case PGLOGICAL_PREPARE:
3726-
// return false;
37273726
case PGLOGICAL_PRECOMMIT_PREPARED:
37283727
case PGLOGICAL_ABORT_PREPARED:
37293728
gid = pq_getmsgstring(&s);
@@ -3738,7 +3737,10 @@ bool MtmFilterTransaction(char* record, int size)
37383737
restart_lsn = origin_node == MtmReplicationNodeId ? end_lsn : origin_lsn;
37393738
if (Mtm->nodes[origin_node-1].restartLSN < restart_lsn) {
37403739
MTM_LOG2("[restartlsn] node %d: %llx -> %llx (MtmFilterTransaction)", MtmReplicationNodeId, Mtm->nodes[MtmReplicationNodeId-1].restartLSN, restart_lsn);
3741-
Mtm->nodes[origin_node-1].restartLSN = restart_lsn;
3740+
if (event != PGLOGICAL_PREPARE) {
3741+
/* Transactions can be prepared in different order, so to avoid loosing transactions we should not update restartLsn for them */
3742+
Mtm->nodes[origin_node-1].restartLSN = restart_lsn;
3743+
}
37423744
} else {
37433745
duplicate = true;
37443746
}

0 commit comments

Comments
 (0)