Skip to content
Snippets Groups Projects
Commit 0e4eacb4 authored by Serge Petrenko's avatar Serge Petrenko Committed by Kirill Yukhin
Browse files

relay: send heartbeats while reading a WAL

As soon as replica subscribes, relay starts scanning the first requested
WAL file to find the position from which to start replication. While the
scan is in progress, relay never sends heartbeats to the replica, so a
really long scan can make the replica timeout before relay finally finds
the point to replicate from.

Two similar problems were already addressed in
30ad4a55 ("relay: yield explicitly every N sent rows") and
17289440 ("recovery: make it yield when positioning in a WAL")

These patches do not fix the issue completely for relay: even though now
it yields while scanning a WAL, it doesn't send heartbeats anyway.

Fix the issue by not only yielding, but sending heartbeats as well while
WAL scan is in progress.

Follow-up #5979
Closes #6706

(cherry-picked from ee6de025)
parent ae766d85
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment