Re: Simultaneously streaming database replication and pg_dump, yet observing zero lag

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Simultaneously streaming database replication and pg_dump, yet observing zero lag
Дата
Msg-id 20150430145420.GD2658@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Simultaneously streaming database replication and pg_dump, yet observing zero lag  (Scott Ribe <scott_ribe@elevated-dev.com>)
Список pgsql-admin
On 2015-04-30 08:08:22 -0600, Scott Ribe wrote:
> On Apr 30, 2015, at 8:00 AM, Matt Patey <matt.patey@ableton.com> wrote:
> >
> > We have a streaming replication setup, where the replication slave runs pg_dump every hour. Our lag monitor shows
anexpected sawtooth shape, where pg_dump runs coincide with a climbing lag, which ends abruptly when pg_dump is
finished.This is, to the best of my knowledge, expected behaviour. The lag pattern occasionally disappears though, and
whenlooking at system processes we see that the database is recovering WAL data, and pg_dump is also running. How is
thiseven possible? 
>
> Any query (and pg_dump is a series of queries) does not necessarily
> block recovery. AFAIK, it’s only when the query requires a version of
> a row which would be removed by WAL replay that the recovery gets
> blocked. So it’s possible for pg_dump to not block recovery, but in
> any reasonably active db I think it’s unlikely—exactly what you’re
> seeing.

Right. And incidences of thta can be greatly reduced by enabling
hot_standby_feedback on the standby.

Greetings,

Andres Freund


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

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: Simultaneously streaming database replication and pg_dump, yet observing zero lag
Следующее
От: Matt Patey
Дата:
Сообщение: Re: Simultaneously streaming database replication and pg_dump, yet observing zero lag