Re: Show various offset arrays for heap WAL records
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Melanie Plageman <melanieplageman@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@postgresql.org, Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2023-04-10T19:18:27Z
Lists: pgsql-hackers
Attachments
- v1-0001-Fix-heapdesc-infomask-array-output.patch (application/octet-stream) patch v1-0001
On Sun, Apr 9, 2023 at 5:12 PM Peter Geoghegan <pg@bowt.ie> wrote: > I noticed that the nbtree VACUUM and DELETE record types have their > update/xl_btree_update arrays output incorrectly. We cannot use the > generic array_desc() approach with xl_btree_update elements, because > they're variable-width elements. The problem is that array_desc() only deals > with fixed-width elements. I pushed this fix just now, though without the updates to the guidelines (or only minimal updates). A remaining problem with arrays appears in "infobits" fields for record types such as LOCK. Here's an example of the problem: off: 34, xid: 3, flags: 0x00, infobits: [, LOCK_ONLY, EXCL_LOCK ] Clearly the punctuation from the array is malformed. A second issue (related to the first) is the name of the key itself, "infobits". While "infobits" actually seems fine in this particular example, I don't think that we want to do the same for record types such as HEAP_UPDATE, since such records require that the description show information about flags whose underlying field in the WAL record struct is actually called "old_infobits_set". I think that we should be outputting "old_infobits: [ ... ] " in the description of HEAP_UPDATE records, which isn't the case right now. A third issue is present in the nearby handling of xl_heap_truncate status flags. It's the same basic array punctuation issue again, so arguably this is the same issue as the first one. Attached patch fixes all of these issues, and overhauls the guidelines in the way originally proposed by the nbtree fix patch (since I didn't keep that part of the nbtree patch when I pushed it today). Note that the patch makes many individual (say) HOT_UPDATE records have descriptions that look like this: ... old_infobits: [], ... This differs from HEAD, where the output is totally suppressed because there are no flag bits to show. I think that this behavior is more logical and consistent overall. -- Peter Geoghegan
Commits
-
Merge prune, freeze and vacuum WAL record formats
- f83d709760d8 17.0 landed
-
Add rmgrdesc README
- f0bd0b4489fa 17.0 landed
-
Refine the guidelines for rmgrdesc authors.
- c03c2eae0acb 16.0 landed
-
Fix Heap rmgr's desc output for infobits arrays.
- 96149a180d56 16.0 landed
-
Clarify nbtree posting list update desc issue.
- 26e65ebdb295 16.0 landed
-
Fix nbtree posting list update desc output.
- 5d6728e588c3 16.0 landed
-
Set cutoff xmin more aggressively when vacuuming a temporary table.
- a7212be8b9e0 14.0 cited