Re: "caught_up" status in walsender - Mailing list pgsql-hackers

From Tom Lane
Subject Re: "caught_up" status in walsender
Date
Msg-id 10535.1275506496@sss.pgh.pa.us
Whole thread Raw
In response to Re: "caught_up" status in walsender  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: "caught_up" status in walsender
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> On 02/06/10 21:44, Tom Lane wrote:
>> In the current coding, the effect of not setting *caughtup here is just
>> that we uselessly call XLogSend an extra time for each transmission
>> (because the main loop won't ever delay immediately after a
>> transmission).  But without this, we'd never send caughtup = true
>> to the slave.

> That's intentional. It could take some time for the WAL to be sent, if 
> the network is busy, so by the time XLogSend returns you might well not 
> be caught up anymore.

It may have been intentional, but it's still wrong.  If you were able to
pull all of WAL into the record-to-be-sent, you should sleep afterwards,
not send an extra record containing a few more bytes.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: "caught_up" status in walsender
Next
From: Bruce Momjian
Date:
Subject: Allow wal_keep_segments to keep all segments