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 1jOIEs-0000hA-DL for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2020 09:52:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jOIEq-0007Fk-2I for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2020 09:52:16 +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 1jOIEp-0007Fd-PS for pgsql-hackers@lists.postgresql.org; Tue, 14 Apr 2020 09:52:15 +0000 Received: from cyclops.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jOIEn-0003hi-AY for pgsql-hackers@lists.postgresql.org; Tue, 14 Apr 2020 09:52:15 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 1277821C5E62; Tue, 14 Apr 2020 12:52:10 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from mail.postgrespro.ru (cyclops.l.postgrespro.ru [192.168.27.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 342BB21C566D; Tue, 14 Apr 2020 12:52:08 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1586857929; bh=ogqTkvlQvlg3YJ42RxAPaob6iV640j0DZDl0oXq68HY=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=TmTIcUqpcqwSiEXZupQdfLFprRV4s6iERXm2cHM7FzhGO//12pc2tIj5Pd2fpvcKP N8qntAA9PpavTnjNc9Bb8RV2q1QODDBqezm4l1DAORJ3+q7M3th8iGaG2obkLm0OXD KEH9vw9JVceXTwGAXkoQ79W2trxQB95mQbugLW/0= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 14 Apr 2020 12:52:07 +0300 From: Anna Akenteva To: Andres Freund Cc: Tom Lane , Fujii Masao , Alexey Kondratov , Kyotaro Horiguchi , 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: <20200410214410.vzu6at6qbjq4yage@alap3.anarazel.de> References: <13716.1586378146@sss.pgh.pa.us> <20200409.161107.580344062273684114.horikyota.ntt@gmail.com> <880834ee-4b18-6d5d-9dae-6520c5eb2bef@oss.nttdata.com> <27171.1586439221@sss.pgh.pa.us> <759206c1-265f-97da-d135-fcecbced646b@oss.nttdata.com> <20200410193301.2qsbuoieppkst7xj@alap3.anarazel.de> <32218.1586550579@sss.pgh.pa.us> <20200410210641.5cub2minmnciydvv@alap3.anarazel.de> <2024.1586553430@sss.pgh.pa.us> <20200410214410.vzu6at6qbjq4yage@alap3.anarazel.de> User-Agent: Roundcube Webmail/1.4.0 Message-ID: X-Sender: a.akenteva@postgrespro.ru Organization: Postgres Professional List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-04-11 00:44, Andres Freund wrote: > I think there's also some advantages of having it in a single statement > for poolers. If a pooler analyzes BEGIN AFTER 'xx/xx' it could > e.g. redirect the transaction to a node that's caught up far enough, > instead of blocking. But that can't work even close to as easily if > it's > something that has to be executed before transaction begin. > I think that's a good point. Also, I'm not sure how we'd expect a wait-for-LSN procedure to work inside a single-snapshot transaction. Would it throw an error inside a RR transaction block? Would it give a warning? -- Anna Akenteva Postgres Professional: http://www.postgrespro.com The Russian Postgres Company