[pgpool-general: 3458] Re: Questions about getting pgpool to handle failover more smoothly

Tatsuo Ishii ishii at postgresql.org
Wed Feb 4 22:04:40 JST 2015


> Hi, Tatsuo.  First and foremost, thanks so much for your work on
> pgpool-II.  I'm appreciative and impressed!
> 
> You wrote:
> 
>> I am not familiar with repmgr but I guess pgpool-II is confused by
>> being taken over the task of failover and promotion by repmgr.
>>
> 
> That's quite possible.
> 
>> To let pgpool-II properly work, you need to let pgpool-II handle
>> faiover and promotion.
> 
> Ignoring the use of repmgr (since I don't think that it's connected),
> I'm wondering whether it's normal for pgpool-II to reset existing
> connections when one of the nodes fails.  From the documentation, this
> would appear to be the case:

Yes, normal.

>>  When a failover is performed, pgpool kills all its child processes,
>>  which will in turn terminate all active sessions to pgpool. Then
>>  pgpool invokes the failover_command and waits for its
>>  completion. After this, pgpool starts new child processes and is
>>  ready again to accept connections from clients.
> 
> So it sounds like no matter how I do the replication, pgpool will
> reset all incoming sessions.  Is this the case?  And if so, why?

Suppose a client is receving SELECT results when failover happens.  It
may receive 30% of data. To continue the session after failover,
pgpool-II needs to resend the SELECT to PostgreSQL then discards 30%
of the SELECT result and continues to send the 70% of the result to
the client. This is too complicated.

The only case pgpool-II could handle is, client connects but
completely idle. This is rare case on a busy system. If the system is
not busy, then the effort to keep session even after failover is not
worth the trouble, I think.

> I know that most clients can handle a reset like this, but I'm just
> curious to know why pgpool can't continue to service the incoming
> connections, and shield the failover from the outside world.
> 
> Reuven
> 
> -- 
> Reuven M. Lerner, PhD -- Web development, consulting, and training
> Mobile: +972-54-496-8405 * US phone: 847-230-9795
> http://lerner.co.il * Skype / WeChat: ReuvenLerner * @reuvenmlerner


More information about the pgpool-general mailing list