diff --git a/src/gausskernel/process/postmaster/autovacuum.cpp b/src/gausskernel/process/postmaster/autovacuum.cpp index c0e79b263..c72cf3c24 100755 --- a/src/gausskernel/process/postmaster/autovacuum.cpp +++ b/src/gausskernel/process/postmaster/autovacuum.cpp @@ -1363,10 +1363,6 @@ NON_EXEC_STATIC void AutoVacWorkerMain() pgstat_report_appname("AutoVacWorker"); pgstat_report_activity(STATE_IDLE, NULL); -#if (!defined(ENABLE_MULTIPLE_NODES)) && (!defined(ENABLE_PRIVATEGAUSS)) - LoadSqlPlugin(); -#endif - set_ps_display(dbname, false); ereport(GetVacuumLogLevel(), (errmsg("start autovacuum on database \"%s\"", dbname))); @@ -1391,6 +1387,9 @@ NON_EXEC_STATIC void AutoVacWorkerMain() */ t_thrd.utils_cxt.CurrentResourceOwner = ResourceOwnerCreate(NULL, "AutoVacuumWorker", THREAD_GET_MEM_CXT_GROUP(MEMORY_CONTEXT_STORAGE)); +#if (!defined(ENABLE_MULTIPLE_NODES)) && (!defined(ENABLE_PRIVATEGAUSS)) + LoadSqlPlugin(); +#endif oldcontext = MemoryContextSwitchTo(SESS_GET_MEM_CXT_GROUP(MEMORY_CONTEXT_STORAGE)); if (u_sess->proc_cxt.MyProcPort->database_name) diff --git a/src/gausskernel/process/tcop/postgres.cpp b/src/gausskernel/process/tcop/postgres.cpp index de887cdf5..55adb4834 100755 --- a/src/gausskernel/process/tcop/postgres.cpp +++ b/src/gausskernel/process/tcop/postgres.cpp @@ -7686,7 +7686,12 @@ void RemoveTempNamespace() #if (!defined(ENABLE_MULTIPLE_NODES)) && (!defined(ENABLE_PRIVATEGAUSS)) #define INITIAL_USER_ID 10 -/* IMPORTANT: load plugin should call after process is normal, cause heap_create_with_catalog will check it */ +/* + * IMPORTANT: + * 1. load plugin should call after process is normal, cause heap_create_with_catalog will check it. + * 2. load plugin should call after mask_password_mem_cxt is created, cause maskPassword is called + * when create extension, which need mask_password_mem_cxt. + */ void LoadSqlPlugin() { if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(B_FORMAT) && IsFileExisted(DOLPHIN)) {