From 15c3b057372df1dae6013b6f3bba17cb9d24f172 Mon Sep 17 00:00:00 2001 From: zhang_xubo <2578876417@qq.com> Date: Wed, 30 Dec 2020 17:04:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E5=90=88=EF=BC=9A?= =?UTF-8?q?=E8=A7=A3=E5=86=B3pg=5Fos=5Fthreads=E8=A7=86=E5=9B=BE=E4=B8=ADI?= =?UTF-8?q?ncrBgWriter=E7=BA=BF=E7=A8=8B=E4=BF=A1=E6=81=AF=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98https://gitee.com/opengauss?= =?UTF-8?q?/openGauss-server/pulls/401?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/process/postmaster/bgwriter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gausskernel/process/postmaster/bgwriter.cpp b/src/gausskernel/process/postmaster/bgwriter.cpp index 2b37b7f1f..bc58ec2cf 100755 --- a/src/gausskernel/process/postmaster/bgwriter.cpp +++ b/src/gausskernel/process/postmaster/bgwriter.cpp @@ -824,6 +824,8 @@ void incre_ckpt_background_writer_main(void) pg_time_t now = (pg_time_t) time(NULL); t_thrd.bgwriter_cxt.next_flush_time = now + u_sess->attr.attr_storage.BgWriterDelay; + pgstat_report_appname("IncrBgWriter"); + pgstat_report_activity(STATE_IDLE, NULL); /* Loop forever */ for (;;) { int rc; @@ -857,7 +859,7 @@ void incre_ckpt_background_writer_main(void) proc_exit(0); } } - + pgstat_report_activity(STATE_IDLE, NULL); sleep_time = get_bgwriter_sleep_time(); rc = WaitLatch(&t_thrd.proc->procLatch, WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH, sleep_time); if (rc & WL_POSTMASTER_DEATH) { @@ -866,6 +868,8 @@ void incre_ckpt_background_writer_main(void) /* Clear any already-pending wakeups */ ResetLatch(&t_thrd.proc->procLatch); + + pgstat_report_activity(STATE_RUNNING, NULL); now = (pg_time_t) time(NULL); t_thrd.bgwriter_cxt.next_flush_time = now + u_sess->attr.attr_storage.BgWriterDelay;