Re: Parallel query hangs after a smart shutdown is issued

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: Parallel query hangs after a smart shutdown is issued
Дата
Msg-id CA+hUKGLPh9NS270bXhOYLnFDVhzW6cjKq5tOT4NL4k6awjbwzg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Parallel query hangs after a smart shutdown is issued  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Parallel query hangs after a smart shutdown is issued  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Aug 13, 2020 at 2:37 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I experimented with separating the shutdown-in-progress state into a
> separate variable, letting us actually reduce not increase the number of
> pmStates.  This way, PM_RUN and other states still apply until we're
> ready to pull the shutdown trigger, so that we don't need to complicate
> state-based decisions about launching auxiliary processes.  This patch
> also unifies the signal-sending for the smart and fast shutdown paths,
> which seems like a nice improvement.  I kind of like this, though I'm not
> in love with the particular variable name I used here (smartShutState).

Makes sense.  I tested this version on a primary and a replica and
verified that parallel workers launch, but I saw that autovacuum
workers still can't start without something like this:

@@ -2463,7 +2463,8 @@ canAcceptConnections(int backend_type)
         * be returned until we have checked for too many children.
         */
        if (smartShutState != SMART_NORMAL_USAGE &&
-               backend_type != BACKEND_TYPE_BGWORKER)
+               backend_type != BACKEND_TYPE_BGWORKER &&
+               backend_type != BACKEND_TYPE_AUTOVAC)
        {
                if (smartShutState == SMART_SUPERUSER_ONLY)
                        result = CAC_WAITBACKUP;        /* allow
superusers only */
@@ -2471,7 +2472,8 @@ canAcceptConnections(int backend_type)
                        return CAC_SHUTDOWN;    /* shutdown is pending */
        }
        if (pmState != PM_RUN &&
-               backend_type != BACKEND_TYPE_BGWORKER)
+               backend_type != BACKEND_TYPE_BGWORKER &&
+               backend_type != BACKEND_TYPE_AUTOVAC)
        {
                if (Shutdown > NoShutdown)
                        return CAC_SHUTDOWN;    /* shutdown is pending */



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Switch to multi-inserts for pg_depend
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Parallel query hangs after a smart shutdown is issued