Re: [PATCH] Allow Postgres to pick an unused port to listen

Поиск
Список
Период
Сортировка
От Yurii Rashkovskii
Тема Re: [PATCH] Allow Postgres to pick an unused port to listen
Дата
Msg-id CA+RLCQyruUQNTR2oHdrRqQvX8N3BMDf7K=MEsAS8ZgkuqH4QyA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Allow Postgres to pick an unused port to listen  (Cary Huang <cary.huang@highgo.ca>)
Ответы Re: [PATCH] Allow Postgres to pick an unused port to listen  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Re: [PATCH] Allow Postgres to pick an unused port to listen  (Denis Laxalde <denis.laxalde@dalibo.com>)
Список pgsql-hackers
Hi Cary,

Thank you so much for the review. It's very valuable, and you caught an important issue with it that I somehow missed (not updating the .pid file with the selected port number). I'm not sure how it escaped me (perhaps I was focusing too much on the log file to validate the behaviour).

I've amended the patch to ensure the port number is in the lock file. I've attached V2.

Yurii


On Sat, May 6, 2023 at 12:31 AM Cary Huang <cary.huang@highgo.ca> wrote:
The following review has been posted through the commitfest application:
make installcheck-world:  tested, passed
Implements feature:       tested, failed
Spec compliant:           not tested
Documentation:            not tested

Hello

This is one of those features that is beneficial to a handful of people in specific test cases. It may not benefit the majority of the users but is certainly not useless either. As long as it can be disabled and enough tests have been run to ensure it won't have a significant impact on working components while disabled, it should be fine in my opinion. Regarding where the selected port shall be saved (postmaster.pid, read by pg_ctl or saved in a dedicated file), I see that postmaster.pid already contains a port number in line number 4, so adding a port number into there is nothing new; port number is already there and we can simply replace the port number with the one selected by the system.

I applied and tested the patch and found that the system can indeed start when port is set to 0, but line 4 of postmaster.pid does not store the port number selected by the system, rather, it stored 0, which is the same as configured. So I am actually not able to find out the port number that my PG is running on, at least not in a straight-forward way.

thank you
==================
Cary Huang
HighGo Software
www.highgo.ca


--
Y.

Вложения

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

Предыдущее
От: "盏一"
Дата:
Сообщение: Proposal for Prototype Implementation to Enhance C/C++ Interoperability in PostgreSQL
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Missing update of all_hasnulls in BRIN opclasses