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 1hbU1V-0002m0-Hy for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jun 2019 18:00:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hbU1U-0007z7-21 for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jun 2019 18:00:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbU1T-0007jh-Lq for pgsql-hackers@lists.postgresql.org; Thu, 13 Jun 2019 18:00:27 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbU1L-0001nC-9J for pgsql-hackers@lists.postgresql.org; Thu, 13 Jun 2019 18:00:26 +0000 Received: by mail-qk1-x741.google.com with SMTP id t8so9666179qkt.1 for ; Thu, 13 Jun 2019 11:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=EdshYP7Fl/qMjqntyQrdX4zEqrghsl34pp2fjL2qz2c=; b=TxxE3h4UDHTXGr9d67xFC+3gAt3ZAX44Z3Sun8e92hNb+yiU7HDtGJ8eR9M6BUzI2w +EM/wLrJnbvm9liy4TIEOZtj/F0THNg640gnIEOU/0bUNP/gKK2y/ALvAH0NhzTm5XWI +LEsi+km4Q429pQctZA4jh6o3MqZJCUf6Nu/VND6behFlxgcpV20bcYZg5/ov5bjz5Fu 1AjtGfSb9WYeZICeCQKKM2+fmL4h6W3SPTeJFH2IslL2GbT1hLFfuUIVoz6mNRk5ICHA KRlpxBhL4MGg7M12QWyCiR8IBGounsaWK1V2cJ0fjkhQjylVE2eSV5HhWYrEG0BS1ZTy 95WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=EdshYP7Fl/qMjqntyQrdX4zEqrghsl34pp2fjL2qz2c=; b=AMU9ucH04KaPy478hbI8z547JwFuu9+jVrGPBI+HMlm5mACBjz/OWkwM/Qsr/SMGAd 2Dz3r1N7TxGLy7ajsciATjvbfHT6iaKUySSzgNBkv2+f6jkrnaqXtfqO/Vvk839bE69z jwKXEseeI4aYAlQPj5S8ttU3zhhJgyY+M4tKFNMl5GElQkpW0EHyOI3UhfgpQX83r0dE iSO/C8TWGEtJdjR6ufwZZF+ldAbTDu5GikMFdRAZYxSMoacEcauKY6zKjwqYF9e4HT4O rxn3ARGZazgDlmMLsuBg1XyJiYaRM+bhdVb7CaGVnqbwLS4Ir1S8aW4J9goqljtFt+pE izsA== X-Gm-Message-State: APjAAAVgXbjfOtWWN4LM8MBHNVasL8VqheyX5TAWo9UP0Oi0Js11Lvio 6Dq/VpDHp4zltg7TJx3k27H7Xg== X-Google-Smtp-Source: APXvYqzwpVXO+VVC/DUHnqjjnXhI317xJ/QjSDTqV7J32+ItXt6akZC+2ASp3u3w3BbZKjdVD+e6Jg== X-Received: by 2002:a37:a247:: with SMTP id l68mr11904246qke.89.1560448817415; Thu, 13 Jun 2019 11:00:17 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id j26sm208854qtj.70.2019.06.13.11.00.16 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 13 Jun 2019 11:00:16 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 3565E120B96; Thu, 13 Jun 2019 14:00:14 -0400 (-04) Date: Thu, 13 Jun 2019 14:00:14 -0400 From: Alvaro Herrera To: Oleksii Kliukin Cc: PostgreSQL Hackers Subject: Re: upgrades in row-level locks can deadlock Message-ID: <20190613180014.GA9775@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <40AE3BAD-CE9B-4A34-9DB8-3017A66653C3@hintbits.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jun-13, Oleksii Kliukin wrote: > Makes sense. For the symmetry I have included those that perform lock > upgrades in one session and those that doesn’t, while the other sessions > acquire locks, do updates or deletes. For those that don’t upgrade locks the > test checks that the locks are acquired in the correct order. Thanks for the updated patch! I'm about to push to branches 9.6-master. It applies semi-cleanly (only pgindent-maturity whitespace conflicts). The [pg11 version of the] patch does applies to 9.5 cleanly ... but the isolation test doesn't work, because isolationtester was not smart enough back then. Since there have been no previous reports of this problem, and to avoid pushing untested code, I'm going to refrain from back-patching there. My guess is that it should work ... In 9.4 there are quite some severe conflicts, because 27846f02c176 was not back-patched there. (The bug number "#8470" still floats in my memory from time to time. Shudder) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services