Re: Fixes inconsistent behavior in vacuum when it processes multiple relations

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: shihao zhong <zhong950419(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixes inconsistent behavior in vacuum when it processes multiple relations
Date: 2025-06-25 01:31:35
Message-ID: aFtRd1Q4QuCWcg5k@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 24, 2025 at 11:30:13AM -0500, Nathan Bossart wrote:
> On Tue, Jun 24, 2025 at 10:18:18AM +0900, Michael Paquier wrote:
> > Knowing that I'm indirectly responsible for this mess, I would like to
> > take care of that myself. Would that be OK for you?
>
> I would be grateful if you took care of it.

Okay, applied the main fix down to v13 then.

> +1 for this. I did something similar to verify the other bugs I reported,
> and this seems far easier to maintain than potentially-unstable tests that
> require lots of setup and that depend on secondary effects.

After sleeping on this point, I have finished with this idea for tests
down to v17, adding more coverage for v18 with the GUC vacuum_truncate
and the "auto" mode of index_cleanup, while on it. v16 and older
branches don't have tests, but I have checked the sanity of the two
code paths using the tests attached for vacuum.sql and
pgstattuple.sql, at least. Two truncation tests for the "false" cases
were actually unstable. Sometimes the truncation may not happen even
with an aggressive VACUUM. Anyway, it is enough to check the true
case for the two code paths patched, even if it may not happen at
100%. I did not notice a problem with the index_cleanup case as long
as we had enough pages in the TOAST btree index, requiring some
runtime to load the entries, so the cost was annoying.

Attached is the remaining patch for HEAD, planned once v19 opens, and
the tests I have used on the back-branches as a txt to not confuse the
CI, for reference.
--
Michael

Attachment Content-Type Size
v5-0001-Refactor-handling-of-VacuumParams.patch text/x-diff 28.8 KB
vacuum_opts_tests.txt text/plain 9.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2025-06-25 01:50:53 Re: [PATCH] Fix hostaddr crash during non-blocking cancellation
Previous Message David G. Johnston 2025-06-25 00:45:25 Re: array_in sub function ReadArrayDimensions error message