提交 b6fe2e62 编写于 作者: P Pengzhou Tang 提交者: Wang Hao

Reduce the high cpu usage of postmaster when DTX is recovering

bgworker_should_start_mpp() is mainly used to check whether the DTX
recovery process has recovered the distributed transactions and set
the shmDtmStarted to true. We used to let postmaster keep trying if
a DTX recovery process didn't finish and it kept postmaster in a
very high CPU usage which is not cool. Because DTX recovery process
is also a bgworker and a bgworker quiting will also force a call to
maybe_start_bgworker(), it's unnecessary to set StartWorkerNeeded to
tell postmaster keep trying.
上级 bfe8325d
......@@ -6379,11 +6379,7 @@ maybe_start_bgworker(void)
if (bgworker_should_start_now(rw->rw_worker.bgw_start_time))
{
if (!bgworker_should_start_mpp(&rw->rw_worker))
{
/* tell ServerLoop to try again */
StartWorkerNeeded = true;
continue;
}
/* reset crash time before trying to start worker */
rw->rw_crashed_at = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册