Re: Problem while setting the fpw with SIGHUP - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Problem while setting the fpw with SIGHUP
Date
Msg-id 20180411202414.GA32449@paquier.xyz
Whole thread Raw
In response to Re: Problem while setting the fpw with SIGHUP  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Problem while setting the fpw with SIGHUP
List pgsql-hackers
On Wed, Apr 11, 2018 at 02:09:48PM +0300, Heikki Linnakangas wrote:
> I think the new behavior where the GUC only takes effect at next checkpoint
> is OK. It seems quite intuitive.
>
> > [rebased patch version]
>
> Looks good at a quick glance. Assuming no objections from others, I'll take
> a closer look and commit tomorrow. Thanks!

Sorry for not following up closely this thread lately.

+   /*
+    * If full_page_writes has been turned off, issue XLOG_FPW_CHANGE before
+    * the flag actually takes effect. No lock is required since checkpointer
+    * is the only updator of shared fullPageWrites after recovery is
+    * finished. Both shared and local fullPageWrites do not change before the
+    * next reading below.
+    */
+   if (Insert->fullPageWrites && !fullPageWrites)
+   {
+       XLogBeginInsert();
+       XLogRegisterData((char *) (&fullPageWrites), sizeof(bool));
+       XLogInsert(RM_XLOG_ID, XLOG_FPW_CHANGE);
+   }

This is not actually true.  If a fallback_promote is used, then
CreateCheckPoint() is called by the startup process which is in charge
of issuing the end-of-recovery checkpoint, and not the checkpointer.  So
I still fail to see how a no-lock approach is fine except if we remove
fallback_promote?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Gotchas about pg_verify_checksums
Next
From: Tom Lane
Date:
Subject: Re: Bugs in TOAST handling, OID assignment and redo recovery