Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLHiT-0004Kg-3S for pgsql-admin@arkaria.postgresql.org; Tue, 30 Apr 2019 01:37:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hLHiR-0005if-N7 for pgsql-admin@arkaria.postgresql.org; Tue, 30 Apr 2019 01:37:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLHiR-0005iY-Af for pgsql-admin@lists.postgresql.org; Tue, 30 Apr 2019 01:37:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLHiP-0001G6-2W for pgsql-admin@postgresql.org; Tue, 30 Apr 2019 01:37:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3U1biNo019580; Mon, 29 Apr 2019 21:37:44 -0400 From: Tom Lane To: Simon Riggs cc: John Lumby , pgsql-admin Subject: Re: admin control over cancelling autovacuum when blocked by a lock In-reply-to: References: Comments: In-reply-to Simon Riggs message dated "Tue, 30 Apr 2019 00:15:08 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19578.1556588264.1@sss.pgh.pa.us> Date: Mon, 29 Apr 2019 21:37:44 -0400 Message-ID: <19579.1556588264@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Simon Riggs writes: > On Mon, 29 Apr 2019 at 22:02, John Lumby wrote: >> If a regular backend worker becomes blocked waiting for a lock held by an >> autovacuum worker, >> then , depending on some decision made by deadlock detector, >> the autovacuum worker may be signalled to terminate >> Is there any configuration parameter which controls this? >> including deferring or even completely eliminating this cancelling? > Why would you want this? > If the autovacuum is cancelled, it will re-execute again in the near > future, once your interrupting SQL has released locks. I think the OP is looking for the opposite, ie prevent autovacuum from being kicked off the lock. It already is resistant to that if we're doing an anti-wraparound vacuum, so maybe the simplest answer is to tighten up autovacuum_freeze_max_age. (Whether that's a good idea is a different question.) Or you could just launch a manual vacuum. regards, tom lane