Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfeed5ee

Browse files
committed
Fix timeout handling in logical replication worker
The timestamp tracking the last moment a message is received in alogical replication worker was initialized in each loop checking if amessage was received or not, causing wal_receiver_timeout to be ignoredin basically any logical replication deployments. This also broke theping sent to the server when reaching half of wal_receiver_timeout.This simply moves the initialization of the timestamp out of the applyloop to the beginning of LogicalRepApplyLoop().Reported-by: Jehan-Guillaume De RorthaisAuthor: Julien RouhaudDiscussion:https://postgr.es/m/CAOBaU_ZHESFcWva8jLjtZdCLspMj7vqaB2k++rjHLY897ZxbYw@mail.gmail.comBackpatch-through: 10
1 parent45e4067 commitfeed5ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/replication/logical/worker.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,8 @@ UpdateWorkerStats(XLogRecPtr last_lsn, TimestampTz send_time, bool reply)
11031103
staticvoid
11041104
LogicalRepApplyLoop(XLogRecPtrlast_received)
11051105
{
1106+
TimestampTzlast_recv_timestamp=GetCurrentTimestamp();
1107+
11061108
/*
11071109
* Init the ApplyMessageContext which we clean up after each replication
11081110
* protocol message.
@@ -1121,7 +1123,6 @@ LogicalRepApplyLoop(XLogRecPtr last_received)
11211123
intlen;
11221124
char*buf=NULL;
11231125
boolendofstream= false;
1124-
TimestampTzlast_recv_timestamp=GetCurrentTimestamp();
11251126
boolping_sent= false;
11261127
longwait_time;
11271128

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp