make MaxBackends available in _PG_init

Поиск
Список
Период
Сортировка
От Wang, Shenhao
Тема make MaxBackends available in _PG_init
Дата
Msg-id 4f20d57b2aeb447b8eb1495319940c5f@G08CNEXMBPEKD06.g08.fujitsu.local
обсуждение исходный текст
Ответы Re: make MaxBackends available in _PG_init
Список pgsql-hackers
Hi Hackers:

I find the value in function _PG_init, the value of MaxBackends is 0.
In source, I find that the postmaster will first load library, and then calculate the value of MaxBackends.

In the old version, the MaxBackends was calculated by:
     MaxBackends = MaxConnections + autovacuum_max_workers + 1 +
        GetNumShmemAttachedBgworkers();
Because any extension can register workers which will affect the return value of GetNumShmemAttachedBgworkers.
InitializeMaxBackends must be called after shared_preload_libraries. This is also mentioned in comments.

Now, function GetNumShmemAttachedBgworkers was deleted and replaced by guc max_worker_processes,
so if we changed the calling order like:
    Step1: calling InitializeMaxBackends.
    Step2: calling process_shared_preload_libraries

In this order extension can get the correct value of MaxBackends in _PG_init.

Any thoughts?

Regards



Вложения

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

Предыдущее
От: Andy Fan
Дата:
Сообщение: Re: Dynamic gathering the values for seq_page_cost/xxx_cost
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Retry Cached Remote Connections for postgres_fdw in case remote backend gets killed/goes away