Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag
Дата
Msg-id 240194.1696907518@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Mon, Oct 09, 2023 at 12:20:18PM -0400, Tom Lane wrote:
>> There will be a window where the worker has logged "database
>> "noconndb" is not currently accepting connections" but hasn't yet
>> exited, so that conceivably this query could see a positive count.

> I don't think that's possible here.  The check on datallowconn is done
> before a backend calls pgstat_bestart() which would make its backend
> entry reported to pg_stat_activity.  So there is no window where a
> backend would be in pg_stat_activity if this check fails.

Ah, right.  I complained after seeing that we set MyProc->databaseId
before doing CheckMyDatabase, but you're right that it doesn't
matter for pg_stat_activity until pgstat_bestart. 

> Saying that, I'm OK with just dropping this query, as it could also be
> possible that one decides that calling pgstat_bestart() before the
> datallowconn check is a good idea for a reason or another.

Not sure if that's a likely change or not.  However, if we're in
agreement that this test step isn't buying much, let's just drop
it and save the test cycles.

            regards, tom lane



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Evaluate arguments of correlated SubPlans in the referencing ExprState
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Lowering the default wal_blocksize to 4K