[Pgpool-hackers] retry of health check

Fujii Masao masao.fujii at gmail.com
Thu Mar 11 09:30:44 UTC 2010


On Thu, Mar 11, 2010 at 9:44 AM, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
>> > Hmm.. in HEAD, 'E' is returned first in that case. Which version of
>> > postgres returns 'R' first? Its behavior might depend on the version.
>>
>> 8.4. Will check CVS HEAD.
>
> You are right. CVS HEAD sends 'E' first(see below). Looks like someone
> changed this part between 8.4 and CVS HEAD. This is good because
> previous behavior was wrong IMO. Problem is, how to dealth with those
> different behaviors. Probably the safest way is, after sending start
> up packet to backend, read reply packet as many as possible, Then scan
> the packet looking for 'E' message. Thoughts?

Umm.. the problem is that the returned 'R' might indicate the message
other than AuthenticationOk. In this case, since the backend waits for
the authentication information (e.g., password) before checking the
existence of the specified database, pgpool would never see the 'E'.
Then the backend doesn't accept the 'X' correctly (since it waits for
the authentication information itself), so pgpool should just close
the connection without sending the 'X'.

On the other hand, if the returned 'R' indicates AuthenticationOk,
pgpool should try to read the message from the backend until the
ReadyForQuery arrives. Only if pgpool doesn't see the 'E' on the way,
it should try to send the 'X'.

Of course, the above suggestion is complicated, so I'm leaning towards
not changing the existing behavior and revisiting this topic later.

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


More information about the Pgpool-hackers mailing list