pg_stat_replication.state: streaming/catchup

Started by Torsten Förtschalmost 12 years ago4 messagesgeneral
Jump to latest
#1Torsten Förtsch
torsten.foertsch@gmx.net

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Michael Paquier
michael@paquier.xyz
In reply to: Torsten Förtsch (#1)
Re: pg_stat_replication.state: streaming/catchup

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

#3Torsten Förtsch
torsten.foertsch@gmx.net
In reply to: Michael Paquier (#2)
Re: pg_stat_replication.state: streaming/catchup

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Michael Paquier
michael@paquier.xyz
In reply to: Torsten Förtsch (#3)
Re: pg_stat_replication.state: streaming/catchup

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