Re: Is this a problem in GenericXLogFinish()?
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jeff Davis <pgsql@j-davis.com>, Alexander Lakhin <exclusion@gmail.com>, Heikki Linnakangas <hlinnaka@iki.fi>, pgsql-hackers@postgresql.org
Date: 2023-10-27T00:15:19Z
Lists: pgsql-hackers
On Thu, Oct 26, 2023 at 09:40:09AM -0400, Robert Haas wrote: > Because of this, it is possible for bucketbuf, prevbuf, and wbuf to be > the same (your first scenario) but the second scenario you mention > (nextbuf == wbuf) should be impossible. Okay.. > It seems to me that maybe we shouldn't even be registering wbuf or > doing anything at all to it if there are no tuples that need moving. > That would also require some adjustment of the redo routine. Hmm. So my question is: do we need the cleanup lock on the write buffer even if there are no tuples, and even if primary bucket and the write bucket are the same? I'd like to think that what you say is OK, still I am not completely sure after reading the lock assumptions in the hash README or 6d46f4783efe. A simpler thing would be to mark buffer 1 with REGBUF_NO_CHANGE when the primary and write buffers are the same if we expect the lock to always be taken, I guess.. I've noticed that the replay paths for XLOG_HASH_MOVE_PAGE_CONTENTS and XLOG_HASH_SQUEEZE_PAGE are similar with their page handlings (some copy-pastes?). A MOVE record should never have zero tuples, still the replay path assumes that this can be possible, so it could be simplified. -- Michael
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