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 1keC7x-0008Mj-7Q for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Nov 2020 07:07:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1keC7w-0003gR-5w for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Nov 2020 07:07:08 +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 1keC7v-0003g9-V4 for pgsql-hackers@lists.postgresql.org; Sun, 15 Nov 2020 07:07:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1keC7u-0004Uf-5p for pgsql-hackers@postgresql.org; Sun, 15 Nov 2020 07:07:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0AF772vp606797; Sun, 15 Nov 2020 02:07:02 -0500 From: Tom Lane To: Heikki Linnakangas cc: Soumyadeep Chakraborty , Kyotaro Horiguchi , pgsql-hackers Subject: Re: Refactor pg_rewind code and make it work against a standby In-reply-to: <605973.1605422900@sss.pgh.pa.us> References: <0c5b3783-af52-3ee5-f8fa-6e794061f70d@iki.fi> <20200820.173224.2258034742176021277.horikyota.ntt@gmail.com> <20200918.164150.1688011206252014871.horikyota.ntt@gmail.com> <4744063e-1a60-1b24-e1b7-7ace5e65f0d2@iki.fi> <95c2ad04-eb6b-7c2e-b751-c65acccd81df@iki.fi> <605973.1605422900@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 15 Nov 2020 01:48:20 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <606795.1605424022.1@sss.pgh.pa.us> Date: Sun, 15 Nov 2020 02:07:02 -0500 Message-ID: <606796.1605424022@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Not sure if you noticed, but piculet has twice failed the > 007_standby_source.pl test that was added by 9c4f5192f: > ... > Now, I'm not sure what to make of that, but I can't help noticing that > piculet uses --disable-atomics while francolin uses --disable-spinlocks. > That leads the mind towards some kind of low-level synchronization > bug ... Or, maybe it's less mysterious than that. The failure looks like we have not waited long enough for the just-inserted row to get replicated to node C. That wait is implemented as $lsn = $node_a->lsn('insert'); $node_b->wait_for_catchup('node_c', 'write', $lsn); which looks fishy ... shouldn't wait_for_catchup be told to wait for replay of that LSN, not just write-the-WAL? regards, tom lane