summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAmit Kapila2022-05-11 05:11:24 +0000
committerAmit Kapila2022-05-11 05:11:24 +0000
commit55558df2374167af38534df988ec3b9d0b0019f0 (patch)
treebc24f74a12194ff6b3467152e9911d83c468c77e /src/include
parentb9d70ef34b833fd63e3ff9f049dbbcdfda9dc9fe (diff)
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
Diffstat (limited to 'src/include')
-rw-r--r--src/include/replication/logical.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/replication/logical.h b/src/include/replication/logical.h
index c2f2475e5d3..14d71fd1365 100644
--- a/src/include/replication/logical.h
+++ b/src/include/replication/logical.h
@@ -49,6 +49,9 @@ typedef struct LogicalDecodingContext
*/
bool fast_forward;
+ /* Are we processing the end LSN of a transaction? */
+ bool end_xact;
+
OutputPluginCallbacks callbacks;
OutputPluginOptions options;