Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lR1gv-0002Ud-RJ for pgsql-general@arkaria.postgresql.org; Mon, 29 Mar 2021 23:53:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lR1gu-0003In-Fa for pgsql-general@arkaria.postgresql.org; Mon, 29 Mar 2021 23:53:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lR1gs-0003Ig-Mo for pgsql-general@lists.postgresql.org; Mon, 29 Mar 2021 23:53:04 +0000 Received: from [66.111.4.25] (helo=out1-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lR1go-0000Hn-Cp for pgsql-general@postgresql.org; Mon, 29 Mar 2021 23:53:02 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 69D985C0052; Mon, 29 Mar 2021 19:52:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 29 Mar 2021 19:52:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=L i5upqFpvqHhm+0VCpAldRkrUy9KRWaZTuVhl3LBr1A=; b=LCP7K3sqnhAASzq+1 2IxGWuoyR5HZeNg+91jadLdJBT2pNWzHmGyi1WdM1Ynof9/Xn++PKWrUYoAAoEwc nwxvn30v25AT7KFELP0Cf+chzwCD+OAdzOoDC5hbhXjxuGL/qqp6CIgPyoVYUfio D1yTu64FYytIYf3Ioa2cyNlPMnnLrFXkYvAF1UrZlljfBOtWp3FVR99rY7+T0AO6 fJyyHqKKKvEfFu8+eHNM3f9crn1EXwE8FW5TfYe5Mp4XNy/D6HQb6Z7HdgwuF4Sr Bq84CAsmTFpk78eWegKVDxVwjFe5Zm0eudGjELCq3/TI1jTjlwUIbOdFOEdL1yQt LvHeg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm2; bh=Li5upqFpvqHhm+0VCpAldRkrUy9KRWaZTuVhl3LBr 1A=; b=bCpt9/Tpnz27KIhHi6WxR1OLys0NZcMv009S7bQMCXXpipktqgay4x6Kj NeHbvQ556YpUN8xjbURzrXK8+1XzyV4hf/BfQE6L29/u10JBNFjVe2llyVSVLtee Af0aIOYRxlgSYzkhPELOuD4+SNPjE8K/BaqNVNjUNF5bJ78ie3mMqI6Ylyi6E/r7 VADs0ea99ZtzmxqxKD3OJOPoIVbuHdxLuMizI7XyoRvzEiFfn7IXihwVXyoZXiyC 2ljWAXM575XMWkezYcIwG9mNS8j+YO7Zn68bRpLZWta8Zlien/mOap8LENcyr1W7 Yc+HgBZp/sP3NGN+e4ZCkIKvzMIWQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehledgvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeevveefveefueegffekkefhgeeiueffgfetueejvdfg hfeujeejhfekjeelgedtgeenucfkphepleejrdduudefrddvudejrddvjeenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.4] (97-113-217-27.tukw.qwest.net [97.113.217.27]) by mail.messagingengine.com (Postfix) with ESMTPA id 9C76C24005B; Mon, 29 Mar 2021 19:52:45 -0400 (EDT) Subject: Re: Row not immediately visible after commit To: Steve Baldwin , pgsql-general References: From: Adrian Klaver Message-ID: <064d0c00-d68e-b522-5f43-017877e07d5c@aklaver.com> Date: Mon, 29 Mar 2021 16:52:44 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.25 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/29/21 4:39 PM, Steve Baldwin wrote: > Hi all, > > I know this is going to sound weird/unbelievable, but I'm trying to come > up with an explanation for what I've observed. > > First, a couple of data points. The instance is running on AWS RDS and > is on version 13.1. All my timestamps and elapsed times were taken from > the postgres log (converted to my local tz). > > 2021-03-30 05:47:40.989+11 Session A begins a new transaction > 2021-03-30 05:47:41.006+11 Session A inserts a single row into table A > 2021-03-30 05:47:41.031+11 Session A inserts two rows into table B > 2021-03-30 05:47:41.039+11 Session A commits (duration = 3.022 ms) > > 2021-03-30 05:47:41.082+11 Session B begins a new transaction > 2021-03-30 05:47:41.083+11 Session B fetches one of the inserted rows > from table B > 2021-03-30 05:47:41.085+11 Session B attempts to fetch the inserted row > from table A using the primary key. Fetch returns zero rows. > 2021-03-30 05:47:41.087+11 Session B aborts the transaction with rollback > > 2021-03-30 05:47:42.143+11 Session C begins a new transaction > 2021-03-30 05:47:42.146+11 Session C fetches the same row as session B above > 2021-03-30 05:47:42.228+11 Session C attempts the same query on table A > as session B above. The fetch returns 1 row, and session C continues > processing. > > I can't imagine how Session B could fail to fetch the row from table A > given that the commit has completed prior to Session B starting its > transaction. > > Any suggestions? Ask AWS support. > > Thanks, > > Steve -- Adrian Klaver adrian.klaver@aklaver.com