Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0opw-0000jy-2v for pgsql-admin@arkaria.postgresql.org; Mon, 13 Jun 2022 18:30:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o0opu-0005cU-Pq for pgsql-admin@arkaria.postgresql.org; Mon, 13 Jun 2022 18:30:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0opu-0005cL-FG for pgsql-admin@lists.postgresql.org; Mon, 13 Jun 2022 18:30:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0ops-0002tg-03 for pgsql-admin@lists.postgresql.org; Mon, 13 Jun 2022 18:30:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 25DIUi4W3897575; Mon, 13 Jun 2022 14:30:44 -0400 From: Tom Lane To: Nikhil Shetty cc: Pgsql-admin Subject: Re: Recovery conflict due to buffer pins In-reply-to: References: Comments: In-reply-to Nikhil Shetty message dated "Mon, 13 Jun 2022 23:35:35 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3897573.1655145044.1@sss.pgh.pa.us> Date: Mon, 13 Jun 2022 14:30:44 -0400 Message-ID: <3897574.1655145044@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nikhil Shetty writes: > 2022-06-12 04:30:01 UTC [3324]: [3-1] > user=,db=postgres,app=,client=127.0.0.1ERROR: canceling > statement due to *conflict with recovery* > 04:30:01 UTC [3324]: [4-1] > user=,db=postgres,app=,client=127.0.0.1DETAIL: User was holding > shared buffer pin for too long. > We have set below parameters in standby > hot_standby_feedback = on > max_standby_streaming_delay = 0 > How can we avoid this error on standby? Use a larger max_standby_streaming_delay. Setting it to zero means precisely that conflicting queries will be canceled immediately. regards, tom lane