File tree 3 files changed +27
-3
lines changed
3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -146,9 +146,18 @@ MtmBeginTransaction()
146
146
/* Reject all user's transactions at offline cluster.
147
147
* Allow execution of transaction by bg-workers to makeit possible to perform recovery.
148
148
*/
149
- mtm_log (ERROR ,
150
- "Multimaster node is not online: current status %s" ,
151
- MtmNodeStatusMnem [Mtm -> status ]);
149
+ if (!MtmBreakConnection )
150
+ {
151
+ mtm_log (ERROR ,
152
+ "Multimaster node is not online: current status %s" ,
153
+ MtmNodeStatusMnem [Mtm -> status ]);
154
+ }
155
+ else
156
+ {
157
+ mtm_log (FATAL ,
158
+ "Multimaster node is not online: current status %s" ,
159
+ MtmNodeStatusMnem [Mtm -> status ]);
160
+ }
152
161
}
153
162
}
154
163
Original file line number Diff line number Diff line change @@ -250,6 +250,7 @@ extern int MtmHeartbeatRecvTimeout;
250
250
extern char * MtmRefereeConnStr ;
251
251
extern int MtmMaxWorkers ;
252
252
extern int MtmMaxNodes ;
253
+ extern bool MtmBreakConnection ;
253
254
254
255
/* XXX! need rename: that's actually a disconnectivity mask */
255
256
#define SELF_CONNECTIVITY_MASK (Mtm->selfConnectivityMask)
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ int MtmTransSpillThreshold; // XXX: align with receiver buffer size
135
135
int MtmHeartbeatSendTimeout ;
136
136
int MtmHeartbeatRecvTimeout ;
137
137
char * MtmRefereeConnStr ;
138
+ bool MtmBreakConnection ;
138
139
139
140
static int MtmQueueSize ;
140
141
@@ -551,6 +552,19 @@ _PG_init(void)
551
552
NULL /* GucShowHook show_hook */
552
553
);
553
554
555
+ DefineCustomBoolVariable (
556
+ "multimaster.break_connection" ,
557
+ "Break connection with client when node is no online" ,
558
+ NULL ,
559
+ & MtmBreakConnection ,
560
+ false,
561
+ PGC_BACKEND ,
562
+ 0 ,
563
+ NULL ,
564
+ NULL ,
565
+ NULL
566
+ );
567
+
554
568
MtmDeadlockDetectorInit (MtmMaxNodes );
555
569
556
570
/*
You can’t perform that action at this time.
0 commit comments