From 9fc76afffe4a91cced32492f0144c583b7de26b6 Mon Sep 17 00:00:00 2001 From: April01xxx Date: Thu, 12 Nov 2020 11:02:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3pg=5Fos=5Fthreads?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E4=B8=ADIncrBgWriter=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/process/postmaster/bgwriter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gausskernel/process/postmaster/bgwriter.cpp b/src/gausskernel/process/postmaster/bgwriter.cpp index bb0bdd2a6b..820dd82d65 100755 --- a/src/gausskernel/process/postmaster/bgwriter.cpp +++ b/src/gausskernel/process/postmaster/bgwriter.cpp @@ -790,6 +790,8 @@ void incre_ckpt_background_writer_main(void) dirty_buf_list = g_instance.bgwriter_cxt.bgwriter_procs[thread_id].dirty_buf_list; + pgstat_report_appname("IncrBgWriter"); + /* Loop forever */ for (;;) { int rc; -- Gitee From 4f78e63d5ec0f4d80f510242fec473d42b26c895 Mon Sep 17 00:00:00 2001 From: April01xxx Date: Thu, 12 Nov 2020 11:27:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3pg=5Fos=5Fthreads?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E4=B8=ADIncrBgWriter=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E4=B8=BA=E7=A9=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/process/postmaster/bgwriter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gausskernel/process/postmaster/bgwriter.cpp b/src/gausskernel/process/postmaster/bgwriter.cpp index 820dd82d65..867d7306bc 100755 --- a/src/gausskernel/process/postmaster/bgwriter.cpp +++ b/src/gausskernel/process/postmaster/bgwriter.cpp @@ -791,6 +791,7 @@ void incre_ckpt_background_writer_main(void) dirty_buf_list = g_instance.bgwriter_cxt.bgwriter_procs[thread_id].dirty_buf_list; pgstat_report_appname("IncrBgWriter"); + pgstat_report_activity(STATE_IDLE, NULL); /* Loop forever */ for (;;) { @@ -825,6 +826,7 @@ void incre_ckpt_background_writer_main(void) } } + pgstat_report_activity(STATE_IDLE, NULL); rc = WaitLatch(&t_thrd.proc->procLatch, WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH, get_bgwriter_sleep_time()); if (rc & WL_POSTMASTER_DEATH) { @@ -834,6 +836,7 @@ void incre_ckpt_background_writer_main(void) /* Clear any already-pending wakeups */ ResetLatch(&t_thrd.proc->procLatch); + pgstat_report_activity(STATE_RUNNING, NULL); /* * When the primary instance do full checkpoint, the first thread remain scan the * buffer pool to maintain the candidate buffer list, other threads scan the dirty -- Gitee