Re: pg_receivexlog add synchronous mode

From: <furuyao(at)pm(dot)nttdata(dot)co(dot)jp>
To: <masao(dot)fujii(at)gmail(dot)com>
Cc: <andres(at)2ndquadrant(dot)com>, <pgsql-hackers(at)postgresql(dot)org>, <teranishih(at)nttdata(dot)co(dot)jp>
Subject: Re: pg_receivexlog add synchronous mode
Date: 2014-06-10 08:01:47
Message-ID: A9C510524E235E44AE909CD4027AE196BAAA06D7E6@MBX-MSG-SV03.msg.nttdata.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
pg_receivexlog-add-synchronous-mode-v3.patch application/octet-stream 11.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2014-06-10 08:19:34 Re: "RETURNING PRIMARY KEY" syntax extension
Previous Message b8flowerfire 2014-06-10 05:13:08 Re: why postgresql define NTUP_PER_BUCKET as 10, not other numbers smaller