aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/replication/walsender.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 318979342eb..844a5dea1de 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -1203,9 +1203,11 @@ WalSndWaitForWal(XLogRecPtr loc)
* possibly are waiting for a later location. So we send pings
* containing the flush location every now and then.
*/
- if (MyWalSnd->flush < sentPtr && !waiting_for_ping_response)
+ if (MyWalSnd->flush < sentPtr &&
+ MyWalSnd->write < sentPtr &&
+ !waiting_for_ping_response)
{
- WalSndKeepalive(true);
+ WalSndKeepalive(false);
waiting_for_ping_response = true;
}