Re: problems with toast.* reloptions

Поиск
Список
Период
Сортировка
Искать

Re: problems with toast.* reloptions

От:
Nathan Bossart <nathandbossart@gmail.com>
Дата:
On Tue, Jun 24, 2025 at 02:10:55PM +0900, Michael Paquier wrote:
> On Mon, Jun 23, 2025 at 03:59:56PM -0500, Nathan Bossart wrote:
>> Here is a very rough proof-of-concept patch set for this.  AFAICT there are
>> a few options we cannot fix on the back-branches because there is no way to
>> tell whether it is set or has just picked up the default.  On v18 and
>> newer, we could use isset_offset, but that doesn't exist on older versions.
>> (I haven't looked closely, but I'm assuming that back-patching isset_offset
>> isn't an option.)
> 
> Hmm.  I am wondering if we need to be aggressive about this set of
> changes at all in the back branches.  It's been broken for a long time
> without anybody really complaining about the fact that reloptions
> being set or not influenced the outcome in the context of autovacuum,
> so perhaps there is a good argument for keeping all that in v19.  My
> conservative 2c.

Yeah, I'm tempted to even ask how folks feel about removing the toast.*
reloptions.  Maybe there's some simple cases that work well enough, but
AFAICT any moderately-complicated setup basically doesn't work at all.  In
any case, writing out this patch set has got me on the fix-on-HEAD-only
bandwagon.

>> I would like to explore the "option 2" from upthread [0] for v19.  I think
>> that is a better long-term solution, and it may allow us to remove the
>> table_toast_map in autovacuum.
> 
> It would be nice to have some tests here to check the state of the
> options used?  My best guess would be a DEBUG1 entry combined with a
> scan of the logs generated and an aggressive autovacuum worker
> spawn to check that the options generated are what we expect for the
> relations autovacuum picks up.

Eh...  I agree that's probably how we'd have to test it with the existing
tools, but it sure sounds like a recipe for a flaky test.

-- 
nathan


Re: problems with toast.* reloptions

От:
Nathan Bossart <nathandbossart@gmail.com>
Дата:
Вложения:
On Tue, Jun 24, 2025 at 11:38:41AM -0500, Nathan Bossart wrote:
> Yeah, I'm tempted to even ask how folks feel about removing the toast.*
> reloptions.  Maybe there's some simple cases that work well enough, but
> AFAICT any moderately-complicated setup basically doesn't work at all.  In
> any case, writing out this patch set has got me on the fix-on-HEAD-only
> bandwagon.

For the sake of discussion, I wrote a patch for this.  I suggested removing
toast.* relopts to some colleagues recently, and nobody was aware of much
(if any) use in the field.  So maybe this isn't totally
out-of-the-question...

-- 
nathan

Re: problems with toast.* reloptions

От:
Nathan Bossart <nathandbossart@gmail.com>
Дата:
Вложения:
On Fri, May 01, 2026 at 04:41:12PM -0500, Nathan Bossart wrote:
> On Tue, Jun 24, 2025 at 11:38:41AM -0500, Nathan Bossart wrote:
>> Yeah, I'm tempted to even ask how folks feel about removing the toast.*
>> reloptions.  Maybe there's some simple cases that work well enough, but
>> AFAICT any moderately-complicated setup basically doesn't work at all.  In
>> any case, writing out this patch set has got me on the fix-on-HEAD-only
>> bandwagon.
> 
> For the sake of discussion, I wrote a patch for this.  I suggested removing
> toast.* relopts to some colleagues recently, and nobody was aware of much
> (if any) use in the field.  So maybe this isn't totally
> out-of-the-question...

Apparently I forgot to test it with injection points enabled.  Here's a new
patch.

-- 
nathan

Re: problems with toast.* reloptions

От:
Nathan Bossart <nathandbossart@gmail.com>
Дата:
Вложения:
On Mon, May 04, 2026 at 10:41:15AM -0500, Nathan Bossart wrote:
> Apparently I forgot to test it with injection points enabled.  Here's a new
> patch.

v4 fixes a small bug in pg_upgrade's new check query.

-- 
nathan

Re: problems with toast.* reloptions

От:
Nathan Bossart <nathandbossart@gmail.com>
Дата:
On Tue, May 26, 2026 at 11:25:39AM +0530, solai v wrote:
> I tested the TOAST reloptions behavior locally on current HEAD and was
> able to reproduce the inheritance and RESET scenarios discussed in the
> thread.
> From my testing, explicit toast.reloptions behave independently from
> parent reloptions. After setting both parent and TOAST vacuum_truncate
> values, RESET(vacuum_truncate) on the parent table cleared only the
> parent reloption while the explicit TOAST reloption remained intact.
> I also tried applying the v1-0004 patch in a clean worktree, but most
> hunks in vacuum.c and autovacuum.c no longer apply cleanly against
> current HEAD due to code drift. From inspecting the rejected hunks, it
> looks like the patch approach was to dynamically combine parent and
> TOAST reloptions during VACUUM/autovacuum execution instead of copying
> inherited reloptions directly into the TOAST relation.

I humbly encourage you to read the rest of the thread.  In particular, I'm
curious whether anyone would object to removing the TOAST reloptions.

-- 
nathan


Re: problems with toast.* reloptions

От:
solai v <solai.cdac@gmail.com>
Дата:
Hi,
> I humbly encourage you to read the rest of the thread.  In particular, I'm
> curious whether anyone would object to removing the TOAST reloptions.
I tested the remove-toast-reloptions.patch on current HEAD.
The patch applied and built cleanly .I verified that TOAST reloptions
are no longer accepted:
ALTER TABLE toat_test SET (toast.vacuum_truncate=false):
ALTER TABLE toast_test SET(toast.autovacuum_enabled = false);
Both returned:
ERROR:unrecognized parameter namespace "toast"
Regular reloptions still work as expected:
ALTER TABLE toast_test SET (vacuum_truncate=false);
The patch behaved as expected in my testing

Regards
solai


Re: problems with toast.* reloptions

От:
Nikita Malakhov <hukutoc@gmail.com>
Дата:
Hi hackers!

I strongly object to removing TOAST reloptions.
As anyone here knows, TOAST tables are subject to bloating, and in my opinion
we'll eventually come to multi TOAST tables per relation.
I've tested such an approach some time ago, it does not create any problems
and provides additional possibilities like ability to vacuum separate TOAST
only partly influencing overall work with parent relation.

On Tue, Jun 2, 2026 at 12:42 PM solai v <solai.cdac@gmail.com> wrote:
Hi,
> I humbly encourage you to read the rest of the thread.  In particular, I'm
> curious whether anyone would object to removing the TOAST reloptions.
I tested the remove-toast-reloptions.patch on current HEAD.
The patch applied and built cleanly .I verified that TOAST reloptions
are no longer accepted:
ALTER TABLE toat_test SET (toast.vacuum_truncate=false):
ALTER TABLE toast_test SET(toast.autovacuum_enabled = false);
Both returned:
ERROR:unrecognized parameter namespace "toast"
Regular reloptions still work as expected:
ALTER TABLE toast_test SET (vacuum_truncate=false);
The patch behaved as expected in my testing

Regards
solai




--
Regards,
Nikita Malakhov
Postgres Professional
The Russian Postgres Company

Re: problems with toast.* reloptions

От:
Nathan Bossart <nathandbossart@gmail.com>
Дата:
On Tue, Jun 02, 2026 at 03:31:40PM +0300, Nikita Malakhov wrote:
> I strongly object to removing TOAST reloptions.

FWIW I am working on a patch to actually fix the bugs instead of removing
the TOAST relopts.  Will hopefully have something to share in the near
future.

-- 
nathan


Re: problems with toast.* reloptions

От:
Nikita Malakhov <hukutoc@gmail.com>
Дата:
Hi,

Nathan, sorry if there is any misunderstanding, I answered Solai V
against removing TOAST reloptions. Glad you're working on this subject.
Cheers!

On Tue, Jun 2, 2026 at 5:08 PM Nathan Bossart <nathandbossart@gmail.com> wrote:
On Tue, Jun 02, 2026 at 03:31:40PM +0300, Nikita Malakhov wrote:
> I strongly object to removing TOAST reloptions.

FWIW I am working on a patch to actually fix the bugs instead of removing
the TOAST relopts.  Will hopefully have something to share in the near
future.

--
nathan


--
Regards,
Nikita Malakhov
Postgres Professional
The Russian Postgres Company
FAQ