Re: Problem while setting the fpw with SIGHUP
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-03-26T09:02:22Z
Lists: pgsql-hackers
On Fri, Mar 23, 2018 at 1:19 PM, Michael Paquier <michael@paquier.xyz> wrote: > On Tue, Mar 20, 2018 at 12:00:47PM +0530, Dilip Kumar wrote: > > Yeah, you are right. Fixed. > > So I have been spending a couple of hours playing with your patch, and > tested various configurations manually, like switch the fpw switch to on > and off while running in parallel pgbench. I have also tested > promotions, etc. > > While the patch does its job, it is possible to simplify a bit more the > calls to InitXLogInsert(). Particularly, the one in CreateCheckpoint() > is basically useless for the checkpointer, still it is useful for the > startup process when trigerring an end-in-recovery checkpoint. So one > additional cleanup would be to move the call in CreateCheckpoint() to > bootstrap.c for the startup process. In StarupXLOG, just before the CreateCheckPoint() call, we are calling LocalSetXLogInsertAllowed(). So, I am thinking can we just remove InitXLogInsert from CreateCheckpoint. And, we don't need to move it to bootstrap.c. Or am I missing something? > In order to test that, please make > sure to create fallback_promote at the root of the data folder before > sending SIGUSR2 to the startup process which would trigger the pre-9.3 > promotion where the end-of-recovery checkpoint is triggered by the > startup process itself. > > + /* Initialize the working areas for constructing WAL records. */ > + InitXLogInsert(); > Instead of having the same comment for each process calling > InitXLogInsert() multiple times, I think that it would be better to > complete the comment in bootstrap.c where is written "XLOG operations". > > Here is a suggestion: > /* > * Initialize WAL-related operations and enter the main loop of each > * process. InitXLogInsert is called for each process which can > * generate WAL. While this is wasteful for processes started on > * a standby, this gives the guarantee that initialization of WAL > * insertion areas is able to happen in a consistent way and out of > * any critical sections so as the facility is usable when a promotion > * is triggered. > */ > > What do you think? > Looks good to me. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com
Commits
-
Fix assertion failure when updating full_page_writes for checkpointer.
- 85cc9c4e2da8 9.5.15 landed
- e315bd7db96a 9.6.11 landed
- 8256d7ae9ee3 10.6 landed
- 6c8671bc395c 11.0 landed
- a86bf6057edf 12.0 landed
-
Attach FPI to the first record after full_page_writes is turned on.
- 47a589c1fe35 9.5.15 landed
- fd4f2af774db 9.6.11 landed
- ede7d8192ca3 10.6 landed
- ff4220ead2c8 11.0 landed
- bc153c941d2e 12.0 landed
-
Revamp the WAL record format.
- 2c03216d8311 9.5.0 cited
-
Move the backup-block logic from XLogInsert to a new file, xloginsert.c.
- 2076db2aea76 9.5.0 cited