Skip to content

Commit 757c245

Browse files
committed
2 parents 02f8431 + 0a45dd2 commit 757c245

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

contrib/mmts/multimaster.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,6 +2274,7 @@ static void MtmBroadcastUtilityStmt(char const* sql, bool ignoreError)
22742274
if (MtmGUCBufferAllocated && !MtmRunUtilityStmt(conns[i], MtmGUCBuffer->data, &utility_errmsg) && !ignoreError)
22752275
{
22762276
errorMsg = "Failed to set GUC variables at node %d";
2277+
elog(ERROR, utility_errmsg);
22772278
failedNode = i;
22782279
break;
22792280
}
@@ -2460,7 +2461,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24602461
case T_PrepareStmt:
24612462
case T_ExecuteStmt:
24622463
case T_DeallocateStmt:
2463-
case T_GrantStmt: /* XXX: we could replicate some of these these */;
2464+
//case T_GrantStmt: /* XXX: we could replicate some of these these */;
24642465
//case T_GrantRoleStmt:
24652466
//case T_AlterDatabaseStmt:
24662467
//case T_AlterDatabaseSetStmt:
@@ -2471,7 +2472,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24712472
case T_ClusterStmt: /* XXX: we could replicate these */;
24722473
case T_VacuumStmt:
24732474
case T_ExplainStmt:
2474-
case T_AlterSystemStmt:
2475+
//case T_AlterSystemStmt:
24752476
case T_VariableShowStmt:
24762477
case T_DiscardStmt:
24772478
//case T_CreateEventTrigStmt:
@@ -2489,7 +2490,13 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24892490
break;
24902491
case T_VariableSetStmt:
24912492
{
2492-
//VariableSetStmt *stmt = (VariableSetStmt *) parsetree;
2493+
VariableSetStmt *stmt = (VariableSetStmt *) parsetree;
2494+
2495+
skipCommand = true;
2496+
2497+
/* Prevent SET TRANSACTION from replication */
2498+
if (MtmTx.isTransactionBlock || stmt->kind == VAR_SET_MULTI)
2499+
break;
24932500

24942501
if (!MtmGUCBufferAllocated)
24952502
{
@@ -2508,8 +2515,6 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
25082515
//appendStringInfoString(MtmGUCBuffer, "; ");
25092516

25102517
appendStringInfoString(MtmGUCBuffer, queryString);
2511-
2512-
skipCommand = true;
25132518
}
25142519
break;
25152520
case T_CreateStmt:
@@ -2536,7 +2541,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
25362541
{
25372542
rel = heap_open(relid, ShareLock);
25382543
skipCommand = rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP;
2539-
heap_close(rel, NoLock);
2544+
heap_close(rel, ShareLock);
25402545
}
25412546
}
25422547
break;

0 commit comments

Comments
 (0)