Re: [HACKERS] remote_apply for logical replication?

Поиск
Список
Период
Сортировка
От Petr Jelinek
Тема Re: [HACKERS] remote_apply for logical replication?
Дата
Msg-id f453caad-0396-1bdd-c5c1-5094371f4776@2ndquadrant.com
обсуждение исходный текст
Ответ на [HACKERS] remote_apply for logical replication?  (Thomas Munro <thomas.munro@enterprisedb.com>)
Ответы Re: [HACKERS] remote_apply for logical replication?  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-hackers
On 21/01/17 01:34, Thomas Munro wrote:
> Hi,
> 
> In src/backend/replication/logical/worker.c:
> 
>     pq_sendbyte(reply_message, 'r');
>     pq_sendint64(reply_message, recvpos);       /* write */
>     pq_sendint64(reply_message, flushpos);      /* flush */
>     pq_sendint64(reply_message, writepos);      /* apply */
> 
> Is 'writepos' really applied?  Why do we report the merely received
> position as written?
> 

Because we don't have intermediate steps in logical replication, writes
happen immediately and in whole transactions so whatever was received by
the time we send reply is already written (it might not necessarily be
that way forever so the code may become more complicated eventually).

> I haven't tried any of this stuff out yet so this may be a stupid
> question, but I'm wondering: should xinfo &
> XACT_COMPLETION_APPLY_FEEDBACK trigger logical replication to send a
> reply, so that synchronous_commit = remote_apply would work?
> 

In fact everything is remote_apply in logical replication for same
reason described above. The differences can only happen when the
subscription is running with synchronous_commit = off where flush
position is behind. The xinfo & XACT_COMPLETION_APPLY_FEEDBACK does not
affect logical replication though as it does not have access to that
information (subscriber does not receive raw WAL and logical decoding
does not decode this).

--  Petr Jelinek                  http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [HACKERS] Checksums by default?
Следующее
От: Petr Jelinek
Дата:
Сообщение: Re: [HACKERS] Checksums by default?