Adding vacuum test case of setting the VM when heap page is unmodified - Mailing list pgsql-hackers

From Melanie Plageman
Subject Adding vacuum test case of setting the VM when heap page is unmodified
Date
Msg-id CAAKRu_ZWx5gCbeCf7PWCv8p5==b7EEws0VD2wksDxpXCvCyHvQ@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Hi,

While working on a patch to set the VM in the same WAL record as
pruning and freezing [1], I discovered we have no test coverage of the
case where vacuum phase I sets the VM but no modifications are made to
the heap buffer (not even setting PD_ALL_VISIBLE). This can only
happen when the VM was somehow removed or destroyed.

Currently, we require the heap buffer to be marked dirty even if it is
unmodified because we add it to the WAL chain and do not pass
REGBUF_NO_CHANGES. (And we require adding it to the WAL chain because
we update the freespace map using the heap buffer in recovery). The VM
being gone is an uncommon case, so I don't think it makes sense to add
special logic to pass REGBUF_NO_CHANGES. However, I do think we should
have a test for this case.

I added the test to pg_visibility tests because I use
pg_truncate_visibility_map(). That seemed better than adding a new
test module or something. It doesn't test the extension functionality
specifically, but it seems like other tests in pg_visibility.sql also
exercise core code. Let me know if this interpretation is off-base.

- Melanie

[1] https://www.postgresql.org/message-id/CAAKRu_bvkCZ%2BxBzBjujJMkA5STU%2Bb6AtrUUTjcvAH%3DZnnpTtzA%40mail.gmail.com

Attachment

pgsql-hackers by date:

Previous
From: Matthias van de Meent
Date:
Subject: SQL-level pg_datum_image_equal
Next
From: Sami Imseih
Date:
Subject: Re: [Proposal] Adding callback support for custom statistics kinds