Re: Is this a problem in GenericXLogFinish()?
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.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-14T03:42:29Z
Lists: pgsql-hackers
On Mon, Nov 13, 2023 at 10:51 PM Robert Haas <robertmhaas@gmail.com> wrote: > > 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, I don't think for others it's registered. For example, consider the case when prevpage and the writepage are the same (aka xlrec.is_prev_bucket_same_wrt is true), it won't be registered in another code path (see comment [1]). > > and if it isn't, then it doesn't need to be. > In the previous example, we need it to update the nextblockno during replay. I am not sure if I understand the scenario you are worried about, so if my response doesn't address your concern, can you please explain a bit more about the scenario you have in mind? [1] - /* * If prevpage and the writepage (block in which we are moving tuples * from overflow) are same, then no need to separately register * prevpage. During replay, we can directly update the nextblock in * writepage. */ -- With Regards, Amit Kapila.
Commits
-
Fix inconsistency with replay of hash squeeze record for clean buffers
- f56a9def71bb 17.0 landed
-
Set LSN for wbuf in _hash_freeovflpage() iff wbuf is modified.
- aa5edbe379d6 17.0 landed
-
Fix an uninitialized access in hash_xlog_squeeze_page().
- f66fcc5cd616 17.0 landed
-
Use REGBUF_NO_CHANGE at one more place in the hash index.
- 861f86beea1c 17.0 landed
-
Assert that buffers are marked dirty before XLogRegisterBuffer().
- 00d7fb5e2e39 17.0 landed
-
Fix bug in GenericXLogFinish().
- 04f0baa85865 11.22 landed
- 6dbd01b9fdad 12.17 landed
- 469d367bee2f 13.13 landed
- 6615bb95af2d 14.10 landed
- b9bb02620d4b 15.5 landed
- b8963e8a2854 16.1 landed
- ef74c7197c04 17.0 landed
-
Improve hash index bucket split behavior.
- 6d46f4783efe 10.0 cited