!4856 【插件】autovacuum worker线程需要加载插件-加载插件位置修改

Merge pull request !4856 from pengjiong/fix_case
This commit is contained in:
opengauss_bot
2024-02-18 01:24:47 +00:00
committed by Gitee
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)) {