Re: server log inflates due to pg_logical_slot_peek_changes/pg_logical_slot_get_changes calls

Поиск
Список
Период
Сортировка
От Jeevan Ladhe
Тема Re: server log inflates due to pg_logical_slot_peek_changes/pg_logical_slot_get_changes calls
Дата
Msg-id CANm22Cg6daAozpAOMguGkoG5mhzzwf9CFoPXgek6e8tod2LSww@mail.gmail.com
обсуждение исходный текст
Ответ на Re: server log inflates due to pg_logical_slot_peek_changes/pg_logical_slot_get_changes calls  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Список pgsql-hackers
Thanks, Ashutosh for the reply.

I think those messages are useful when debugging logical replication
problems (imagine missing transaction or inconsistent data between
publisher and subscriber). I don't think pg_logical_slot_get_changes()
or pg_logical_slot_peek_changes() are expected to be called frequently
in a loop.

Yeah right. But can you please shed some light on when these functions
should be called, or are they used only for testing purposes?

Instead you should open a replication connection to
continue to receive logical changes ... forever.

Yes, this is what I have decided to resort to now.

Why do you need to call pg_logical_slot_peek_changes() and
pg_logical_slot_get_changes() frequently?

I was just playing around to do something for logical replication and thought
of doing this quick test where every time interval I read using
pg_logical_slot_peek_changes(), make sure to consume them to a consistent
state, and only then use pg_logical_slot_get_changes() to advance the slot.

Regards,
Jeevan Ladhe

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: logical decoding and replication of sequences, take 2
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: logical decoding and replication of sequences, take 2