Thread: pg_stat_replication.state: streaming/catchup

pg_stat_replication.state: streaming/catchup

From
Torsten Förtsch
Date:
Hi,

just out of curiosity, what's the difference between "streaming" and
"catchup" state in pg_stat_replication.

According to the documentation this field is "Current WAL sender state".
But that does not tell me anything.

Thanks,
Torsten


Re: pg_stat_replication.state: streaming/catchup

From
Michael Paquier
Date:



On Mon, Apr 21, 2014 at 8:03 PM, Torsten Förtsch <torsten.foertsch@gmx.net> wrote:
Hi,

just out of curiosity, what's the difference between "streaming" and
"catchup" state in pg_stat_replication.

According to the documentation this field is "Current WAL sender state".
But that does not tell me anything.
When a standby connects for the first time to a primary, it is not yet synchronized, this is the "catchup" phase. Once the lag between the standby and the master is reduced to zero for the first time, replication state changes to "streaming".
--
Michael

Re: pg_stat_replication.state: streaming/catchup

From
Torsten Förtsch
Date:
On 21/04/14 13:18, Michael Paquier wrote:
> When a standby connects for the first time to a primary, it is not yet
> synchronized, this is the "catchup" phase. Once the lag between the
> standby and the master is reduced to zero for the first time,
> replication state changes to "streaming".

Thanks.

I am seeing several standbys changing from streaming to catchup and
back. Sometimes they also get completely lost. This happens when the lag
becomes high, hundreds of MB or even GB. The standby servers are
relatively far away on the internet. And the operation to generate this
kind of lag is index creation on large tables.

Is there a difference in the protocol used in those phases? Maybe the
catchup phase is optimized for bulk throughput?

Torsten


Re: pg_stat_replication.state: streaming/catchup

From
Michael Paquier
Date:



On Mon, Apr 21, 2014 at 8:34 PM, Torsten Förtsch <torsten.foertsch@gmx.net> wrote:
On 21/04/14 13:18, Michael Paquier wrote:
s there a difference in the protocol used in those phases? Maybe the
catchup phase is optimized for bulk throughput?
There is no difference AFAIK, the same replication protocol is used:
http://www.postgresql.org/docs/9.3/static/protocol-replication.html
Regards,
--
Michael