pgsql: Fix the logical replication timeout during large transactions.

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема pgsql: Fix the logical replication timeout during large transactions.
Дата
Msg-id E1nofFa-0007fq-Qu@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix the logical replication timeout during large transactions.

The problem is that we don't send keep-alive messages for a long time
while processing large transactions during logical replication where we
don't send any data of such transactions. This can happen when the table
modified in the transaction is not published or because all the changes
got filtered. We do try to send the keep_alive if necessary at the end of
the transaction (via WalSndWriteData()) but by that time the
subscriber-side can timeout and exit.

To fix this we try to send the keepalive message if required after
processing certain threshold of changes.

Reported-by: Fabrice Chapuis
Author: Wang wei and Amit Kapila
Reviewed By: Masahiko Sawada, Euler Taveira, Hou Zhijie, Hayato Kuroda
Backpatch-through: 10
Discussion: https://postgr.es/m/CAA5-nLARN7-3SLU_QUxfy510pmrYK6JJb=bk3hcgemAM_pAv+w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f95d53eded55ecbf037f6416ced6af29a2c3caca

Modified Files
--------------
src/backend/replication/logical/logical.c   | 27 +++++++++++++++
src/backend/replication/pgoutput/pgoutput.c | 54 +++++++++++++++++++++++++----
src/backend/replication/walsender.c         | 24 +++++++++++--
src/include/replication/logical.h           |  2 ++
4 files changed, 98 insertions(+), 9 deletions(-)


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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: pgsql: Silence extra logging when using "postgres -C" on runtime-comput
Следующее
От: Thomas Munro
Дата:
Сообщение: pgsql: Add logging for excessive ProcSignalBarrier waits.