Re: Fix "database is ready" race condition

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fix "database is ready" race condition
Дата
Msg-id 14117.1170866785@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Fix "database is ready" race condition  (Markus Schiltknecht <markus@bluegap.ch>)
Ответы Re: Fix "database is ready" race condition  (Markus Schiltknecht <markus@bluegap.ch>)
Список pgsql-patches
Markus Schiltknecht <markus@bluegap.ch> writes:
> is there a good reason to print the "database system is ready" message
> in StartupXLOG() in xact.c? It has a) nothing to do with xlog and b)
> opens a small race condition: the message gets printed, while it still
> take some CPU cycles until the postmaster really gets the SIGCHLD signal
> and sets StartupPID = 0. If you (or rather: an automated test program)
> try to connect within this timespan, you get a "database is starting up"
> error, which clearly contradicts the "is ready" message.

I've applied a modified form of this patch.  The postmaster now says
"database system is ready to accept connections" after it's finished
reacting to the completion of the startup process.

            regards, tom lane

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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: LIMIT/SORT optimization
Следующее
От: Markus Schiltknecht
Дата:
Сообщение: Re: Fix "database is ready" race condition