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

Commit47698b4

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 parent0d9fcba commit47698b4

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
@@ -1035,6 +1035,8 @@ UpdateWorkerStats(XLogRecPtr last_lsn, TimestampTz send_time, bool reply)
10351035
staticvoid
10361036
LogicalRepApplyLoop(XLogRecPtrlast_received)
10371037
{
1038+
TimestampTzlast_recv_timestamp=GetCurrentTimestamp();
1039+
10381040
/*
10391041
* Init the ApplyMessageContext which we clean up after each replication
10401042
* protocol message.
@@ -1053,7 +1055,6 @@ LogicalRepApplyLoop(XLogRecPtr last_received)
10531055
intlen;
10541056
char*buf=NULL;
10551057
boolendofstream= false;
1056-
TimestampTzlast_recv_timestamp=GetCurrentTimestamp();
10571058
boolping_sent= false;
10581059
longwait_time;
10591060

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp