Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayiTh-0003gl-Np for pgsql-admin@arkaria.postgresql.org; Fri, 06 May 2016 16:19:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ayiTh-0000Gd-97 for pgsql-admin@arkaria.postgresql.org; Fri, 06 May 2016 16:19:45 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ayiTg-0000GW-Nv for pgsql-admin@postgresql.org; Fri, 06 May 2016 16:19:44 +0000 Received: from out.smtp-auth.no-ip.com ([8.23.224.60]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1ayiTZ-0005mo-0d for pgsql-admin@postgresql.org; Fri, 06 May 2016 16:19:43 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [216.155.90.98]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id EB5BB4001A9; Fri, 6 May 2016 09:19:34 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 81238419; Fri, 6 May 2016 13:19:32 -0300 (CLST) Date: Fri, 6 May 2016 13:19:32 -0300 From: Alvaro Herrera To: Tom Lane Cc: =?utf-8?B?T25kxZllaiBTdsSbdGzDrWs=?= , pgsql-admin@postgresql.org Subject: Re: Autovacuum of pg_database Message-ID: <20160506161932.GA216183@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5087.1462551227@sss.pgh.pa.us> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Tom Lane wrote: > Alvaro Herrera writes: > > Tom Lane wrote: > >> I think it's pretty obvious: autovacuum.c's rule for detecting whether > >> some other worker is already processing table X is wrong when X is a > >> shared table. I propose the attached patch. > > > Hmm, I have pretty much the same patch, except I added the flag to > > struct autovac_table and have it populated by table_recheck_autovac. > > Haven't tested this yet, which is why I hadn't posted it. > > Actually, I realized after looking at it that the new wi_tableshared > field is unnecessary in my patch. The only important part is that > knowledge of relisshared be available when we're looking for conflicting > workers, and that is entirely local in do_autovacuum(). I'd started the > patch by adding wi_tableshared, on the expectation that it would be > necessary, but it ain't ... OK, if I understand you correctly then that is what my patch does -- the "sharedrel" flag in my patch is only inside do_autovacuum. Do you already have a test rig for this? If not, I can set one up so that I can push the patch hopefully later today. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin