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

From Amit Kapila
Subject Re: Problem while setting the fpw with SIGHUP
Date
Msg-id CAA4eK1KW8qHoQy6nYVqbX9N_kr8YxgD8cPP2ikM3ScCSduArXg@mail.gmail.com
Whole thread Raw
In response to Re: Problem while setting the fpw with SIGHUP  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: Problem while setting the fpw with SIGHUP  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Tue, Aug 28, 2018 at 4:05 PM Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:
>
> Hello.
>
> At Sat, 25 Aug 2018 14:50:53 +0530, Amit Kapila <amit.kapila16@gmail.com> wrote in
<CAA4eK1K7dVgKU4zrNTSCW=EoqALG38XmNT0HK9Wdkr935iwTQg@mail.gmail.com>
> > On Wed, Aug 1, 2018 at 12:56 PM Kyotaro HORIGUCHI
> > <horiguchi.kyotaro@lab.ntt.co.jp> wrote:
> > >
> > > Thank you, Amit, Michael.
> > >
> >
> > Can you verify the first patch that I have posted above [1]?  We can
> > commit it separately.
>
> Thanks for prompting. The difference is in a comment and I'm fine
> with the change.
>

Thanks, but what I wanted you to verify is the commit that broke it in
9.5.  On again looking at it, I think it is below code in commit
2076db2aea that caused this problem.  If possible, can you once test
it before and at this commit or at least do the manual review of same
to cross-verify?

+       doPageWrites = (Insert->fullPageWrites || Insert->forcePageWrites);
-       /*
-        * Also check to see if fullPageWrites or forcePageWrites was
just turned
-        * on; if we weren't already doing full-page writes then go back and
-        * recompute. (If it was just turned off, we could recompute the record
-        * without full pages, but we choose not to bother.)
-        */
-       if ((Insert->fullPageWrites || Insert->forcePageWrites) &&
!doPageWrites)
+       if (fpw_lsn != InvalidXLogRecPtr && fpw_lsn <= RedoRecPtr &&
doPageWrites)
        {
-               /* Oops, must redo it with full-page data. */
+               /*
+                * Oops, some buffer now needs to be backed up that the caller
+                * didn't back up.  Start over.
+                */
                WALInsertLockRelease();
                END_CRIT_SECTION();
-               rdt_lastnormal->next = NULL;
-               info = info_orig;
-               goto begin;
+               return InvalidXLogRecPtr;
        }


-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Add extension options to control TAP and isolation tests
Next
From: Michael Paquier
Date:
Subject: Re: How to find local logical replication origin?