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 1jMXJV-0002P4-3b for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2020 13:33:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jMXJT-0000IM-Fb for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2020 13:33:47 +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 1jMXJT-0000IF-8h for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2020 13:33:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMXJQ-0004SC-NK for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2020 13:33:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 039DXfet027172; Thu, 9 Apr 2020 09:33:41 -0400 From: Tom Lane To: Fujii Masao cc: Kyotaro Horiguchi , a.akenteva@postgrespro.ru, a.korotkov@postgrespro.ru, i.kartyshov@postgrespro.ru, amit.kapila16@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed In-reply-to: <880834ee-4b18-6d5d-9dae-6520c5eb2bef@oss.nttdata.com> References: <20200408.100945.375702947246835193.horikyota.ntt@gmail.com> <13716.1586378146@sss.pgh.pa.us> <20200409.161107.580344062273684114.horikyota.ntt@gmail.com> <880834ee-4b18-6d5d-9dae-6520c5eb2bef@oss.nttdata.com> Comments: In-reply-to Fujii Masao message dated "Thu, 09 Apr 2020 16:35:22 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27170.1586439221.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 09 Apr 2020 09:33:41 -0400 Message-ID: <27171.1586439221@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Fujii Masao writes: > On 2020/04/09 16:11, Kyotaro Horiguchi wrote: >> At Wed, 08 Apr 2020 16:35:46 -0400, Tom Lane wrote = in >>> Why is this getting grafted onto BEGIN/START TRANSACTION in the >>> first place? >> The rationale for not being a fmgr function is stated in the following >> comments. [...] > This issue happens because the function is executed after BEGIN? If yes, > what about executing the function (i.e., as separate transaction) before= BEGIN? > If so, the snapshot taken in the function doesn't affect the subsequent > transaction whatever its isolation level is. I wonder whether making it a procedure, rather than a plain function, would help any. regards, tom lane