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

Commit fbb98ce

Browse files
committed
fix race between logging parralel-safe message and acquiring participantsMask during simultaneous commit
1 parent 2048834 commit fbb98ce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pglogical_proto.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,13 +813,15 @@ MtmReplicationStartupHook(struct PGLogicalStartupHookArgs* args)
813813
*/
814814
if (!hooks_data->is_recovery)
815815
{
816+
XLogRecPtr msg_xptr;
816817
char *dest_id = psprintf("%d", MtmReplicationNodeId);
817818

818819
LWLockAcquire(MtmCommitBarrier, LW_EXCLUSIVE);
819820
MtmStateProcessNeighborEvent(MtmReplicationNodeId, MTM_NEIGHBOR_WAL_SENDER_START_RECOVERED, false);
821+
msg_xptr = LogLogicalMessage("P", dest_id, strlen(dest_id) + 1, false);
820822
LWLockRelease(MtmCommitBarrier);
821823

822-
XLogFlush(LogLogicalMessage("P", dest_id, strlen(dest_id) + 1, false));
824+
XLogFlush(msg_xptr);
823825
}
824826
}
825827

0 commit comments

Comments
 (0)