Re: error_severity of brin work item

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: error_severity of brin work item
Дата
Msg-id 20201201185724.GA23756@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: error_severity of brin work item  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: error_severity of brin work item  (Justin Pryzby <pryzby@telsasoft.com>)
Список 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.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: Re: error_severity of brin work item
Следующее
От: Chapman Flack
Дата:
Сообщение: Re: proposal: unescape_text function