Re: error_severity of brin work item

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: error_severity of brin work item
Date: 2020-12-01 22:25:34
Message-ID: 20201201222534.GE24052@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2020-12-01 22:31:29 Re: Setof RangeType returns
Previous Message Patrick Handja 2020-12-01 22:19:02 Re: Setof RangeType returns