File tree Expand file tree Collapse file tree 2 files changed +18
-11
lines changed
src/backend/replication/logical Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -3817,7 +3817,7 @@ void MtmSetupReplicationHooks(struct PGLogicalHooks* hooks)
3817
3817
*/
3818
3818
void MtmBeginSession (int nodeId )
3819
3819
{
3820
- MtmLockNode (nodeId , LW_EXCLUSIVE );
3820
+ // MtmLockNode(nodeId, LW_EXCLUSIVE);
3821
3821
Assert (replorigin_session_origin == InvalidRepOriginId );
3822
3822
replorigin_session_origin = Mtm -> nodes [nodeId - 1 ].originId ;
3823
3823
Assert (replorigin_session_origin != InvalidRepOriginId );
@@ -3837,9 +3837,9 @@ void MtmEndSession(int nodeId, bool unlock)
3837
3837
replorigin_session_origin_lsn = INVALID_LSN ;
3838
3838
replorigin_session_origin_timestamp = 0 ;
3839
3839
replorigin_session_reset ();
3840
- if (unlock ) {
3841
- MtmUnlockNode (nodeId );
3842
- }
3840
+ // if (unlock) {
3841
+ // MtmUnlockNode(nodeId);
3842
+ // }
3843
3843
MTM_LOG3 ("%d: End reset replorigin session: %d" , MyProcPid , replorigin_session_origin );
3844
3844
}
3845
3845
}
Original file line number Diff line number Diff line change @@ -1029,13 +1029,20 @@ replorigin_session_setup(RepOriginId node)
1029
1029
if (curstate -> roident != node )
1030
1030
continue ;
1031
1031
1032
- else if (curstate -> acquired_by != 0 )
1033
- {
1034
- ereport (ERROR ,
1035
- (errcode (ERRCODE_OBJECT_IN_USE ),
1036
- errmsg ("replication identifier %d is already active for PID %d" ,
1037
- curstate -> roident , curstate -> acquired_by )));
1038
- }
1032
+ /*
1033
+ * MTM-CRUTCH.
1034
+ *
1035
+ * Allow multiple backends to setup same replication session.
1036
+ *
1037
+ * else if (curstate->acquired_by != 0)
1038
+ * {
1039
+ * ereport(ERROR,
1040
+ * (errcode(ERRCODE_OBJECT_IN_USE),
1041
+ * errmsg("replication identifier %d is already active for PID %d",
1042
+ * curstate->roident, curstate->acquired_by)));
1043
+ * }
1044
+ *
1045
+ */
1039
1046
1040
1047
/* ok, found slot */
1041
1048
session_replication_state = curstate ;
You can’t perform that action at this time.
0 commit comments