LoadSqlPlugin should be called after mask_password_mem_cxt is created.

This commit is contained in:
totaj
2024-02-17 11:05:21 +08:00
parent b8fc227823
commit c428477bf4
2 changed files with 9 additions and 5 deletions

View File

@ -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)

View File

@ -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)) {