Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdbGj-0000zD-Ca for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2019 14:08:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hdbGi-00066n-0H for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2019 14:08:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdbGg-0005y1-N9 for pgsql-hackers@lists.postgresql.org; Wed, 19 Jun 2019 14:08:55 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdbGd-0003WS-ML for pgsql-hackers@lists.postgresql.org; Wed, 19 Jun 2019 14:08:53 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 94B7651A; Wed, 19 Jun 2019 10:08:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 19 Jun 2019 10:08:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hintbits.com; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=mesmtp; bh=O5Yb8x50t3znJF0xAEw0K5SxEQhYXfO+/eoLiETnlo4=; b=oQVMCa3R5rPZ gK2oR1cDP9+I7oKHGMopU2qJc7iUZDRrnWOlv4HSbw9BFQQrzGMB6mZRttSbwS02 6UgkuUY+HgKobF9PoNjc6UA/VpVePRsEDSl8o0M65rNL/SL9A/LafU7buSEDfWdP XdIk0/yR4TReAhh9fQZikhUPpdsRTlE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=O5Yb8x50t3znJF0xAEw0K5SxEQhYXfO+/eoLiETnl o4=; b=YuKX14yIlJCjXsW13A8EOIlMz93sIOOQ34qIccbsoApw1f94ZESCQdjYK RF1Dz3af8oouS5eu00nuQlAZjHu1JHo1W3zjKnmhe1t4lxkipc3cD2VGde4G5FT8 qRhX8uMYZYID47AHK0S5fhXdXl7yKGub8POCKENN/4dpoQCIJvue3AcudFv0IzH+ Eeu5uBECB0eE2ILWNnx5De6G7SGtWSpQev+eN4HhJTD3phpNRIPcp3eQMwvdy3d3 KO3qYbsQyE6yMdM1/o/JgVj5iBnzqikLE0VqFXLrXD5+SzC2OzWocwFQOSaMLqSw rxduFdvOcL2BPUMevZCF8HZrlBXIQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddvgdegiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurheptggguffhjgffgffkfhfvofesthhqmh dthhdtvdenucfhrhhomhepqfhlvghkshhiihcumfhlihhukhhinhcuoegrlhgvgihksehh ihhnthgsihhtshdrtghomheqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrgh enucfkphepudelfedruddviedrvdegjedrudelleenucfrrghrrghmpehmrghilhhfrhho mheprghlvgigkheshhhinhhtsghithhsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.92.147] (193-126-247-199.net.novis.pt [193.126.247.199]) by mail.messagingengine.com (Postfix) with ESMTPA id 080708005A; Wed, 19 Jun 2019 10:08:47 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: pgsql: Avoid spurious deadlocks when upgrading a tuple lock From: Oleksii Kliukin In-Reply-To: <20190618222547.GA18769@alvherre.pgsql> Date: Wed, 19 Jun 2019 15:08:31 +0100 Cc: Tom Lane , pgsql-hackers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <2A0C6E60-661D-47BB-888C-F557D4E7458A@hintbits.com> References: <20190618222547.GA18769@alvherre.pgsql> To: =?utf-8?Q?=C3=81lvaro_Herrera?= X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera wrote: > On 2019-Jun-18, Oleksii Kliukin wrote: >=20 >> Sorry, I was confused, as I was looking only at >> = https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h=3Dd= e87a084c0a5ac927017cd0834b33a932651cfc9 >>=20 >> without taking your subsequent commit that silences compiler warnings = at >> = https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h=3D3= da73d6839dc47f1f47ca57974bf28e5abd9b572 >> into consideration. With that commit, the danger is indeed in = resetting the >> skip mechanism on each jump and potentially causing deadlocks. >=20 > Yeah, I understand the confusion. >=20 > Anyway, as bugs go, this one seems pretty benign. It would result in = a > unexplained deadlock, very rarely, and only for people who use a very > strange locking pattern that includes (row-level) lock upgrades. I > think it also requires aborted savepoints too, though I don't rule out > the possibility that there might be a way to reproduce this without > that. >=20 > I pushed the patch again just now, with the new permutation. Thank you very much for working on it and committing the fix! Cheers, Oleksii=