Re: Confine vacuum skip logic to lazy_scan_skip
John Naylor <johncnaylorls@gmail.com>
From: John Naylor <johncnaylorls@gmail.com>
To: Melanie Plageman <melanieplageman@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Thomas Munro <thomas.munro@gmail.com>, Noah Misch <noah@leadboat.com>, vignesh C <vignesh21@gmail.com>, Andres Freund <andres@anarazel.de>,
Pg Hackers <pgsql-hackers@postgresql.org>, Heikki Linnakangas <hlinnaka@iki.fi>, Nazir Bilal Yavuz <byavuz81@gmail.com>, Robert Haas <robertmhaas@gmail.com>,
"Andrey M. Borodin" <x4mmm@yandex-team.ru>
Date: 2025-11-04T09:27:08Z
Lists: pgsql-hackers
On Mon, Nov 3, 2025 at 10:59 PM Melanie Plageman <melanieplageman@gmail.com> wrote: > > > Not sure. That changes the posture from "can't happen" to "shouldn't > > happen, but if it does, don't cause a disaster". Even with the latter, > > the assert still seems appropriate for catching developer mistakes. > > You are suggesting keeping the assert and this line after it? > > num_offsets = Min(num_offsets, lengthof(offsets)); My "not sure" was referring to this line. > The current contract of TidStoreGetBlockOffsets() is that it won't > return a value larger than max_offsets passed in, so it is a good idea > to have an assert in case it changes. I suspect the contract is the way it is in order to enable the assert to work. > But, if we take the minimum, > then is the assert there to keep developers from changing > TidStoreGetBlockOffsets() from behaving differently? I don't know if I > like that, but I don't feel strongly enough to object. Anyway, I think > we should add the line Tom suggested. This line seems strange to me (and maybe even stranger to have both the min and the assert), but maybe I don't understand Tom's rationale well enough. Do we need it to silence Coverity? -- John Naylor Amazon Web Services
Commits
-
Fix explicit valgrind interaction in read_stream.c.
- 57dca6faa9bd 17.5 landed
- 2a8a00674e97 18.0 landed
-
Reduce scope of heap vacuum per_buffer_data
- c623e8593ec4 18.0 landed
-
Use streaming read I/O in VACUUM's third phase
- c3e775e608f2 18.0 landed
-
Use streaming read I/O in VACUUM's first phase
- 9256822608f3 18.0 landed
-
Convert heap_vac_scan_next_block() boolean parameters to flags
- 32acad7d1d0a 18.0 landed
-
Refactor tidstore.c iterator buffering.
- f6bef362cac8 18.0 landed
-
Increase default vacuum_buffer_usage_limit to 2MB.
- 98f320eb2ef0 17.0 landed
-
Remove unneeded vacuum_delay_point from heap_vac_scan_get_next_block
- 3d8652cd3284 17.0 landed
-
Confine vacuum skip logic to lazy_scan_skip()
- 4e76f984a773 17.0 landed
-
Set all_visible_according_to_vm correctly with DISABLE_PAGE_SKIPPING
- 407cb6c6589f 16.3 landed
- 674e49c73c1c 17.0 landed
-
Tighten up VACUUM's approach to setting VM bits.
- 980ae173108e 16.0 cited