Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8q4M-0003k6-Td for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Apr 2018 16:36:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f8q4L-0005V1-JU for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Apr 2018 16:36:29 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8q4L-0005Ul-Ba for pgsql-hackers@lists.postgresql.org; Wed, 18 Apr 2018 16:36:29 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8q4G-0003iP-9g for pgsql-hackers@postgresql.org; Wed, 18 Apr 2018 16:36:28 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id D735012A7; Wed, 18 Apr 2018 12:36:21 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 18 Apr 2018 12:36:21 -0400 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:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=2BJOi/x9EW7AA3AFT T5aK9h5w/ABH9yxxw2UgW1xqSQ=; b=QQN+SMz22nqF2lk1NGlfLTq4v18edVBNz gWqhBkjyHC9NY/14RdbNUNs1W5BHPXm+1jQsc94D/Vu4beCu2jfe/F5DtzuFUBFf 7xDZj0qhGuf/fGjjqPdNmEn2U5kpvTmYzexndHoJQNT3I2/Nl6bY3dxuXd9YBYGL 2UzeSdkgxZAfb53nkk659ME8iQwqct8pYIU3tfzU1ITvtEcMwEiFX2Zit7+O1p+6 D+0+HyuB3x6JGad3raR9hxmhsdSbwNcrEF+W5+k71U0VQ/jRzYPr1opg6TNk8Y9k ZtgGUhS+gROG6SJpwc8o8OAtfupV9x2x7a1NWnkJkFoUe3qK5N/5w== X-ME-Sender: Received: from alvin.alvh.no-ip.org (unknown [179.56.29.253]) by mail.messagingengine.com (Postfix) with ESMTPA id 36E0910253; Wed, 18 Apr 2018 12:36:21 -0400 (EDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id C8A3D60D; Wed, 18 Apr 2018 13:36:18 -0300 (-03) Date: Wed, 18 Apr 2018 13:36:18 -0300 From: Alvaro Herrera To: Tom Lane Cc: Jeff Janes , pgsql-hackers , Kevin Grittner Subject: Re: Deadlock in multiple CIC. Message-ID: <20180418163618.z4t76abs3dmscver@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9251.1524065896@sss.pgh.pa.us> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane wrote: > *** /home/postgres/pgsql/src/test/isolation/expected/lock-update-delete_1.out Mon Feb 12 14:53:46 2018 > --- /home/postgres/pgsql/src/test/isolation/output_iso/results/lock-update-delete.out Wed Apr 18 11:30:23 2018 > *************** > *** 150,156 **** > > t > step s1l: <... completed> > ! error in steps s2_unlock s1l: ERROR: could not serialize access due to concurrent update > > starting permutation: s2b s1l s2u s2_blocker1 s2r s2_unlock > pg_advisory_lock > --- 150,158 ---- > > t > step s1l: <... completed> > ! key value > ! > ! 1 1 > > starting permutation: s2b s1l s2u s2_blocker1 s2r s2_unlock > pg_advisory_lock > > It looks like maybe this one wasn't updated in 533e9c6b0 --- would > you check/confirm that? I think the new output is correct in REPEATABLE READ but it represents a bug for the SERIALIZABLE mode. The case is: a tuple is updated, with its key not modified; a concurrent transaction is trying to read the tuple. The original expected output says that the reading transaction is aborted, which matches what the test comment says: # When run in REPEATABLE READ or SERIALIZABLE transaction isolation levels, all # permutations that commit s2 cause a serializability error; all permutations # that rollback s2 can get through. In REPEATABLE READ it seems fine to read the original version of the tuple (returns 1) and not raise an error (the reading transaction will simply see the value that was current when it started). But in SERIALIZABLE mode, as far as I understand it, this case should raise a serializability error. I hope I'm wrong. Copying Kevin, just in case. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services