修复无法重启数据库的bug

This commit is contained in:
luozihao 2022-03-14 11:56:24 +08:00 committed by lzh
parent 674c48d084
commit 238df3258d
1 changed files with 6 additions and 4 deletions

View File

@ -1329,7 +1329,7 @@ static bool apply_batch_flush_pages(PageWriterProc* pgwr)
static void ckpt_pagewriter_sub_thread_loop()
{
uint32 rc;
uint32 rc = 0;
uint64 now;
uint32 total_flush_pages;
uint32 old_running_num;
@ -1352,9 +1352,11 @@ static void ckpt_pagewriter_sub_thread_loop()
proc_exit(0);
}
/* Wait first */
rc = WaitLatch(&t_thrd.proc->procLatch, WL_TIMEOUT | WL_LATCH_SET | WL_POSTMASTER_DEATH,
(long)u_sess->attr.attr_storage.pageWriterSleep /* ms */);
if (!t_thrd.pagewriter_cxt.shutdown_requested) {
/* Wait first */
rc = WaitLatch(&t_thrd.proc->procLatch, WL_TIMEOUT | WL_LATCH_SET | WL_POSTMASTER_DEATH,
(long)u_sess->attr.attr_storage.pageWriterSleep /* ms */);
}
if (rc & WL_POSTMASTER_DEATH) {
gs_thread_exit(1);