!1322 解决bgwriter线程退出时,查询local_bgwriter_stat()导致数据库宕机的问题

Merge pull request !1322 from 陈栋/bugfix1
This commit is contained in:
opengauss-bot
2021-10-27 02:51:06 +00:00
committed by Gitee

View File

@ -1258,7 +1258,7 @@ uint32 get_curr_candidate_nums(bool segment)
{
uint32 currCandidates = 0;
if (segment) {
if (segment && SEGMENT_BGWRITER_ID >= 0) {
BgWriterProc *curr_writer = &g_instance.bgwriter_cxt.bgwriter_procs[SEGMENT_BGWRITER_ID];
if (curr_writer->proc != NULL) {
currCandidates = get_thread_candidate_nums(SEGMENT_BGWRITER_ID);