Re: ACK from walreceiver to walsender

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ACK from walreceiver to walsender
Date: 2010-01-08 09:04:46
Message-ID: 3f0b79eb1001080104j3559ae5cp87e4ae78fd1115f8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 8, 2010 at 5:55 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> Fujii Masao wrote:
>> Hi Heikki,
>>
>> http://git.postgresql.org/gitweb?p=users/heikki/postgres.git;a=commit;h=ebaa89ce8906e0ec45f105d083a0360b1f8bc7ca
>>
>> You dropped all the ACKs from walreceiver to walsender. I have no objection
>> to that, but I think that walsender should handle at least 'X' (which means
>> that the standby is closing down the socket) and EOF (which means unexpected
>> loss of standby connection) messages from walreceiver. Otherwise, walsender
>> might be unable to detect the shutdown of walreceiver for a while.
>
> Yeah, I just noticed that myself :-(. I guess we'll still have to use
> select() in the walreceiver loop to detect that then.
>
> I don't think we need to treat 'X' differently from EOF. You get an
> error anyway if the write() fails. That's actually a bit annoying, you
> get a "could not send data to client" error in the log every time a
> standby disconnects for any reason.

Yes. And, when walreceiver exits, it sends 'X' message by calling PQfinish().
So I think it's neater for walsender to treat also 'X'. Thought?

Regards,

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2010-01-08 09:05:51 Re: damage control mode
Previous Message Magnus Hagander 2010-01-08 09:03:19 Re: Add .gitignore files to CVS?