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

From Tom Lane
Subject Re: "caught_up" status in walsender
Date
Msg-id 23830.1275572839@sss.pgh.pa.us
Whole thread Raw
In response to Re: "caught_up" status in walsender  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Fujii Masao <masao.fujii@gmail.com> writes:
> On Thu, Jun 3, 2010 at 4:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
>>> 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.

> For reducing the workload of walsender?

> This seems OK in 9.0 since only asynchronous replication is supported.
> But when we'll implement synchronous replication in the future, we
> might have to revert that change. Since a transaction commit might wait
> for such an extra record to be replicated, walsender should aggressively
> send all sendable WAL.

It *is* aggressively sending all sendable WAL.  The ideal steady state
behavior of this loop ought to be that once per sleep interval, we send
out one record containing all new WAL since the last time.   We do not
want it sending 10000 bytes, then another record with 100 bytes, then
another record with 10 bytes, etc etc.  That's inefficient and
ultimately pointless.  You'll always be behind again a millisecond
later.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Gnanakumar"
Date:
Subject: PITR Recovery Question
Next
From: Bruce Momjian
Date:
Subject: Re: Allow wal_keep_segments to keep all segments