Re: ACK from walreceiver to walsender - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: ACK from walreceiver to walsender
Date
Msg-id 4B473496.9080201@enterprisedb.com
Whole thread Raw
In response to Re: ACK from walreceiver to walsender  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: ACK from walreceiver to walsender  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Fujii Masao wrote:
> On Fri, Jan 8, 2010 at 6:39 PM, Heikki Linnakangas
> <heikki.linnakangas@enterprisedb.com> wrote:
>> There's no guarantee walreceiver will read the 'X' before trying to
>> write() to the socket, so we can't rely on that to determine whether to
>> suppress the "could not send data to client" message.
> 
> s/walreceiver/walsender?

Right.

>> We could try to read() from the socket after the write() has failed, to
>> see if there's an 'X' message pending. Not sure it's worth it. I think
>> we would have to put the socket into non-blocking mode before the
>> read(), to avoid blocking if the write() failed for some other reason.
>> Or select() to see if there's incoming data. I'm inclined to just not
>> bother..
> 
> Umm.. if no action is taken, walsender process would remain until
> it tries to write to the socket in that case. Is this OK?

Oh, I think we need to fix that, I'm thinking of doing a select() in the
loop to check that the socket hasn't been closed yet. I meant we don't
need to try reading the 'X' to tell apart e.g a network problem from a
standby that's shut down cleanly.

--  Heikki Linnakangas EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Patch: Allow substring/replace() to get/set bit values
Next
From: Tom Lane
Date:
Subject: Re: Why doesn't query_tree_walker examine the intoClause field?