Re: walsender doesn't send keepalives when writes are pending - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: walsender doesn't send keepalives when writes are pending
Date
Msg-id 5318D123.6080707@vmware.com
Whole thread Raw
In response to Re: walsender doesn't send keepalives when writes are pending  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
On 03/05/2014 10:57 PM, Andres Freund wrote:
> On 2014-03-05 18:26:13 +0200, Heikki Linnakangas wrote:
>> The logic was the same before the patch, but I added the XXX comment above.
>> Why do we sleep in increments of 1/10 of wal_sender_timeout? Originally, the
>> code calculated when the next wakeup should happen, by adding
>> wal_sender_timeout (or replication_timeout, as it was called back then) to
>> the time of the last reply. Why don't we do that?
>> [ archeology ]
>
> It imo makes sense to wakeup after last_reply + wal_sender_timeout/2, so
> a requested reply actually has time to arrive, but otherwise I agree.
>
> I think your patch makes sense. Additionally imo the timeout checking
> should be moved outside the if (caughtup || pq_is_send_pending()), but
> that's probably a separate patch.
>
> Any chance you could apply your patch soon? I've a patch pending that'll
> surely conflict with this and it seems better to fix it first.

Ok, pushed. I left the polling-style sleep in place for now.

Thanks!

- Heikki



pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: GSoC proposal - "make an unlogged table logged"
Next
From: Fabrízio de Royes Mello
Date:
Subject: Re: GSoC proposal - "make an unlogged table logged"