Re: Toast issues with OldestXmin going backwards

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Toast issues with OldestXmin going backwards
Date: 2018-04-28 13:30:21
Message-ID: 20180428133021.GN27724@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

* Robert Haas (robertmhaas(at)gmail(dot)com) wrote:
> On Fri, Apr 27, 2018 at 11:35 AM, Andrew Gierth
> <andrew(at)tao11(dot)riddles(dot)org(dot)uk> wrote:
> >>>>>> "Robert" == Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > Robert> One idea that occurred to me is to somehow record -- I guess in
> > Robert> pg_class using non-transactional updates -- the last cutoff XID
> > Robert> used to vacuum any given table. Then we could just make a rule
> > Robert> that you can't vacuum the TOAST table with an XID that's newer
> > Robert> than the last one used for the main table. That would preserve
> > Robert> the property that you can vacuum the tables separately while
> > Robert> avoiding dangling pointers. But that's obviously not
> > Robert> back-patchable,
> >
> > The suggestion made previously (in a historical thread) was to use an
> > entry in the reloptions field for this, at least in back branches. It
> > would be necessary for vacuum to add the entry initially in a normal
> > transactional update, after which it could be updated inplace.
>
> Yeah, I suppose. Sounds pretty rickety to me, though. Maybe I'm just
> a pessimist.

I tend to agree.. However, this isn't something that's been happening a
lot, from what I gather, and if we actually add a proper column into
pg_class for future versions (not really sure how I feel about if that
means "v11" or "v12" right now...) and reloptions for back-branches then
perhaps it's not so bad.

As far as a metadata page, it'd be pretty overkill, but maybe a fork for
it..? I'm trying to think if there might be anything else we'd be able
to put into such a fork since adding another inode to every relation
that'll only ever likely be 8k definitely wouldn't win us any fans. Not
sure, just brainstorming.

Thanks!

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2018-04-28 13:59:23 Re: "could not reattach to shared memory" on buildfarm member dory
Previous Message Craig Ringer 2018-04-28 12:01:46 Re: Is a modern build system acceptable for older platforms