Re: Is this a problem in GenericXLogFinish()?

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, Michael Paquier <michael@paquier.xyz>, Jeff Davis <pgsql@j-davis.com>, Alexander Lakhin <exclusion@gmail.com>, Heikki Linnakangas <hlinnaka@iki.fi>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2023-11-13T17:21:34Z
Lists: pgsql-hackers
On Mon, Nov 13, 2023 at 12:47 AM Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
> Moved.

I see that this patch was committed, but I'm not very convinced that
the approach is correct. The comment says this:

+           /*
+            * A write buffer needs to be registered even if no tuples are
+            * added to it to ensure that we can acquire a cleanup lock on it
+            * if it is the same as primary bucket buffer or update the
+            * nextblkno if it is same as the previous bucket buffer.
+            */

But surely if the buffer is the same as one of those others, then it's
registered anyway, and if it isn't, then it doesn't need to be.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



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.