Re: pg_hba_lookup function to get all matching pg_hba.conf entries
От | Haribabu Kommi |
---|---|
Тема | Re: pg_hba_lookup function to get all matching pg_hba.conf entries |
Дата | |
Msg-id | CAJrrPGcgyUqMi1QoUc2wbY+Tbwyog5zYTLn_WvFPrPPNd_7i_A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: pg_hba_lookup function to get all matching pg_hba.conf entries (Amit Kapila <amit.kapila16@gmail.com>) |
Ответы |
Re: pg_hba_lookup function to get all matching pg_hba.conf
entries
Re: pg_hba_lookup function to get all matching pg_hba.conf entries |
Список | pgsql-hackers |
On Wed, Dec 9, 2015 at 5:31 PM, Amit Kapila <amit.kapila16@gmail.com> wrote: > > Another bigger issue I see in the above part of code is that it doesn't > seem to be safe to call load_hba() at that place in PostgresMain() as > currently load_hba() is using a context created from PostmasterContext > to perform the parsing and some other stuff, the PostmasterContext > won't be available at that time. It is deleted immediately after > InitPostgres > is completed. So either we need to make PostmasterContext don't go > away after InitPostgres() or load_hba shouldn't use it and rather use > CurrentMemroyContext similar to ProcessConfigFile or may be use > TopMemoryContext instead of PostmasterContext if possible. I think > this needs some more thoughts. > > Apart from above, this patch doesn't seem to work on Windows or > for EXEC_BACKEND builds as we are loading the hba file in a > temporary context (PostmasterContext, refer PerformAuthentication) > which won't be alive for the backends life. This works on linux because > of fork/exec mechanism which allows to inherit the parsed file > (parsed_hba_lines). This is slightly tricky problem to solve and we > have couple of options (a) use TopMemoryContext instead of Postmaster > Context to load hba; (b) Use CurrentMemoryContext (c) pass the parsed > hba file for Windows/Exec_Backend using save_backend_variables/ > restore_backend_variables mechanism or if you have any other idea. > If you don't have any better idea, then you can evaluate above ideas > and see which one makes more sense. Reverting the context release patch is already provided in the first mail of this thread [1]. Forgot to mention about the same in further mails. Here I attached the same patch. This patch needs to be applied first before pg_hba_lookup patch. I tested it in windows version also. [1] - http://www.postgresql.org/message-id/CAJrrPGfFyf45mfK7uB+QHWhXn_tTMkNRVhTuDefQzuZZRwEeQg@mail.gmail.com Regards, Hari Babu Fujitsu Australia
Вложения
В списке pgsql-hackers по дате отправления: