diff --git a/src/common/backend/utils/init/postinit.cpp b/src/common/backend/utils/init/postinit.cpp index fa9642a3a..ee1cc6921 100644 --- a/src/common/backend/utils/init/postinit.cpp +++ b/src/common/backend/utils/init/postinit.cpp @@ -1465,6 +1465,8 @@ void PostgresInitializer::InitParallelDecode() InitSettings(); + InitExtensionVariable(); + FinishInit(); } diff --git a/src/gausskernel/process/tcop/postgres.cpp b/src/gausskernel/process/tcop/postgres.cpp index 1094608a5..8957787cc 100755 --- a/src/gausskernel/process/tcop/postgres.cpp +++ b/src/gausskernel/process/tcop/postgres.cpp @@ -7710,6 +7710,11 @@ void LoadSqlPlugin() ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("Please use the original role to connect B-compatibility database first, to load extension dolphin"))); } + + /* Creating extension dolphin must init mask_password_mem_cxt before */ + Assert(t_thrd.mem_cxt.mask_password_mem_cxt != NULL); + Assert(IsNormalProcessingMode()); + /* recheck and load dolphin within lock */ t_thrd.utils_cxt.holdLoadPluginLock[DB_CMPT_B] = true; pthread_mutex_lock(&g_instance.loadPluginLock[DB_CMPT_B]); diff --git a/src/gausskernel/storage/replication/logical/parallel_decode_worker.cpp b/src/gausskernel/storage/replication/logical/parallel_decode_worker.cpp index 301f9e908..075203fa9 100644 --- a/src/gausskernel/storage/replication/logical/parallel_decode_worker.cpp +++ b/src/gausskernel/storage/replication/logical/parallel_decode_worker.cpp @@ -1107,6 +1107,10 @@ void ParallelDecodeWorkerMain(void* point) pgstat_report_appname("LogicalDecodeWorker"); pgstat_report_activity(STATE_IDLE, NULL); +#if (!defined(ENABLE_MULTIPLE_NODES)) && (!defined(ENABLE_PRIVATEGAUSS)) + LoadSqlPlugin(); +#endif + t_thrd.utils_cxt.CurrentResourceOwner = ResourceOwnerCreate(NULL, "parallel decoder resource owner", THREAD_GET_MEM_CXT_GROUP(MEMORY_CONTEXT_STORAGE));