From aa98836587f870a46c3d2cde848a0b814adfd9e3 Mon Sep 17 00:00:00 2001 From: chenxiaobin19 <1025221611@qq.com> Date: Mon, 29 Jul 2024 11:40:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DB=E5=BA=93=E5=B9=B6=E8=A1=8C?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=A7=A3=E7=A0=81=E7=9A=84core=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/utils/init/postinit.cpp | 2 ++ src/gausskernel/process/tcop/postgres.cpp | 5 +++++ .../storage/replication/logical/parallel_decode_worker.cpp | 4 ++++ 3 files changed, 11 insertions(+) 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 1a8ea3221..feef906f2 100755 --- a/src/gausskernel/process/tcop/postgres.cpp +++ b/src/gausskernel/process/tcop/postgres.cpp @@ -7703,6 +7703,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));