Re: [PATCH] pg_isready (was: [WIP] pg_ping utility)

Поиск
Список
Период
Сортировка
От Phil Sorber
Тема Re: [PATCH] pg_isready (was: [WIP] pg_ping utility)
Дата
Msg-id CADAkt-h7W4crJyPmd+uY8BqKTxHEH4dQaoevgcYa9Cmym4MrxQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] pg_isready (was: [WIP] pg_ping utility)  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: [PATCH] pg_isready (was: [WIP] pg_ping utility)  (Craig Ringer <craig@2ndQuadrant.com>)
Список pgsql-hackers
On Sat, Jan 26, 2013 at 4:37 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> 2013/1/26 Phil Sorber <phil@omniti.com>:
>> On Sat, Jan 26, 2013 at 12:39 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>>> 2013/1/26 Phil Sorber <phil@omniti.com>:
>>>> On Sat, Jan 26, 2013 at 11:53 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>>>>> 2013/1/26 Phil Sorber <phil@omniti.com>:
>>>>>> On Sat, Jan 26, 2013 at 4:02 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>>>>>>> Hello
>>>>>>>
>>>>>>> We now haw to solve small puppet issue, because our puppets try to
>>>>>>> start server too early, when old instance live still.
>>>>>>>
>>>>>>> Maybe some new parameter - is_done can be useful.
>>>>>>>
>>>>>>
>>>>>> What about something like:
>>>>>> pg_isready; while [ $? -ne 2 ]; do sleep 1; pg_isready; done
>>>>>
>>>>> it is not enough - server is done in a moment, where can be started
>>>>> again - or when we can do safe copy of database data directory.
>>>>>
>>>>
>>>> I guess i am not completely understanding the case you are trying to
>>>> solve. Can you explain a bit further?
>>>
>>> We use puppets and due some simplification we cannot to use reload
>>> when configuration is changed. Our puppets has not enough intelligence
>>> to understand when is reload enough and when is restart necessary. So
>>> any change to configuration require restarting postgres. I don't know
>>> why "service restart" are not used. I believe so our puppet guru know
>>> it. It just do sequence STOP:START  Now puppets are "smart" and able
>>> to wait for time, when server is ready. But there are missing simple
>>> test if server is really done and I see a error messages related to
>>> too early try to start. So some important feature can be verification
>>> so server is really done.
>>>
>>> We can do it with test on pid file now - and probably we will use it.
>>> But I see so this is similar use case (in opposite direction)
>>>
>>
>> I guess I am still not clear why you can't do:
>>
>> stop_pg_via_puppet
>> pg_isready
>> while [ $? -ne 2 ]
>>   do
>>     sleep 1
>>     pg_isready
>>   done
>> do_post_stop_things
>> start_pg_via_puppet
>>
>
> because ! pg_isready <> pg_isdone
>

So you are proposing a different utility? Sorry, I thought you were
proposing a new option to pg_isready. What would pg_isdone be testing
for specifically? Is this something that would block until it has
confirmed a shutdown?

>>> Regards
>>>
>>> Pavel
>>>
>>>>
>>>>> Regards
>>>>>
>>>>> Pavel
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> Perhaps with a counter to break out of the loop after some number of attempts.
>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Pavel
>>>>>>>



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

Предыдущее
От: Phil Sorber
Дата:
Сообщение: Re: Request for vote to move forward with recovery.conf overhaul
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Support for REINDEX CONCURRENTLY