Re: Is this a problem in GenericXLogFinish()?

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, Alexander Lakhin <exclusion@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Jeff Davis <pgsql@j-davis.com>, Heikki Linnakangas <hlinnaka@iki.fi>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-02-07T08:38:42Z
Lists: pgsql-hackers
On Mon, Feb 5, 2024 at 1:33 PM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Mon, Feb 05, 2024 at 07:57:09AM +0000, Hayato Kuroda (Fujitsu) wrote:
> > You are right. Based on the previous discussions, PageSetLSN() must be called
> > after the MakeBufferDirty(). REGBUF_NO_CHANGE has been introduced for skipping
> > these requirements. Definitevely, no_change buffers must not be PageSetLSN()'d.
> > Other pages, e.g., metabuf, has already been followed the rule.
>
> At quick glance, this v2 seems kind of right to me: you are setting
> the page LSN only when the page is registered in the record and
> actually dirtied.
>

Thanks for the report and looking into it. Pushed!

-- 
With Regards,
Amit Kapila.



Commits

  1. Fix inconsistency with replay of hash squeeze record for clean buffers

  2. Set LSN for wbuf in _hash_freeovflpage() iff wbuf is modified.

  3. Fix an uninitialized access in hash_xlog_squeeze_page().

  4. Use REGBUF_NO_CHANGE at one more place in the hash index.

  5. Assert that buffers are marked dirty before XLogRegisterBuffer().

  6. Fix bug in GenericXLogFinish().

  7. Improve hash index bucket split behavior.