X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 0A00B9FA195 for ; Thu, 14 Sep 2006 18:57:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 96390-02 for ; Thu, 14 Sep 2006 18:57:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from servata.com (ip-216-152-249-241.servata.com [216.152.249.241]) by postgresql.org (Postfix) with ESMTP id 2ECBF9FA15C for ; Thu, 14 Sep 2006 18:57:43 -0300 (ADT) Received: from [209.162.219.253] (helo=dogma.v10.wvs) by servata.com with esmtpa (Exim 4.50) id 1GNzD1-0003cP-P9; Thu, 14 Sep 2006 14:57:23 -0700 Subject: Re: [ADMIN] Vacuum error on database postgres From: Jeff Davis To: Tom Lane Cc: andy , Alvaro Herrera , pgsql-hackers@postgreSQL.org In-Reply-To: <29469.1158247230@sss.pgh.pa.us> References: <44F82150.5000809@pnlassociates.com> <4001.1157121669@sss.pgh.pa.us> <27602.1158238299@sss.pgh.pa.us> <45095CDD.8090704@squeakycode.net> <29469.1158247230@sss.pgh.pa.us> Content-Type: text/plain Date: Thu, 14 Sep 2006 14:57:25 -0700 Message-Id: <1158271045.29889.143.camel@dogma.v10.wvs> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 (2.0.4-7) Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.235 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, SPF_HELO_PASS X-Spam-Level: X-Archive-Number: 200609/1190 X-Sequence-Number: 90719 On Thu, 2006-09-14 at 11:20 -0400, Tom Lane wrote: > andy writes: > > Tom Lane wrote: > >> andy writes: > This behavior dates from a time when there was no good alternative. > One possible fix today would be to make ANALYZE take > ShareUpdateExclusive lock instead, thus ensuring there is only one > ANALYZE at a time on a table. However I'm a bit concerned by the > possibility that ANALYZE-inside-a-transaction could accumulate a > whole bunch of such locks in a random order, leading at least to > a risk of deadlocks against other ANALYZEs. (We have to hold the > lock till commit, else we aren't fixing the problem.) Do we need a > specialized lock type just for ANALYZE? Would sorting the target > list of rel OIDs be enough? Perhaps it's not worth worrying about? > How would creating a new lock type avoid deadlocks when an ANALYZE is accumulating the locks in random order? Regards, Jeff Davis