@@ -664,6 +664,15 @@ MtmResetTransaction(MtmCurrentTrans* x)
664664 x -> status = TRANSACTION_STATUS_UNKNOWN ;
665665}
666666
667+
668+ static const char * const isoLevelStr [] =
669+ {
670+ "read uncommitted" ,
671+ "read committed" ,
672+ "repeatable read" ,
673+ "serializable"
674+ };
675+
667676static void
668677MtmBeginTransaction (MtmCurrentTrans * x )
669678{
@@ -680,13 +689,16 @@ MtmBeginTransaction(MtmCurrentTrans* x)
680689 x -> isPrepared = false;
681690 x -> isTransactionBlock = IsTransactionBlock ();
682691 /* Application name can be changed usnig PGAPPNAME environment variable */
683- if (! IsBackgroundWorker && x -> isDistributed && Mtm -> status != MTM_ONLINE && strcmp (application_name , MULTIMASTER_ADMIN ) != 0 ) {
692+ if (x -> isDistributed && Mtm -> status != MTM_ONLINE && strcmp (application_name , MULTIMASTER_ADMIN ) != 0 ) {
684693 /* Reject all user's transactions at offline cluster.
685694 * Allow execution of transaction by bg-workers to make it possible to perform recovery.
686695 */
687696 MtmUnlock ();
688697 elog (ERROR , "Multimaster node is not online: current status %s" , MtmNodeStatusMnem [Mtm -> status ]);
689698 }
699+ if (x -> isDistributed && XactIsoLevel != XACT_REPEATABLE_READ ) {
700+ elog (LOG , "Isolation level %s is not supported by multimaster" , isoLevelStr [XactIsoLevel ]);
701+ }
690702 x -> containsDML = false;
691703 x -> snapshot = MtmAssignCSN ();
692704 x -> gtid .xid = InvalidTransactionId ;
@@ -2164,6 +2176,13 @@ _PG_init(void)
21642176 NULL
21652177 );
21662178
2179+ if (DefaultXactIsoLevel != XACT_REPEATABLE_READ ) {
2180+ elog (ERROR , "Multimaster requires repeatable read default isolation level" );
2181+ }
2182+ if (synchronous_commit != SYNCHRONOUS_COMMIT_ON ) {
2183+ elog (ERROR , "Multimaster requires synchronous commit on" );
2184+ }
2185+
21672186 MtmSplitConnStrs ();
21682187 MtmStartReceivers ();
21692188
0 commit comments