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

From
Subject Re: pg_receivexlog add synchronous mode
Date
Msg-id A9C510524E235E44AE909CD4027AE196BAAA06D7E6@MBX-MSG-SV03.msg.nttdata.co.jp
Whole thread Raw
In response to Re: pg_receivexlog add synchronous mode  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: pg_receivexlog add synchronous mode  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
> 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.

I was not able to understand movement of walreceiver well.
While walreceiver writes data, do PQconsumeInput() by omitting the select().
Do flush if the PQgetCopyData has been to return the zero continuously.
Fixed to the same process using the flag.

Regards,

-- 
Furuya Osamu


Attachment

pgsql-hackers by date:

Previous
From: b8flowerfire
Date:
Subject: Re: why postgresql define NTUP_PER_BUCKET as 10, not other numbers smaller
Next
From: Hannu Krosing
Date:
Subject: Re: "RETURNING PRIMARY KEY" syntax extension