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;