[pgpool-hackers: 1879] Re: Pgpool-II can send write queries to standby

Tatsuo Ishii ishii at sraoss.co.jp
Wed Oct 26 08:08:24 JST 2016


> Hi,
> 
> In some cases, Pgpool-II can lost the primary server whether the primary
> is alive or not. Even in this case, Pgpool-II tries send write query
> to backend, and when the primary is alive and this is same as master,
> the query succeeds.
> 
> postgres=# show pool_nodes;
>  node_id | hostname | port | status | lb_weight |  role   | select_cnt 
> ---------+----------+------+--------+-----------+---------+------------
>  0       | osspc20  | 5432 | 3      | 0.333333  | standby | 1
>  1       | osspc33  | 5432 | 2      | 0.333333  | standby | 0
>  2       | osspc34  | 5432 | 3      | 0.333333  | standby | 0
> (3 rows)
> 
> postgres=# insert into hoge values(1);
> INSERT 0 1

I am not sure which node is supposed to be the primary because you did
not mention about it. However I guess node 1 is the primary.

> However, this would be odd for user because the the status that user
> can see is standby. Pgpool-II should raise an error in such cases or
> add other information as status?

Not sure that is an enhancement. Moreover that would be a significant
behavior change and we should be very careful to keep the backward
compatibility (i.e. adding new switch).

In any case current behavior is not well documented. I welcome you to
create a patch for 3.6.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp



More information about the pgpool-hackers mailing list