Re: error_severity of brin work item

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: error_severity of brin work item
Date: 2020-12-01 18:57:24
Message-ID: 20201201185724.GA23756@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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()
and others are called. You'd have to create a new routine (say
AtEOXact_Autovacuum or more specific AtEOXact_AutovacuumWorkItems), to
be called at the right places in xact.c. Keep a global variable, say a
list of OIDs. On subxact commit, the list is reassigned to its parent
transaction; on subxact abort, the list is discarded. On top xact
commit, the list of OIDs is passed to some new routine in autovacuum.c
that scans the workitem array and deletes items as appropriate.

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.

> 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2020-12-01 19:20:40 Re: proposal: unescape_text function
Previous Message Justin Pryzby 2020-12-01 18:46:41 Re: error_severity of brin work item