[pgpool-general: 6149] Re: What happens when node is assigned as shutdown

Pierre Timmermans ptim007 at yahoo.com
Wed Jun 27 04:20:51 JST 2018

I understand what you mean, but don't forget that the connections to the postgres database are established by pgpool, so the applications are not connected directly to postgres : the application connects to pgpool and pgpool connects to postgres. Therefore if pgpool cannot see the database anymore, because of a network failure, then all connections are stucked (even if postgres DB is still fine).
So when pgpool cannot see the database anymore (health check), it will try a few time (health_check_max_retries) and then it will do the failover : during the failover all backend connections are destroyed and then re-created (exception is when the standby fails, then backend connections to the primary are not affected, even if load_balance is on, as Tatsuo confirmed in other mail)
So it is not the same situation as in Oracle with the listener, in the case of the oracle listener, the listener process just establish the connection and then it hand it over to the client application and from this point the listener is not needed anymore for this process. The advantage of pgpool is that it can re-establish the connections transparently when a fail-over happens. it is not completely transparent because when the master is is failed-over all connections are first disconnected and then re-connected but it is impossible to avoid that I guess.

    On Tuesday, June 26, 2018, 4:53:05 PM GMT+2, Mariel Cherkassky <mariel.cherkassky at gmail.com> wrote:  
 But what if my standby didnt fail ? I mean, in my case I had a network conflict between the standby and the pool. The standby was up and was working. In that case stil the session will be disconneced ? And why only in case the load_balance_mode is off the seesion will not be disrupted ? Isnt it suppose to be the the opposite ? I have 2 standbys and In case one of my standby`s is down or doesnt work all the current sessions to him will be moved to the second standby.
2018-06-26 17:20 GMT+03:00 Pierre Timmermans <ptim007 at yahoo.com>:
Note that if standby node fails and if load_balance_node is off, then the pgpool connection will not be disrupted by the failover happening on the standby (at least with recent version of pgpool): this is documented in the doc and I can confirm that it is working in my tests.
In all other cases the backend connection will be disconnected and I suppose the client will receive an error and the query result will be lost

    On Tuesday, June 26, 2018, 3:35:41 PM GMT+2, Mariel Cherkassky <mariel.cherkassky at gmail.com> wrote:  
 The moment the pool assign the shutdown status to a specific node all active session to that node are closed immediatly ?
2018-06-26 16:11 GMT+03:00 Tatsuo Ishii <ishii at sraoss.co.jp>:
> Hi,
> I wanted to understand what happens to a session that was opened from the
> pool to   one of the nodes in my cluster (query that is taking x time).
> Suddenly there was a network conflict between the pool node and the
> database node and the pool change the status of the database node to
> shutdown(the node is slave). What happens to the query that runned ? What
> happens to the session that was open ?

The session will be closed. This is pretty much similar when you
directly connect to PostgreSQL.

> Will the output of the query will
> come back to the user ?

Though it really depends on the timing of failure, probably the output
of the query will not come bacl to the user in most cases.

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

______________________________ _________________
pgpool-general mailing list
pgpool-general at pgpool.net
http://www.pgpool.net/mailman/ listinfo/pgpool-general

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20180626/f5570ee1/attachment-0001.html>

More information about the pgpool-general mailing list