Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fcxWZ-0000Zk-7B for pgsql-general@arkaria.postgresql.org; Tue, 10 Jul 2018 18:38:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fcxWX-0006Vv-Bk for pgsql-general@arkaria.postgresql.org; Tue, 10 Jul 2018 18:38:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fcxWX-0006Vo-4P for pgsql-general@lists.postgresql.org; Tue, 10 Jul 2018 18:38:05 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fcxWS-0005Wk-H0 for pgsql-general@lists.postgresql.org; Tue, 10 Jul 2018 18:38:04 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4B74A21B0E for ; Tue, 10 Jul 2018 14:37:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 10 Jul 2018 14:37:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=cowZziMl6h5eI0M/EQgsY2Y8/V5iyyVdYRzzdYQR434=; b=WLCYv8vW mrfhkLFRl81b65Ag/MJWGOrPfFpMOFXnncKDTnQgKvDjgBD/vkRlbm1n44wupTJA GICTRoJ4CFUDkDv5JU78zemSjuMKu4xyAzB2E5pdvXq7mR9+GRQnTgPfZzKc788a Fvy304mBWSkpZmODkVJmPSwil60aqbNF1LgIF549CFd5mPX3N+FIiykhyfDgyKwB EXKs+DMCALdHxrKHMirtoJg80ck6XQoEq5FNMy7uvfXLsHOSn2bD1elJ2n796aB+ vRXL4RfSZaWnapo8/2wSHtHq+PiZJA9ix1YGp+X9BcVvEhJDuWfRFQW/nCpJ8LYb u1w6pp+iwSCUfw== X-ME-Proxy: X-ME-Sender: Received: from fll1000539l-2.local (unknown [45.73.149.202]) by mail.messagingengine.com (Postfix) with ESMTPA id C9326E4686 for ; Tue, 10 Jul 2018 14:37:57 -0400 (EDT) To: pgsql-general@lists.postgresql.org From: Patrick Hemmer Subject: max_standby_streaming_delay not enforced Openpgp: preference=signencrypt Message-ID: Date: Tue, 10 Jul 2018 14:37:57 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------DD423E81ADA49FDE13A67D99" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------DD423E81ADA49FDE13A67D99 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit I ran into an issue the other day on one of my database clusters where it appears a replica had a transaction open for almost 24 hours. This was causing stale data on the replica (as observed by queries against the db), as well as tuple bloat on the master (due to `hot_standby_feedback=on` and vacuum not cleaning them up). The part that is confusing me is that I have `max_standby_streaming_delay=30s`, and from all the documentation I can find, this should have resulted in the transaction being killed. The replica has since been restarted, so I cannot gather any information about current state. However I have monitoring and logging on many of the postgres stats, so I might be able to retrieve some information if requested. I have also tried reproducing the issue in a lab, but have so far been unable to. Are there any scenarios where a replica might still delay replaying the transaction log past the value configured in `max_standby_streaming_delay`? For version information, I am running PostgreSQL 9.6.3 on CentOS/7 -Patrick --------------DD423E81ADA49FDE13A67D99 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit I ran into an issue the other day on one of my database clusters where it appears a replica had a transaction open for almost 24 hours. This was causing stale data on the replica (as observed by queries against the db), as well as tuple bloat on the master (due to `hot_standby_feedback=on` and vacuum not cleaning them up).
The part that is confusing me is that I have `max_standby_streaming_delay=30s`, and from all the documentation I can find, this should have resulted in the transaction being killed.

The replica has since been restarted, so I cannot gather any information about current state. However I have monitoring and logging on many of the postgres stats, so I might be able to retrieve some information if requested.
I have also tried reproducing the issue in a lab, but have so far been unable to.

Are there any scenarios where a replica might still delay replaying the transaction log past the value configured in `max_standby_streaming_delay`?

For version information, I am running PostgreSQL 9.6.3 on CentOS/7

-Patrick
--------------DD423E81ADA49FDE13A67D99--