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 1jPRWo-0000z4-C0 for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Apr 2020 13:59:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jPRWn-0005vC-40 for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Apr 2020 13:59:33 +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 1jPRWm-0005uu-TS for pgsql-hackers@lists.postgresql.org; Fri, 17 Apr 2020 13:59:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jPRWk-00019s-OH for pgsql-hackers@postgresql.org; Fri, 17 Apr 2020 13:59:31 +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 03HDxP7N020279; Fri, 17 Apr 2020 09:59:25 -0400 From: Tom Lane To: Kyotaro Horiguchi cc: noah@leadboat.com, masao.fujii@oss.nttdata.com, pgsql-hackers@postgresql.org Subject: Re: 001_rep_changes.pl stalls In-reply-to: <20200417.170015.1981391722024305719.horikyota.ntt@gmail.com> References: <20200414013849.GA886648@rfd.leadboat.com> <8807.1586828716@sss.pgh.pa.us> <20200417054146.GA1061007@rfd.leadboat.com> <20200417.170015.1981391722024305719.horikyota.ntt@gmail.com> Comments: In-reply-to Kyotaro Horiguchi message dated "Fri, 17 Apr 2020 17:00:15 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20277.1587131965.1@sss.pgh.pa.us> Date: Fri, 17 Apr 2020 09:59:25 -0400 Message-ID: <20278.1587131965@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Kyotaro Horiguchi writes: > At Thu, 16 Apr 2020 22:41:46 -0700, Noah Misch wrote in >> I'm favoring (1). Other preferences? > Starting from the current shape, I think 1 is preferable, since that > waiting logic is no longer shared between logical and physical > replications. But I'm not sure I like calling WalSndWaitForWal() > (maybe with previous location + 1?), because the function seems to do > too-much. I'm far from an expert on this code, but it does look like there's a lot of stuff in WalSndWaitForWal that is specific to logical rep, so I'm not sure that (1) is workable. At the very least there'd have to be a bunch more conditionals in that function than there are now. In the end, a separate copy for physical rep might be better. (BTW, I think this code is in desperate need of a renaming campaign to make it clearer which functions are for logical rep, physical rep, or both.) regards, tom lane