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 1jMRip-0006GM-7z for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2020 07:35:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jMRil-0007ZW-TZ for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2020 07:35:31 +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 1jMRil-0007ZP-3Q for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2020 07:35:31 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMRig-0008Bk-Tu for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2020 07:35:29 +0000 Received: from hnk.local (p2421237-ipbf2725funabasi.chiba.ocn.ne.jp [122.24.33.237]) by oss.nttdata.com (Postfix) with ESMTPSA id DDC9F603BB; Thu, 9 Apr 2020 16:35:22 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.2 at oss.nttdata.com Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed To: Kyotaro Horiguchi , tgl@sss.pgh.pa.us Cc: a.akenteva@postgrespro.ru, a.korotkov@postgrespro.ru, i.kartyshov@postgrespro.ru, amit.kapila16@gmail.com, pgsql-hackers@lists.postgresql.org References: <20200408.100945.375702947246835193.horikyota.ntt@gmail.com> <13716.1586378146@sss.pgh.pa.us> <20200409.161107.580344062273684114.horikyota.ntt@gmail.com> From: Fujii Masao Message-ID: <880834ee-4b18-6d5d-9dae-6520c5eb2bef@oss.nttdata.com> Date: Thu, 9 Apr 2020 16:35:22 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200409.161107.580344062273684114.horikyota.ntt@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020/04/09 16:11, Kyotaro Horiguchi wrote: > At Wed, 08 Apr 2020 16:35:46 -0400, Tom Lane wrote in >> Anna Akenteva writes: >>> I'd like to hear others' opinions on the syntax as well. >> >> Pardon me for coming very late to the party, but it seems like there are >> other questions that ought to be answered before we worry about any of >> this. Why is this getting grafted onto BEGIN/START TRANSACTION in the >> first place? It seems like it would be just as useful as a separate >> command, if not more so. You could always start a transaction just >> after waiting. Conversely, there might be reasons to want to wait >> within an already-started transaction. >> >> If it could survive as a separate command, then I'd humbly suggest >> that it requires no grammar work at all. You could just invent one >> or more functions that take suitable parameters. > > 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. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION