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

Commit3f60f69

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 parent38ddeab commit3f60f69

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
@@ -1089,6 +1089,8 @@ UpdateWorkerStats(XLogRecPtr last_lsn, TimestampTz send_time, bool reply)
10891089
staticvoid
10901090
LogicalRepApplyLoop(XLogRecPtrlast_received)
10911091
{
1092+
TimestampTzlast_recv_timestamp=GetCurrentTimestamp();
1093+
10921094
/*
10931095
* Init the ApplyMessageContext which we clean up after each replication
10941096
* protocol message.
@@ -1107,7 +1109,6 @@ LogicalRepApplyLoop(XLogRecPtr last_received)
11071109
intlen;
11081110
char*buf=NULL;
11091111
boolendofstream= false;
1110-
TimestampTzlast_recv_timestamp=GetCurrentTimestamp();
11111112
boolping_sent= false;
11121113
longwait_time;
11131114

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp