<div dir="ltr">Thanks! Bo Peng !<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em qui., 14 de nov. de 2019 às 00:53, Bo Peng <<a href="mailto:pengbo@sraoss.co.jp">pengbo@sraoss.co.jp</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
On Wed, 13 Nov 2019 13:01:07 -0300<br>
Franklin Anderson de Oliveira Souza <<a href="mailto:franklinbr@gmail.com" target="_blank">franklinbr@gmail.com</a>> wrote:<br>
<br>
> I use pgpool with 5 slave on mode synchronous.<br>
> But sometimes i see values on column replication_delay when execute command<br>
> show pool_nodes.<br>
> Sometimes, when a node goes beyond the value of delay_threshold, the node<br>
> does not receive balancing query.<br>
> <br>
> But<br>
> 1- Synchronous replication should not be delayed is not it?<br>
> 2- How is this possible ?<br>
> 3- Is the replication_delay parameter of pgpool wrong?<br>
> <br>
> show pool_nodes<br>
> node_id | hostname | port | status | lb_weight | role | select_cnt |<br>
> load_balance_node | replication_delay | last_status_change<br>
> ---------+-------------+------+--------+-----------+---------+------------+-------------------+-------------------+---------------------<br>
> 0 | IP | 5432 | up | 0.100000 | primary | 230616548 |<br>
> false | 0 | 2019-10-24 19:17:27<br>
> 1 | IP | 5432 | up | 0.100000 | standby | 172466610 |<br>
> true | 0 | 2019-10-24 19:17:27<br>
> 2 | IP | 5432 | up | 0.100000 | standby | 180179200 |<br>
> false | 234324 | 2019-10-24 19:17:27<br>
> 3 | IP | 5432 | up | 0.100000 | standby | 178475037 |<br>
> false | 20777216 | 2019-10-24 19:17:27<br>
> 4 | IP | 5432 | up | 0.100000 | standby | 182174042 |<br>
> false | 0 | 2019-10-24 19:17:27<br>
> 5 | IP | 5432 | up | 0.100000 | standby | 181169375 |<br>
> false | 0 | 2019-10-24 19:17:27<br>
> <br>
> <br>
> <br>
> pg_stat_replication<br>
> application_name | client_addr | write_lsn | flush_lsn |<br>
> write_lag | sync_priority | sync_state<br>
> --------------------+-------------+--------------+--------------+-----------------+---------------+------------<br>
> pje1_slave1 | IP | 8FA/42E88B60 | 8FA/42E88B60 |<br>
> 00:00:00.000355 | 1 | sync<br>
> pje1_slave2 | IP | 8FA/42E88B60 | 8FA/42E88B60 |<br>
> 00:00:00.000312 | 2 | potential<br>
> pje1_slave3 | IP | 8FA/42E88B60 | 8FA/42E88B60 |<br>
> 00:00:00.000366 | 3 | potential<br>
> pje1_slave4 | IP | 8FA/42E88B60 | 8FA/42E88B60 |<br>
> 00:00:00.000277 | 4 | potential<br>
> pje1_slave5 | IP | 8FA/42E88B60 | 8FA/42E88B60 |<br>
> 00:00:00.000265 | 5 | potential<br>
<br>
It's the feature of PostgreSQL synchronous replication, not pgpool's issue.<br>
<br>
As you can see from pg_stat_replication.sync_state, <br>
only "pje1_slave1" is a synchronous standby.<br>
pje1_slave2-5 are "potential" which means asynchronous standby.<br>
<br>
See more details:<br>
<a href="https://www.postgresql.org/docs/12/monitoring-stats.html#PG-STAT-REPLICATION-VIEW" rel="noreferrer" target="_blank">https://www.postgresql.org/docs/12/monitoring-stats.html#PG-STAT-REPLICATION-VIEW</a><br>
<br>
<br>
> -- <br>
> foobar<br>
<br>
<br>
-- <br>
Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>><br>
SRA OSS, Inc. Japan<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">foobar</div>