RE: Is this a problem in GenericXLogFinish()?
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Michael Paquier' <michael@paquier.xyz>
Cc: Amit Kapila <amit.kapila16@gmail.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-04-09T10:25:36Z
Lists: pgsql-hackers
Attachments
- v2_add_modbuf_flag.diff (application/octet-stream) patch v2
Dear Michael, > On Fri, Apr 05, 2024 at 06:22:58AM +0000, Hayato Kuroda (Fujitsu) wrote: > > Thanks for pointing out. Yes, we fixed a behavior by the commit aa5edbe37, > > but we missed the redo case. I made a fix patch based on the suggestion [1]. > > + bool mod_buf = false; > > Perhaps you could name that mod_wbuf, to be consistent with the WAL > insert path. Right, fixed. > I'm slightly annoyed by the fact that there is no check on > is_prim_bucket_same_wrt for buffer 1 in the BLK_NEEDS_REDO case to > show the symmetry between the insert and replay paths. Shouldn't > there be at least an assert for that in the branch when there are no > tuples (imagine an else to cover xldata->ntups == 0)? I mean between > just before updating the hash page's opaque area when > is_prev_bucket_same_wrt. Indeed, added an Assert() in else part. Was it same as your expectation? > I've been thinking about ways to make such cases detectable in an > automated fashion. The best choice would be > verifyBackupPageConsistency(), just after RestoreBlockImage() on the > copy of the block image stored in WAL before applying the page masking > which would mask the LSN. A problem, unfortunately, is that we would > need to transfer the knowledge of REGBUF_NO_CHANGE as a new BKPIMAGE_* > flag so we would be able to track if the block rebuilt from the record > has the *same* LSN as the copy used for the consistency check. So > this edge consistency case would come at a cost, I am afraid, and the > 8 bits of bimg_info are precious :/ I could not decide that the change has more benefit than its cost, so I did nothing for it. Best Regards, Hayato Kuroda FUJITSU LIMITED https://www.fujitsu.com/
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