Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XyPTA-0004Fb-BD for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Dec 2014 18:25:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XyPT9-0001Yu-LO for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Dec 2014 18:25:07 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XyPT8-0001XW-IA for pgsql-bugs@postgresql.org; Tue, 09 Dec 2014 18:25:06 +0000 Received: from smtprelay0202.b.hostedemail.com ([64.98.42.202] helo=smtprelay.b.hostedemail.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XyPSz-00053n-Ps for pgsql-bugs@postgresql.org; Tue, 09 Dec 2014 18:25:04 +0000 Received: from filter.hostedemail.com (b-bigip1 [10.5.19.254]) by smtprelay03.b.hostedemail.com (Postfix) with ESMTP id 9A9471A740B; Tue, 9 Dec 2014 18:24:56 +0000 (UTC) X-Session-Marker: 616C76686572726540616C76682E6E6F2D69702E6F7267 X-Spam-Summary: 50, 0, 0, , d41d8cd98f00b204, alvherre@alvh.no-ip.org, :::, RULES_HIT:41:355:379:599:967:973:988:989:1260:1277:1311:1312:1313:1314:1345:1359:1381:1437:1515:1516:1518:1519:1534:1541:1593:1594:1595:1596:1711:1730:1747:1777:1792:2393:2525:2561:2564:2682:2685:2828:2859:2895:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3867:3868:3870:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4605:4659:5007:6261:7875:9025:9121:10004:10400:10848:11232:11256:11257:11658:11914:12043:12050:12219:12438:12517:12519:13069:13178:13229:13311:13357:13894:13895:14347:21080:21088, 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:0:0 X-HE-Tag: stem86_482e72966973e X-Filterd-Recvd-Size: 2373 Received: from alvin.alvh.no-ip.org (unknown [190.8.79.154]) (Authenticated sender: alvherre@alvh.no-ip.org) by omf13.b.hostedemail.com (Postfix) with ESMTPA; Tue, 9 Dec 2014 18:24:56 +0000 (UTC) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id A92C7792; Tue, 9 Dec 2014 15:24:54 -0300 (CLST) Date: Tue, 9 Dec 2014 15:24:54 -0300 From: Alvaro Herrera To: pgsql-bugs@postgresql.org, Paulo Tanimoto Subject: Re: regression, deadlock in high frequency single-row UPDATE Message-ID: <20141209182454.GQ1768@alvh.no-ip.org> References: <20140731233051.GN17765@andrew-ThinkPad-X230> <20140801005950.GF5475@eldon.alvh.no-ip.org> <20140804161205.GA30380@andrew-ThinkPad-X230> <20140804163027.GI5475@eldon.alvh.no-ip.org> <20141208235552.GZ6930@andrew-ThinkPad-X230> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20141208235552.GZ6930@andrew-ThinkPad-X230> 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-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Andrew Sackville-West wrote: > Some months later (stupid business priorities...) we have something to > report on this. We have been able to produce a minimal schema to > demonstrate the problem, and successfully induced the deadlock using > pgbench (thanks to Paulo Tanimoto, cc-ed here). > > Please see: > > https://gist.github.com/andrewsw-janrain/40d1687db013b1e7c3b3 > > for detailed instructions on how to trigger the deadlock. > > I would be thrilled to learn that we've done something wrong here, > otherwise I think this represents a regression introduced in 9.3. To avoid having to visit an external URL that might well not exist at all, and to simplify the test case which still has too many extraneous details, here's a simpler version that still causes the UPDATE to deadlock: -- schema.sql: create table pktab (id int primary key, data serial not null); create table fktab (fk int references pktab); insert into pktab values (1); -- query.sql: update pktab set data = default; insert into fktab values (1); This doesn't deadlock in 9.2, yet in 9.3 it raises an error in a few seconds with pgbench -c 16. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, 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