Re: Recording whether Heap2/PRUNE records are from VACUUM or from opportunistic pruning (Was: Show various offset arrays for heap WAL records)
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Peter Geoghegan <pg@bowt.ie>, Melanie Plageman <melanieplageman@gmail.com>
Cc: Andres Freund <andres@anarazel.de>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Robert Haas <robertmhaas@gmail.com>,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2024-03-25T13:04:54Z
Lists: pgsql-hackers
On 09/12/2023 23:48, Peter Geoghegan wrote:
> On Tue, Mar 21, 2023 at 3:37 PM Peter Geoghegan <pg@bowt.ie> wrote:
>> I think that we should do something like the attached, to completely
>> avoid this ambiguity. This patch adds a new XLOG_HEAP2 bit that's
>> similar to XLOG_HEAP_INIT_PAGE -- XLOG_HEAP2_BYVACUUM. This allows all
>> XLOG_HEAP2 record types to indicate that they took place during
>> VACUUM, by XOR'ing the flag with the record type/info when
>> XLogInsert() is called. For now this is only used by PRUNE records.
>> Tools like pg_walinspect will report a separate "Heap2/PRUNE+BYVACUUM"
>> record_type, as well as the unadorned Heap2/PRUNE record_type, which
>> we'll now know must have been opportunistic pruning.
>>
>> The approach of using a bit in the style of the heapam init bit makes
>> sense to me, because the bit is available, and works in a way that is
>> minimally invasive. Also, one can imagine needing to resolve a similar
>> ambiguity in the future, when (say) opportunistic freezing is added.
>
> Starting a new, dedicated thread to keep track of this in the CF app.
>
> This patch bitrot. Attached is v2, rebased on top of HEAD.
I included changes like this in commit f83d709760 ("Merge prune, freeze
and vacuum WAL record formats"). Marking this as Committed in the
commitfest.
--
Heikki Linnakangas
Neon (https://neon.tech)
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