Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id AD1CF1337BDE for ; Mon, 28 Mar 2011 20:56:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 68725-07 for ; Mon, 28 Mar 2011 23:55:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm17.bullet.mail.ne1.yahoo.com (nm17.bullet.mail.ne1.yahoo.com [98.138.90.80]) by mail.postgresql.org (Postfix) with SMTP id C91481337BDB for ; Mon, 28 Mar 2011 20:55:57 -0300 (ADT) Received: from [98.138.90.56] by nm17.bullet.mail.ne1.yahoo.com with NNFMP; 28 Mar 2011 23:55:57 -0000 Received: from [98.138.84.45] by tm9.bullet.mail.ne1.yahoo.com with NNFMP; 28 Mar 2011 23:55:57 -0000 Received: from [127.0.0.1] by smtp113.mail.ne1.yahoo.com with NNFMP; 28 Mar 2011 23:55:57 -0000 X-Yahoo-Newman-Id: 543956.84856.bm@smtp113.mail.ne1.yahoo.com Received: from [172.21.8.23] (JanWieck@96.245.17.181 with plain) by smtp113.mail.ne1.yahoo.com with SMTP; 28 Mar 2011 16:55:57 -0700 PDT X-Yahoo-SMTP: auMih2KswBAUyVy7YHrIeglmGa00 X-YMail-OSG: mm_u7OwVM1llqU.6IDGwEVSOF3oCKwDb2CEdkcjY5iwiNXd _BAUh2s0jAH2l_h8YXM.XnGMOfPNDCfHNVjpzk3IKzNt3wDvKN3jg54LAbd2 ijggMB6uy6hjbAebtgo5lsi33x7AfadqcdY.Lq8NZocbtL18ZMkpCbXk.bmy K9IC9ELBc3wuh_Q4LZzdHZuPA6mYvrg0r_ejaI_iVvnU4Hqbv5feRbq7XChq RstFekxItFSQQ1ACEkBrMUljWtuUc5yuNgSDPnkHfTl_56DlFEvCx7gWVhoV tOv_s3_61z7a3YMNymiCi0_sEbo2xcL81IvjjWl3M3Y9px7ip7NJqz0o8s.1 dgD_InLvX62RwgsMZBnDfyw-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4D91200D.4020005@Yahoo.com> Date: Mon, 28 Mar 2011 19:55:57 -0400 From: Jan Wieck User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Tom Lane CC: Christopher Browne , Robert Haas , pgsql-bugs Subject: Re: BUG #5946: Long exclusive lock taken by vacuum (not full) References: <201103250856.p2P8ufGc004544@wwwmaster.postgresql.org> <4345.1301066239@sss.pgh.pa.us> <13556.1301069421@sss.pgh.pa.us> <1301080686-sup-7539@alvh.no-ip.org> <15329.1301082238@sss.pgh.pa.us> <16028.1301086103@sss.pgh.pa.us> <18898.1301286552@sss.pgh.pa.us> <28594.1301342493@sss.pgh.pa.us> In-Reply-To: <28594.1301342493@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/370 X-Sequence-Number: 29880 On 3/28/2011 4:01 PM, Tom Lane wrote: > Christopher Browne writes: >> - Grab timestamp >> - Grab exclusive lock >> - Process [Some number of pages] >> - Check time. >> - If [# of ms] have passed then check to see if anyone else has a lock >> O/S on the table. >> - Commit& give up the lock for a bit if they do >> - Go back and process more pages if they don't > > Actually, we could simplify that even further. Keep the code exactly > as-is, but every small-number-of-pages, check to see if someone is > waiting on a conflicting lock, and if so, fall out of the page checking > loop. Truncate away however many pages we know at that time are safe, > and end the vacuum normally. > > We'd have to rejigger the stuff in the lock manager that tries to boot > autovacuum off the lock forcibly, but with a bit of luck that would get > less crocky not more so. I somehow fail to see how this complete reversal of who does what and affecting code in entirely different parts of the system will qualify for patching back releases. Jan -- Anyone who trades liberty for security deserves neither liberty nor security. -- Benjamin Franklin