Re: CDC/ETL system on top of logical replication with pgoutput, custom client

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: CDC/ETL system on top of logical replication with pgoutput, custom client
Дата
Msg-id CAExHW5sq5SzG4qNmipZwx8kKYaAOBrh7B3ASkFOAG=Fghc7r4w@mail.gmail.com
обсуждение исходный текст
Ответ на RE: CDC/ETL system on top of logical replication with pgoutput, custom client  (José Neves <rafaneves3@msn.com>)
Список pgsql-hackers
On Wed, Oct 25, 2023 at 4:23 PM José Neves <rafaneves3@msn.com> wrote:
>
> Ok, I see. In that situation is safe indeed, as the offset is lower than the current transaction commit.
> But I think that I asked the wrong question. I guess that the right question is: Can we receive a keep-alive message
withan LSN offset bigger than the commit of the open or following transactions? 
> Something like:
>
> BEGIN LSN001
> INSERT LSN002
> KEEP LIVE LSN006
> UPDATE LSN004
> COMMIT LSN005
>
> Or:
>
> KEEP LIVE LSN006
> BEGIN LSN001
> INSERT LSN002
> UPDATE LSN004
> COMMIT LSN005
> KEEP LIVE LSN007
>

AFAIU the code in walsender this isn't possible. Keep alive sends the
LSN of the last WAL record it read (sentPtr). Upon reading a commit
WAL record, the whole transaction is decoded. Till that point sentPtr
is not updated.

Please take a look at XLogSendLogical(void) and the places where
WalSndKeepaliveIfNecessary() is called.

--
Best Wishes,
Ashutosh Bapat



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

Предыдущее
От: "a.rybakina"
Дата:
Сообщение: Re: POC, WIP: OR-clause support for indexes
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: ResourceOwner refactoring