Re: Replication server timeout patch

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Replication server timeout patch
Date: 2011-03-23 10:33:05
Message-ID: 4D89CC61.3000206@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 16.03.2011 11:11, Fujii Masao wrote:
> On Wed, Mar 16, 2011 at 4:49 PM, Fujii Masao<masao(dot)fujii(at)gmail(dot)com> wrote:
>> Agreed. I'll change the patch.
>
> Done. I attached the updated patch.

I don't much like the API for this. Walsender shouldn't need to know
about the details of the FE/BE protocol, pq_putbytes_if_available()
seems too low level to be useful.

I think a better API would be to have a non-blocking version of
pq_putmessage(). We can make the output buffer in pqcomm.c resizeable,
so that when the message doesn't fit in the output buffer in
pq_putmessage(), the buffer is enlarged instead of trying to flush it.

Attached is a patch using that approach. This is a much smaller patch,
and easier to understand. I'm not totally happy with the walsender main
loop, it seems to work as it is, but the logic has become quite
complicated. Ideas welcome on how to simplify that.

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

Attachment Content-Type Size
replication_timeout_v7.patch text/x-diff 23.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-03-23 11:07:50 Re: writing a script to examine dead tuples
Previous Message Marti Raudsepp 2011-03-23 10:13:41 Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL