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 1lR2BA-0003v1-0L for pgsql-general@arkaria.postgresql.org; Tue, 30 Mar 2021 00:24:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lR2B8-00079I-VJ for pgsql-general@arkaria.postgresql.org; Tue, 30 Mar 2021 00:24:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lR2B8-00079A-G0 for pgsql-general@lists.postgresql.org; Tue, 30 Mar 2021 00:24:18 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lR2B1-0006Th-Sq for pgsql-general@lists.postgresql.org; Tue, 30 Mar 2021 00:24:17 +0000 Received: by mail-oi1-x235.google.com with SMTP id x207so14838883oif.1 for ; Mon, 29 Mar 2021 17:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=mAutJeGmKTPrkbhGirsQPxEyid0lrYE83Elbo279yjY=; b=EUxLObQkWsLDCHCXK2BOYnpbnQTbQvO7hlhyZ8y+v1rWYK7cfr8XfIFm/ytLQTiPj9 Ce3qGk4OyJ5fZXAWSVPARwD8Kck0agN+yN+Zo7k/bR0zrjDdKu9ubyNqjCyABgjb2G1i aWspQMm04j0GcUdNXgonoK7zLZZpAP5MAwb3zKBjokXmZyThWC9/G8PetPaTM5F9lEh3 3RwdtbTiZva8su68TYk8JntxGajixns21yJsQmviW2PUE9k/x3hra5Z1Or/llggSgKhV VFqplqrABkHVSZuIYtzKv30RH5LZM6STYD7Uf81S/O4J0U7MADwi7qd2eJX2JbSofzQ6 XH4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=mAutJeGmKTPrkbhGirsQPxEyid0lrYE83Elbo279yjY=; b=jHrr8UP+DIBg8BFDwocrFpzfxvJvPWDoqtfst/hfaC5UDHISkg0NxQoLbaMaWAwY9t yx9H3f+iThPnTM0Xk8eprnS4EJRdX3k9K19A9tUU/5JlGknZY+Nhw2KJG8yM9nMeXOlf CCD7lXMLKP7DvCmd0rlizoiFl32ts/v9+aQgdtG8fZDV5gahLcA938s5PdjFd2DHQymt fIeHo0OD2+y2nAEvnZlqbIdfN1jfTUyem4fZb9IzxEAj4vBP1LPRvdmp1zmMt5ZEaJIX gzPnSZMovBax951t7jh+R7Spkku0Kdxi/s03YamgEk9jLG7ZNp9ae1xr+5b7I5L7ORWk cweQ== X-Gm-Message-State: AOAM532K4hcd8ccOz7f6bIm7Os6oKYMLw426yqkfjW7k/j1k1ZQ2cHd9 tQPMtxIHkEBxsiusKCx1H7qajANCQmE= X-Google-Smtp-Source: ABdhPJzFuCZOfE4xRLlimqLu+rvl/Z9VHyKhMYxunKLjQRLQgGBwyLnVtmaAdVdPD7OV8zvcvSIU5A== X-Received: by 2002:a05:6808:146:: with SMTP id h6mr1269517oie.118.1617063851015; Mon, 29 Mar 2021 17:24:11 -0700 (PDT) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id g13sm4721532otq.3.2021.03.29.17.24.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Mar 2021 17:24:10 -0700 (PDT) Subject: Re: Row not immediately visible after commit To: pgsql-general@lists.postgresql.org References: <064d0c00-d68e-b522-5f43-017877e07d5c@aklaver.com> From: Ron Message-ID: <58ffb12d-e0b5-bf92-2d1b-e9adeda96af8@gmail.com> Date: Mon, 29 Mar 2021 19:24:09 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------1D8E13873742B1A5485D28E2" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------1D8E13873742B1A5485D28E2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit RDS is also a modified version of Postgresql, just not as modified as Aurora. On 3/29/21 7:06 PM, Steve Baldwin wrote: > Thanks Adrian. This is 'vanilla' postgres as far as I know (unlike their > postgres-flavoured Aurora product). > > b2bc_owner@b2bcreditonline=> select version(); >                                                  version > --------------------------------------------------------------------------------------------------------- >  PostgreSQL 13.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 > 20150623 (Red Hat 4.8.5-11), 64-bit > > Steve > > On Tue, Mar 30, 2021 at 10:52 AM Adrian Klaver > wrote: > > 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 > -- Angular momentum makes the world go 'round. --------------1D8E13873742B1A5485D28E2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit RDS is also a modified version of Postgresql, just not as modified as Aurora.

On 3/29/21 7:06 PM, Steve Baldwin wrote:
Thanks Adrian. This is 'vanilla' postgres as far as I know (unlike their postgres-flavoured Aurora product).

b2bc_owner@b2bcreditonline=> select version();
                                                 version
---------------------------------------------------------------------------------------------------------
 PostgreSQL 13.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11), 64-bit

Steve

On Tue, Mar 30, 2021 at 10:52 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
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

--
Angular momentum makes the world go 'round.
--------------1D8E13873742B1A5485D28E2--