Re: pg_basebackup blocking all queries with horrible performance

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: pg_basebackup blocking all queries with horrible performance
Дата
Msg-id CABUevEyRmeVrJetsoeiHCXZn98oFnKKaxFMKm-s1y3KfzE9Pzw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_basebackup blocking all queries with horrible performance  (Fujii Masao <masao.fujii@gmail.com>)
Список pgsql-admin
On Sun, Jun 10, 2012 at 2:25 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
> On Sun, Jun 10, 2012 at 7:43 PM, Magnus Hagander <magnus@hagander.net> wrote:
>> On Sat, Jun 9, 2012 at 2:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Fujii Masao <masao.fujii@gmail.com> writes:
>>>> This seems a bug. I think we should prevent pg_basebackup from
>>>> becoming synchronous standby. Thought?
>>>
>>> Absolutely.  If we have replication clients that are not actually
>>> capable of being standbys, there *must* be a way for the master
>>> to know that.
>>
>> I thought we fixed this already by sending InvalidXlogRecPtr as flush
>> location? And that this only applied in 9.2?
>>
>> Are you saying we picked pg_basebackup *in backup mode* (not log
>> streaming) as synchronous standby?
>
> Yes.
>
>> If so then yes, that is
>> *definitely* a bug that should be fixed. We should never select a
>> connection that's not even streaming log as standby!
>
> Agreed. Attached patch prevents pg_basebackup from becoming sync
> standby. Also this patch fixes another problem: currently only walsender
> which reaches STREAMING state can become sync walsender. OTOH,
> sync walsender thinks that walsender with higher priority will be sync one
> whether its state is STREAMING, and switches to potential sync walsender.
> So when the standby with higher priority connects to the master, we
> might have no sync standby until it reaches the STREAMING state.
> To fix this problem, the patch switches walsender's state from sync to
> potential *after* walsender with higher priority has reached the
> STREAMING state.

This fix needs to be applied independently of the other discussions,
since it affects 9.1 and needs to be backpatched.

So - applied, and backpatched.

The issues wrt the pg_basebackup background process and pg_receivexlog
are only for 9.2...

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: pg_basebackup blocking all queries with horrible performance
Следующее
От: Lonni J Friedman
Дата:
Сообщение: Re: pg_basebackup blocking all queries with horrible performance