[pgpool-general: 6014] Fwd: INSERT statements sent to standby

Bud Curly psyckow.prod at gmail.com
Wed Apr 4 23:59:51 JST 2018


Hi and thanks for your work.

I use pgpool2 3.7.2 with 2 backend as master-slave mode with native stream
replication.

I think I have an issue whenever I do these steps :

   1. Node 0 is master, node 1 is slave. Everything goes well.
   2. I shut node 0, which causes failover and promote node 1 to the new
   master. Everything goes well, I still can insert datas here.
   3. I do an online recovery of the node 0. So it goes as standby then.
   Since here, pgpool send all INSERT statement on the backend 0.

Here is pgpool log which demonstrate well the weird behaviour :

root at srv:~# pgpool -n
2018-04-04 14:26:01: pid 28055:LOG:  Setting up socket for 0.0.0.0:21042
2018-04-04 14:26:01: pid 28055:LOG:  Setting up socket for :::21042
2018-04-04 14:26:01: pid 28055:LOG:  find_primary_node_repeatedly:
waiting for finding a primary node
2018-04-04 14:26:01: pid 28055:LOG:  find_primary_node: checking backend no 0
2018-04-04 14:26:01: pid 28055:LOG:  find_primary_node: checking backend no 1
2018-04-04 14:26:01: pid 28055:LOG:  find_primary_node: primary node id is 1
2018-04-04 14:26:01: pid 28055:LOG:  pgpool-II successfully started.
version 3.7.2 (amefuriboshi)
2018-04-04 14:26:10: pid 28075:LOG:  pool_send_and_wait: Error or
notice message from backend: : DB node id: 0 backend pid: 28098
statement: "insert into "***[...]***" message: "cannot execute INSERT
in a read-only transaction"

The primary node is node 1, however it send INSERT on the standby. If I
shut node 0, INSERT are sent to node 1 just well. If I restart node 0, the
problem shows up again.

With *select pg_is_in_recovery();* and *pcp_node_info* I can see that node
1 is the master and node 0 is the standby.

I can manually INSERT on Node 1 directly. On Node 0, I have the same error
as expected : *cannot execute INSERT in a read-only transaction*

With *log_error_verbosity = verbose* I have no revelant information.

Here is my pgpool.conf :

pgpool.conf
<https://github.com/pgpool/pgpool2/files/1875707/pgpool.conf.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20180404/3a48122c/attachment.html>


More information about the pgpool-general mailing list