]> granicus.if.org Git - postgresql/commitdiff
Turn off WalSender keepalives by default, users can enable if desired
authorSimon Riggs <simon@2ndQuadrant.com>
Thu, 9 Aug 2012 16:06:47 +0000 (17:06 +0100)
committerSimon Riggs <simon@2ndQuadrant.com>
Thu, 9 Aug 2012 16:06:47 +0000 (17:06 +0100)
src/backend/replication/walsender.c
src/include/replication/walsender_private.h

index 53e134538f4d98a83903a8c209727296f92ddd99..3f060b82c09c0df3bf183f0cf90b160dd6adc426 100644 (file)
@@ -834,7 +834,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 */
index 66234cd8b5925d81b535522983fdc75da1d40c75..45cd7444cdfc8558bf86e7afe275d721ee95b245 100644 (file)
@@ -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