Re: error_severity of brin work item - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: error_severity of brin work item
Date
Msg-id 20201201222534.GE24052@telsasoft.com
Whole thread Raw
In response to Re: error_severity of brin work item  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On Tue, Dec 01, 2020 at 03:57:24PM -0300, Alvaro Herrera wrote:
> On 2020-Dec-01, Justin Pryzby wrote:
> 
> > This was an idea I made up - I don't know any of the details of this, but if
> > you give a hint I could look at it more.  There'd (still) be a race window, but
> > I think that's ok.
> 
> See CommitTransaction() and friends, where AtEOXact_on_commit_actions()

..thanks.  I was going to persue the other idea first since this is new to me.

> Not sure what's a good place for OIDs to be added to the list.  We don't
> have AM-specific entry points for relation drop.  I think this is the
> weakest point of this.

I assume it would just add OIDs of *all* dropped rels, and the autovacuum half
would silently ignore any OID for which there's no work item.  (As it would do
in any case).

> > Another idea is if perform_work_item() were responsible for discarding
> > relations which disappear.  Currently it does this, which is racy since it
> > holds no lock.
> 
> That has the property that it remains contained in autovacuum.c, but no
> other advantages I think.

It has the advantage that it moves all the try_open stuff out of brin.

I started implementing this, and then realized that the try_open stuff *has* to
be in the brin_summarize function, to handle the case that someone passes a
non-index, since it's SQL exposed.
So maybe we should use your LockOid patch now, and refactor in the future if we
add additional work-item types.

-- 
Justin



pgsql-hackers by date:

Previous
From: Patrick Handja
Date:
Subject: Re: Setof RangeType returns
Next
From: Chapman Flack
Date:
Subject: Re: Setof RangeType returns