Fixing failures

reuse-connections-for-logical-ref-fkeys-niupre
Nitish Upreti 2022-09-15 17:27:23 -07:00
parent dce396fc3d
commit 2fec99d7b0
2 changed files with 16 additions and 9 deletions

View File

@ -1211,8 +1211,10 @@ CreateUncheckedForeignKeyConstraints(List *logicalRepTargetList)
list_make1("SET LOCAL citus.skip_constraint_validation TO ON;"),
commandList);
SendCommandListToWorkerOutsideTransactionWithConnection(
target->superuserConnection,
SendCommandListToWorkerOutsideTransaction(
target->superuserConnection->hostname,
target->superuserConnection->port,
target->superuserConnection->user,
commandList);
MemoryContextReset(localContext);
@ -1591,8 +1593,8 @@ DropUser(MultiConnection *connection, char *username)
* The DROP USER command should not propagate, so we temporarily disable
* DDL propagation.
*/
SendCommandListToWorkerOutsideTransactionWithConnection(
connection,
SendCommandListToWorkerOutsideTransaction(
connection->hostname, connection->port, connection->user,
list_make2(
"SET LOCAL citus.enable_ddl_propagation TO OFF;",
psprintf("DROP USER IF EXISTS %s",
@ -1777,8 +1779,10 @@ CreateSubscriptions(MultiConnection *sourceConnection,
* create a user with SUPERUSER permissions and then alter it to NOSUPERUSER.
* This prevents permission escalations.
*/
SendCommandListToWorkerOutsideTransactionWithConnection(
target->superuserConnection,
SendCommandListToWorkerOutsideTransaction(
target->superuserConnection->hostname,
target->superuserConnection->port,
target->superuserConnection->user,
list_make2(
"SET LOCAL citus.enable_ddl_propagation TO OFF;",
psprintf(
@ -1836,8 +1840,10 @@ CreateSubscriptions(MultiConnection *sourceConnection,
* The ALTER ROLE command should not propagate, so we temporarily
* disable DDL propagation.
*/
SendCommandListToWorkerOutsideTransactionWithConnection(
target->superuserConnection,
SendCommandListToWorkerOutsideTransaction(
target->superuserConnection->hostname,
target->superuserConnection->port,
target->superuserConnection->user,
list_make2(
"SET LOCAL citus.enable_ddl_propagation TO OFF;",
psprintf(

View File

@ -803,7 +803,8 @@ CoordinatedRemoteTransactionsPrepare(void)
iter.cur);
RemoteTransaction *transaction = &connection->remoteTransaction;
Assert(transaction->transactionState != REMOTE_TRANS_NOT_STARTED);
// This is not true as we call ResetConnection() on InProgressTransactions
// Assert(transaction->transactionState != REMOTE_TRANS_NOT_STARTED);
/* can't PREPARE a transaction that failed */
if (transaction->transactionFailed)