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)
Loading
Please register or sign in to comment