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 1mcX3B-0002vX-WD for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Oct 2021 18:07:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mcX39-0000zH-U2 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Oct 2021 18:07:51 +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 1mcX39-0000xO-L5 for pgsql-hackers@lists.postgresql.org; Mon, 18 Oct 2021 18:07:51 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcX32-0001Is-3C for pgsql-hackers@postgresql.org; Mon, 18 Oct 2021 18:07:50 +0000 Received: (Authenticated sender: adsend@dunslane.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 7D3606000C; Mon, 18 Oct 2021 18:07:39 +0000 (UTC) Subject: Re: BUG #17212: pg_amcheck fails on checking temporary relations From: Andrew Dunstan To: Tom Lane Cc: Peter Geoghegan , Mark Dilger , Robert Haas , Pavel Borisov , Alexander Lakhin , PostgreSQL-development References: <17212-34dd4a1d6bba98bf@postgresql.org> <543F3BF3-EDED-4C52-AF05-623921B6C409@enterprisedb.com> <55A2BFE7-AAAF-4A64-BD3A-5C98EA982267@enterprisedb.com> <07159C9A-40DA-47BF-B2F4-! 203F5AC00890@enterprisedb.com> <40DB088B-C96F-49B2-BC84-BDC8D35C7E97@enterprisedb.com> <0B7DA7A4-2872-485B-BFDD-BF8E9BB07B26@enterprisedb.com> <903461.1634245763@sss.pgh.pa.us> <905705.1634248377@sss.pgh.pa.us> <122d1f3a-6e83-d2f8-3229-79cf8357136e@dunslane.net> Message-ID: <575655c4-7b24-e0d5-6f1b-2541b3e1cb20@dunslane.net> Date: Mon, 18 Oct 2021 14:07:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <122d1f3a-6e83-d2f8-3229-79cf8357136e@dunslane.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/15/21 10:46 AM, Andrew Dunstan wrote: > On 10/14/21 5:52 PM, Tom Lane wrote: >> Andrew Dunstan writes: >>> Yes, that's been puzzling me too. I've just been staring at it again and >>> nothing jumps out. But maybe we can investigate that offline if this >>> test is deemed not worth keeping. >> As Mark says, it'd be interesting to know whether the use of >> background_psql is related, because if it is, we'd want to debug that. >> (I don't really see how it could be related, but maybe I just lack >> sufficient imagination today.) > > > Yeah. I'm working on  getting a cut-down reproducible failure case. > I spend a good deal of time poking at this on Friday and Saturday. It's quite clear that the use of     my $h = $node->background_psql(...);     $h->pump_nb; is the root of the problem. If that code is commented out, or even just moved to just after the standby is started and before we check that replication has caught up (which should meet the needs of the case where we found this), then the problem goes away. IPC::Run deals with this setup in a different way on Windows, mainly because its select() only works on sockets and not other types of file handles. It does appear that TestLib::get_free_port() is not sufficiently robust, as it should guarantee that the port/address can be bound. I haven't got further that that, and I have other things I need to be doing, but for now I think we just need to be careful wherever possible to try to set up servers before trying to calling start/pump. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com