回复:Fix missing initialization of delayChkptEnd

suyu.cmj <mengjuan.cmj@alibaba-inc.com>

From: 蔡梦娟(玊于) <mengjuan.cmj@alibaba-inc.com>
To: "pgsql-hackers" <pgsql-hackers@lists.postgresql.org>
Cc: "robertmhaas" <robertmhaas@gmail.com>
Date: 2023-06-05T16:39:47Z
Lists: pgsql-hackers

Attachments

Hi, all. I updated the patch for this bugfix, the previous one missed the modification of function InitAuxiliaryProcess, please check the new patch.
Thanks & Best Regard
------------------------------------------------------------------
发件人:蔡梦娟(玊于) <mengjuan.cmj@alibaba-inc.com>
发送时间:2023年6月5日(星期一) 19:44
收件人:pgsql-hackers <pgsql-hackers@lists.postgresql.org>
抄 送:robertmhaas <robertmhaas@gmail.com>
主 题:Fix missing initialization of delayChkptEnd
Hi, all
I got a coredump when testing with the REL_14_STABLE branch, which is as below:
I noticed that in commit 10520f4346876aad4941797c2255a21bdac74739, int delayChkpt has been changed back to bool delayChkpt + bool delayChkptEnd. However, the initialization to delayChkptEnd is missed in function InitProcess. When autovacuum_proc1 is in RelationTruncate, the delayChkptEnd will be set as true. If autovacuum_proc1 receives a cancel signal and handles it at this time, autovacuum_proc1 will exit without reseting delayChkptEnd in its error handling process. After that, if autovacuum_proc2 reuses this PGPROC structure, the above error will occur.
I add a patch to fix this bug in the attachment, hope you can check it.
Thanks & Best Regard

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix missing initializations of MyProc.delayChkptEnd

  2. Rethink the delay-checkpoint-end mechanism in the back-branches.