forked from openGauss-Ecosystem/openGauss-server
!2861 修复部分内部线程通过pg_stat相关函数查询不到appname和create time的问题
Merge pull request !2861 from pengjiong/fix_col
This commit is contained in:
commit
39a27de267
|
@ -1313,6 +1313,7 @@ NON_EXEC_STATIC void WLMmonitorMain(void)
|
|||
|
||||
// initialize thread
|
||||
WLMmonitor_init();
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
// main loop of the thread
|
||||
WLMmonitor_MainLoop();
|
||||
|
@ -1640,6 +1641,7 @@ NON_EXEC_STATIC void WLMarbiterMain(void)
|
|||
ereport(LOG, (errmsg("WLMarbiter thread is starting up.")));
|
||||
|
||||
// main loop of the thread
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
WLMarbiter_MainLoop();
|
||||
|
||||
/* If transaction has started, we must commit it here. */
|
||||
|
|
|
@ -1352,6 +1352,9 @@ NON_EXEC_STATIC void AutoVacWorkerMain()
|
|||
dopControl.CloseSmp();
|
||||
#endif
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_appname("AutoVacWorker");
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
set_ps_display(dbname, false);
|
||||
ereport(GetVacuumLogLevel(), (errmsg("start autovacuum on database \"%s\"", dbname)));
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <stdint.h>
|
||||
#include "postgres.h"
|
||||
#include "miscadmin.h"
|
||||
#include "pgstat.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "knl/knl_variable.h"
|
||||
#include "storage/ipc.h"
|
||||
|
@ -485,6 +486,7 @@ NON_EXEC_STATIC void BarrierArchMain(knl_thread_arg* arg)
|
|||
(void)gs_signal_unblock_sigusr2();
|
||||
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
pg_usleep_retry(1000000L, 0);
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <stdint.h>
|
||||
#include "postgres.h"
|
||||
#include "miscadmin.h"
|
||||
#include "pgstat.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "knl/knl_variable.h"
|
||||
#include "storage/ipc.h"
|
||||
|
@ -367,6 +368,8 @@ void barrier_creator_main(void)
|
|||
t_thrd.log_cxt.PG_exception_stack = &local_sigjmp_buf;
|
||||
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
exec_init_poolhandles();
|
||||
|
||||
#ifdef ENABLE_MULTIPLE_NODES
|
||||
|
|
|
@ -319,6 +319,8 @@ NON_EXEC_STATIC void CfsShrinkerMain()
|
|||
t_thrd.proc_cxt.PostInit->InitCfsShrinker();
|
||||
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_appname("CfsShrinker");
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
/*
|
||||
* Create a memory context that we will do all our work in. We do this so
|
||||
|
|
|
@ -867,6 +867,8 @@ NON_EXEC_STATIC void RbCleanerMain()
|
|||
t_thrd.proc_cxt.PostInit->InitRbCleaner();
|
||||
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_appname("RbCleaner");
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
MemoryContext workMxt = AllocSetContextCreate(
|
||||
t_thrd.top_mem_cxt,
|
||||
|
@ -1108,6 +1110,8 @@ NON_EXEC_STATIC void RbWorkerMain()
|
|||
t_thrd.proc_cxt.PostInit->InitRbWorker();
|
||||
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_appname("RbWorker");
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
MemoryContext workMxt = AllocSetContextCreate(
|
||||
t_thrd.top_mem_cxt,
|
||||
|
|
|
@ -459,6 +459,8 @@ NON_EXEC_STATIC void TxnSnapWorkerMain()
|
|||
t_thrd.proc_cxt.PostInit->InitTxnSnapWorker();
|
||||
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_appname("TxnSnapWorker");
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
/*
|
||||
* Create a memory context that we will do all our work in. We do this so
|
||||
|
@ -797,6 +799,8 @@ NON_EXEC_STATIC void TxnSnapCapturerMain()
|
|||
t_thrd.proc_cxt.PostInit->InitTxnSnapCapturer();
|
||||
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_appname("TxnSnapCapturer");
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
/*
|
||||
* Create a memory context that we will do all our work in. We do this so
|
||||
|
|
|
@ -96,6 +96,7 @@ void TpoolListenerMain(ThreadPoolListener* listener)
|
|||
listener->CreateEpoll();
|
||||
listener->NotifyReady();
|
||||
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
TpoolListenerLoop(listener);
|
||||
proc_exit(0);
|
||||
}
|
||||
|
|
|
@ -86,6 +86,8 @@ void TpoolSchedulerMain(ThreadPoolScheduler *scheduler)
|
|||
ALLOCSET_DEFAULT_MAXSIZE);
|
||||
}
|
||||
|
||||
pgstat_report_appname("ThreadPoolScheduler");
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
while (true) {
|
||||
if (unlikely(scheduler->m_getKilled)) {
|
||||
scheduler->m_getKilled = false;
|
||||
|
|
|
@ -312,6 +312,8 @@ NON_EXEC_STATIC void UndoWorkerMain()
|
|||
databaseExists = t_thrd.proc_cxt.PostInit->InitUndoWorker();
|
||||
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_appname("UndoWorker");
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
if (databaseExists) {
|
||||
/* Perform the actual rollback */
|
||||
|
|
|
@ -702,6 +702,7 @@ void ApplyLauncherMain()
|
|||
t_thrd.proc_cxt.PostInit->InitApplyLauncher();
|
||||
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
/*
|
||||
* If an exception is encountered, processing resumes here.
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "access/xact.h"
|
||||
|
||||
#include "miscadmin.h"
|
||||
#include "pgstat.h"
|
||||
|
||||
#include "replication/logical.h"
|
||||
#include "replication/reorderbuffer.h"
|
||||
|
@ -67,7 +68,6 @@
|
|||
#include "catalog/pg_namespace.h"
|
||||
#include "lib/binaryheap.h"
|
||||
|
||||
|
||||
static const uint32 OUTPUT_WAIT_COUNT = 0xF;
|
||||
static const uint32 PRINT_ALL_WAIT_COUNT = 0x7FF;
|
||||
|
||||
|
@ -1104,6 +1104,8 @@ void ParallelDecodeWorkerMain(void* point)
|
|||
InvalidOid, worker->dbUser);
|
||||
t_thrd.proc_cxt.PostInit->InitParallelDecode();
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_appname("LogicalDecodeWorker");
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
t_thrd.utils_cxt.CurrentResourceOwner = ResourceOwnerCreate(NULL, "parallel decoder resource owner",
|
||||
THREAD_GET_MEM_CXT_GROUP(MEMORY_CONTEXT_STORAGE));
|
||||
|
@ -1221,6 +1223,8 @@ void LogicalReadWorkerMain(void* point)
|
|||
InvalidOid, reader->dbUser);
|
||||
t_thrd.proc_cxt.PostInit->InitParallelDecode();
|
||||
SetProcessingMode(NormalProcessing);
|
||||
pgstat_report_appname("LogicalReadWorker");
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
t_thrd.utils_cxt.CurrentResourceOwner = ResourceOwnerCreate(NULL, "logical reader resource owner",
|
||||
THREAD_GET_MEM_CXT_GROUP(MEMORY_CONTEXT_STORAGE));
|
||||
|
||||
|
|
|
@ -1508,6 +1508,8 @@ void ApplyWorkerMain()
|
|||
t_thrd.proc_cxt.PostInit->SetDatabaseAndUser(NULL, t_thrd.applyworker_cxt.curWorker->dbid, NULL,
|
||||
t_thrd.applyworker_cxt.curWorker->userid);
|
||||
t_thrd.proc_cxt.PostInit->InitApplyWorker();
|
||||
pgstat_report_appname("ApplyWorker");
|
||||
pgstat_report_activity(STATE_IDLE, NULL);
|
||||
|
||||
/* Load the subscription into persistent memory context. */
|
||||
t_thrd.applyworker_cxt.applyContext =
|
||||
|
|
Loading…
Reference in New Issue