Re: pg_receivexlog add synchronous mode - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: pg_receivexlog add synchronous mode
Date
Msg-id CAHGQGwH2_s+YBSdqCq1p82ZTiPTxktFTDp_baD0H0eRo44FTcg@mail.gmail.com
Whole thread Raw
In response to Re: pg_receivexlog add synchronous mode  (<furuyao@pm.nttdata.co.jp>)
Responses Re: pg_receivexlog add synchronous mode  (<furuyao@pm.nttdata.co.jp>)
List pgsql-hackers
On Fri, Jun 6, 2014 at 8:05 PM,  <furuyao@pm.nttdata.co.jp> wrote:
>> -----Original Message-----
>> > > Flush is not performed every time write, it is performed
>> > > collectively like walrecever.
>> >
>> > I only glanced at this, but afaics you're only flushing at the end
>> > every WAL segment. That will result in absolutely horrible performance,
>> right?
>> > Walreceiver does flush more frequently than that. It basically syncs
>> > every chunk of received WAL...
>>
>> IMO the completion of the write loop was completion of received WAL.
>> And Walreceiver same.
>>
>> I confirm it about the flush position.
> As you say,Walreceiver does flush more frequently than that.

No. IIUC walreceiver does flush *less* frequently than what you implemented
on pg_receivexlog. Your version of pg_receivexlog tries to do flush every time
when it receives one WAL chunk. OTOH, walreceiver does flush only when
there is no extra WAL chunk in receive buffer. IOW, after writing WAL chunk,
if there is another WAL chunk that walreceiver can receive immediately, it
postpones flush later.

> However, it seems difficult to apply as same way.

Why? ISTM that's not so difficult.

Regards,

-- 
Fujii Masao



pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Why is it "JSQuery"?
Next
From: Alvaro Herrera
Date:
Subject: Re: Re: popen and pclose redefinitions causing many warning in Windows build