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 1hbXPh-0002JQ-Mf for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jun 2019 21:37:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hbXPg-0007qw-5N for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jun 2019 21:37:40 +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 1hbXPf-0007qp-L7 for pgsql-hackers@lists.postgresql.org; Thu, 13 Jun 2019 21:37:39 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbXPc-0000QG-FX for pgsql-hackers@lists.postgresql.org; Thu, 13 Jun 2019 21:37:38 +0000 Received: by mail-qt1-x843.google.com with SMTP id p15so187157qtl.3 for ; Thu, 13 Jun 2019 14:37:36 -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=QTdJARi0sn7KBajPRQpXIA2XnGEHmG1tgvHt9SHx9EI=; b=b8XaakUg7VLO4XerGHekWYJ+kIT1zoa/2BUhyUomcoOqOC29SgVFXcnp3jdkydjWJS C4y8HXra/rfYVF3CJzp8pPvtrymkCBKyWS6pTyhmZBfnm3TG9XQ7RMwH+NbFT5ti/ZXN 9BpvQk/dcd52OzuClZ7O+yxdHCrlOB9UrWjR7zlSWPX6h1OUeEYhKGlCxg11I2+TwVr1 KTPjcHKg34FlR10CBWVxmbDTOmp0tDh5NAJoYgwJPsFvAQ+fCNbVPCZ5mJ/gw5CnYaXD dlx4gypcKzdhEgjsZb/Ns9KynGZfjT2k2v59+WA4invdK+Fyyf1DyTPfBWzGVrGZeDp/ OC/g== 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=QTdJARi0sn7KBajPRQpXIA2XnGEHmG1tgvHt9SHx9EI=; b=mHJi2PZKXf69lfyMTfUD4J5EbJOuURBnzWuN3rhFnXSvSxNq8hBfFVH5SUsVuBus5t tMcWYHjh/YjgTxa5asbQwV3p75HG1pD3L68dVOBvTh8T85E2pwkfe2kzObbmOCvzCPxG 4wL7bcHu779L7Nk4wi5aT1iuJuVI8areCkK3Av3bSE3ZhV8yIckaiXiFcGuP4vXKFsso jbwQx1JSDe175l4FaY4Eyt+b7q0sm8+Rcb04quA3cVIzWjJQxCTW8IE+7g1azWDMgDOr cRtdlfl2qJf6ebQkt0WqRZvIgRWVUj1eNRFjxdTjl4gjPyyQhv5XxVGRw0/fshKMwiRi 6ppQ== X-Gm-Message-State: APjAAAWQmYytYl2u/ndlwv+H/YzE+BUvUijhdxdzARfK9V5CdR9sPoAB xu3dKNDsXqrBQ8z961j9050GywawXg8= X-Google-Smtp-Source: APXvYqy9XU9i9kUqLiDhVCgO5GBmEl0VcFIaCZMxJ8LKmfJZwNp6JiuQByCUlEEFlhMi7205eH8a5Q== X-Received: by 2002:ac8:1829:: with SMTP id q38mr59171897qtj.252.1560461855642; Thu, 13 Jun 2019 14:37:35 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id t29sm654310qtt.42.2019.06.13.14.37.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 13 Jun 2019 14:37:34 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id D72B4120BA6; Thu, 13 Jun 2019 17:37:31 -0400 (-04) Date: Thu, 13 Jun 2019 17:37:31 -0400 From: Alvaro Herrera To: Oleksii Kliukin Cc: PostgreSQL Hackers Subject: Re: upgrades in row-level locks can deadlock Message-ID: <20190613213731.GA11593@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190613180014.GA9775@alvherre.pgsql> 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, Alvaro Herrera wrote: > 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). Done, thanks for the report and patch! I tried hard to find a scenario that this patch breaks, but couldn't find anything. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services