Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W6hkw-0003V5-Da for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Jan 2014 14:29:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W6hkv-00081o-PZ for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Jan 2014 14:29:13 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W6hkt-00081f-NJ for pgsql-bugs@postgresql.org; Fri, 24 Jan 2014 14:29:11 +0000 Received: from smtprelay0134.b.hostedemail.com ([64.98.42.134] helo=smtprelay.b.hostedemail.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W6hkm-0001co-Gz for pgsql-bugs@postgresql.org; Fri, 24 Jan 2014 14:29:10 +0000 Received: from filter.hostedemail.com (b-bigip1 [10.5.19.254]) by smtprelay04.b.hostedemail.com (Postfix) with ESMTP id 97BA77B852; Fri, 24 Jan 2014 14:29:03 +0000 (UTC) X-Session-Marker: 616C76686572726540616C76682E6E6F2D69702E6F7267 X-Spam-Summary: 10, 1, 0, , d41d8cd98f00b204, alvherre@alvh.no-ip.org, :::, RULES_HIT:41:355:379:599:800:960:967:973:988:989:1260:1277:1311:1312:1313:1314:1345:1359:1437:1515:1516:1518:1519:1534:1542:1593:1594:1595:1596:1711:1730:1747:1777:1792:2393:2525:2560:2563:2682:2685:2693:2828:2859:2899:2903:2911:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3354:3865:3866:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4425:4605:4659:5007:6119:6261:7514:7903:8957:9025:9121:10007:10128:10400:10848:10967:11232:11233:11256:11257:11658:11914:12043:12438:12517:12519:12555:12679:12740:13095:13141:13230:13870:13894:13895, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:1:0 X-HE-Tag: stove03_6c11e6c51ec54 X-Filterd-Recvd-Size: 3321 Received: from eldon.alvh.no-ip.org (pc-211-245-160-190.cm.vtr.net [190.160.245.211]) (Authenticated sender: alvherre@alvh.no-ip.org) by omf04.b.hostedemail.com (Postfix) with ESMTPA; Fri, 24 Jan 2014 14:29:02 +0000 (UTC) Received: by eldon.alvh.no-ip.org (Postfix, from userid 1000) id A53341FC9; Fri, 24 Jan 2014 11:29:00 -0300 (CLST) Date: Fri, 24 Jan 2014 11:29:00 -0300 From: Alvaro Herrera To: maxim.boguk@gmail.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8954: Wrong text in database log during "truncate scan" Message-ID: <20140124142900.GZ10723@eldon.alvh.no-ip.org> References: <20140124123717.26701.48436@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140124123717.26701.48436@wrigleys.postgresql.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org maxim.boguk@gmail.com escribió: > If manual vacuum performed in the table and could not required lock for > truncate scan it wrote a bit misleading error message: > > 2014-01-24 16:19:11 MSK 7134 cron.app@*** from [local] [vxid:297/14422865 > txid:2179070646] [VACUUM] LOG: automatic vacuum of table > "hh_data.public.vacancy_response": could not (re)acquire exclusive lock for > truncate scan This was fixed by this commit: Author: Kevin Grittner Branch: master Release: REL9_3_BR [5fc893760] 2013-04-29 13:05:26 -0500 Branch: REL9_2_STABLE Release: REL9_2_5 [95909f3be] 2013-04-29 13:05:56 -0500 Branch: REL9_1_STABLE Release: REL9_1_10 [93641341f] 2013-04-29 13:06:28 -0500 Branch: REL9_0_STABLE Release: REL9_0_14 [2751c7f73] 2013-04-29 13:06:49 -0500 Ensure ANALYZE phase is not skipped because of canceled truncate. Patch b19e4250b45e91c9cbdd18d35ea6391ab5961c8d attempted to preserve existing behavior regarding statistics generation in the case that a truncation attempt was canceled due to lock conflicts. It failed to do this accurately in two regards: (1) autovacuum had previously generated statistics if the truncate attempt failed to initially get the lock rather than having started the attempt, and (2) the VACUUM ANALYZE command had always generated statistics. Both of these changes were unintended, and are reverted by this patch. On review, there seems to be consensus that the previous failure to generate statistics when the truncate was terminated was more an unfortunate consequence of how that effort was previously terminated than a feature we want to keep; so this patch generates statistics even when an autovacuum truncation attempt terminates early. Another unintended change which is kept on the basis that it is an improvement is that when a VACUUM command is truncating, it will the new heuristic for avoiding blocking other processes, rather than keeping an AccessExclusiveLock on the table for however long the truncation takes. Per multiple reports, with some renaming per patch by Jeff Janes. Backpatch to 9.0, where problem was created. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs