aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2012-08-09 17:07:03 +0100
committerSimon Riggs <simon@2ndQuadrant.com>2012-08-09 17:07:03 +0100
commitda4efa13d801ccc179f1d2c24d8a60c4a2f8ede9 (patch)
treef8ef8dc95a504fdc83ab1ef52738be6500e9eaba
parent87d8bd7c9fdc63d892968e1248e639c8078af615 (diff)
downloadpostgresql-da4efa13d801ccc179f1d2c24d8a60c4a2f8ede9.tar.gz
postgresql-da4efa13d801ccc179f1d2c24d8a60c4a2f8ede9.zip
Turn off WalSender keepalives by default, users can enable if desired
-rw-r--r--src/backend/replication/walsender.c2
-rw-r--r--src/include/replication/walsender_private.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 37a030b5f5e..38f7a3f1c36 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -837,7 +837,7 @@ WalSndLoop(void)
if (pq_is_send_pending())
wakeEvents |= WL_SOCKET_WRITEABLE;
- else
+ else if (MyWalSnd->sendKeepalive)
{
WalSndKeepalive(output_message);
/* Try to flush pending output to the client */
diff --git a/src/include/replication/walsender_private.h b/src/include/replication/walsender_private.h
index 66234cd8b59..45cd7444cdf 100644
--- a/src/include/replication/walsender_private.h
+++ b/src/include/replication/walsender_private.h
@@ -37,6 +37,7 @@ typedef struct WalSnd
XLogRecPtr sentPtr; /* WAL has been sent up to this point */
bool needreload; /* does currently-open file need to be
* reloaded? */
+ bool sendKeepalive; /* do we send keepalives on this connection? */
/*
* The xlog locations that have been written, flushed, and applied by