Re: Streaming replication and non-blocking I/O

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: Streaming replication and non-blocking I/O
Дата
Msg-id 3f0b79eb0912131820y253f6878r5990d643fee8a95b@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Streaming replication and non-blocking I/O  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Streaming replication and non-blocking I/O  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sun, Dec 13, 2009 at 5:42 AM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> Walreceiver wants to wait for data to arrive from the master or a
> signal. PQgetXLogData(), which is the libpq function to read a piece of
> WAL, takes a timeout argument to support that. Walreceiver calls
> PQgetXLogData() in an endless loop, checking for a received sighup or
> death of postmaster at every iteration.
>
> In the synchronous replication mode, I presume it's also going to listen
> for a signal from the startup process, so that it can send a
> acknowledgment to the master as soon as a COMMIT record has been
> replayed that a backend on the master is waiting for.

Right.

> To implement the timeout in PQgetXLogData(), pqWaitTimed() was changed
> to take a timeout instead of finishing_time argument. Which is a mistake
> because it breaks PQconnectdb, and as I said I don't think
> PQgetXLogData(9 should have a timeout argument to begin with. Instead,
> it should have a boolean 'async' argument to return immediately if
> there's no data, and walreceiver main loop should call poll()/select()
> to wait. Ie. just like PQgetCopyData() works.

Seems good. I'll revise the code.

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: EXPLAIN BUFFERS
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Streaming replication and non-blocking I/O