You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to upgrade from Citus v10.x to newer major versions with a non-transactional metadata sync mode, an issue arises during the execution of the citus_finalize_upgrade_to_citus11() function by the following error message:
PL/pgSQL function citus_finish_citus_upgrade() line 25 at PERFORM
NOTICE: preparing all the existing partitioned table indexes
NOTICE: preparing to sync the metadata to all nodes
> Error: do not sync metadata in transaction block when the sync mode is nontransactional
HINT: resync after SET citus.metadata_sync_mode to 'transactional'
PL/pgSQL function citus_finalize_upgrade_to_citus11(boolean) line 174 at PERFORM
SQL statement "SELECT citus_finalize_upgrade_to_citus11()"
The problem specifically occurs when the transaction mode is set to non-transactional. It originates from the fact that metadata synchronization is called within a transaction block without considering the metadata sync mode. This behavior triggers the error message shown above. The relevant code section causing this issue can be found here:
if (context->transactionMode==METADATA_SYNC_NON_TRANSACTIONAL&&
IsMultiStatementTransaction())
{
/*
* prevent inside transaction block as we use bare connections which can
* lead deadlock
*/
ereport(ERROR, (errmsg("do not sync metadata in transaction block "
"when the sync mode is nontransactional"),
errhint("resync after SET citus.metadata_sync_mode "
"TO 'transactional'")));
}
I think we need to adjust the logic in citus_finalize_upgrade_to_citus11() to ensure that metadata synchronization is performed correctly based on the sync mode in use.
The text was updated successfully, but these errors were encountered:
When attempting to upgrade from Citus v10.x to newer major versions with a non-transactional metadata sync mode, an issue arises during the execution of the
citus_finalize_upgrade_to_citus11()
function by the following error message:The problem specifically occurs when the transaction mode is set to non-transactional. It originates from the fact that metadata synchronization is called within a transaction block without considering the metadata sync mode. This behavior triggers the error message shown above. The relevant code section causing this issue can be found here:
citus/src/backend/distributed/sql/udfs/citus_finalize_upgrade_to_citus11/latest.sql
Lines 209 to 216 in 27ac44e
The issue can be traced to the guard condition defined in the following code section:
citus/src/backend/distributed/metadata/node_metadata.c
Lines 1057 to 1072 in 27ac44e
I think we need to adjust the logic in
citus_finalize_upgrade_to_citus11()
to ensure that metadata synchronization is performed correctly based on the sync mode in use.The text was updated successfully, but these errors were encountered: