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 1mVh7W-0005iF-4g for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Sep 2021 21:28:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mVh7U-0006LF-Sk for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Sep 2021 21:28:04 +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 1mVh7T-0006L0-UJ for pgsql-hackers@lists.postgresql.org; Wed, 29 Sep 2021 21:28:04 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVh7R-00061Y-6N for pgsql-hackers@lists.postgresql.org; Wed, 29 Sep 2021 21:28:02 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 390735C0139; Wed, 29 Sep 2021 17:27:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 29 Sep 2021 17:27:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=zi+kOLg/fajFblRrJEZ+6YDRrb8ggDr3rydzTN/rllE=; b=kCBiRFZ6 i4bZycLtZv/OliDafk0RvgBfs8YQ3nH+/NUk6rR4GC582upmDjenjedN/5adNQZ5 AuGS88seUdb23fCLo13EuE5N/6ktq/t9xk94vzatmdvUKVST1qT/KhqSpBHOs8DW eakjpwjOhlH5WAZXzUeYR8eLnQimr+s1qLb1iE0IDFXReLLmVqplvw93gMjrsCo7 JHhbBzbFa2JnO/2cE+Mr1su+xauDjcBbi+jJmKVavsVYLES0X+r5hJjksUfywHk+ jsScG3hDVGgwhF5eBJq1dSSEMXboFqM0Lfnp/qe2u1u8+2pM+SARNrEJOHtkmxK7 bTPEqG94Lp8hDw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekvddgudehkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepteehkeetieefveefuddvtefhvdekhfeljeefvddvgfev heegheelfeevkeetjeeunecuffhomhgrihhnpehpghhsqhhlrdgsuhhilhgupdgvnhhtvg hrphhrihhsvggusgdrtghomhdplhifnhdrnhgvthenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqih hprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 29 Sep 2021 17:27:57 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id EDD552A06AB; Wed, 29 Sep 2021 18:27:54 -0300 (-03) Date: Wed, 29 Sep 2021 18:27:54 -0300 From: Alvaro Herrera To: Andrew Dunstan Cc: Tom Lane , "Bossart, Nathan" , Kyotaro Horiguchi , "andres@anarazel.de" , "masao.fujii@oss.nttdata.com" , "pgsql-hackers@lists.postgresql.org" , "mengjuan.cmj@alibaba-inc.com" , "Jakub.Wartak@tomtom.com" , Ryo Matsumura Subject: Re: prevent immature WAL streaming Message-ID: <202109292127.7q66qhxhde67@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <06126430-07db-7051-a4c7-17edbe4ac34e@dunslane.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Sep-29, Andrew Dunstan wrote: > > The relevant info seems to be > > > > # Running: pg_basebackup -D /home/pgrunner/bf/root/REL_14_STABLE/pgsql.build/src/test/recovery/tmp_check/t_026_overwrite_contrecord_primary2_data/backup/backup -h 127.0.0.1 -p 59502 --checkpoint fast --no-sync > > pg_basebackup: error: connection to server at "127.0.0.1", port 59502 failed: FATAL: no pg_hba.conf entry for replication connection from host "127.0.0.1", user "pgrunner", no encryption > > Bail out! system pg_basebackup failed > > > > which looks like a pretty straightforward bogus-connection-configuration > > problem, except why wouldn't other BF members show it? > > This: > > # Second test: a standby that receives WAL via archive/restore commands. > $node = PostgresNode->new('primary2'); > $node->init( >     has_archiving => 1, >     extra         => ['--wal-segsize=1']); > > doesn't have "allows_streaming => 1". Hmm, but I omitted allows_streaming on purpose -- I only wanted archiving, not streaming. I understand that your point is that set_replication_conf is not called unless allows_streaming is set. So, do we take the stance that we have no right to expect pg_basebackup to work if we didn't pass allow_streaming => 1? If so, the fix is to add it. But my preferred fix would be to call set_replication_conf if either allows_streaming or has_archiving are given. Another easy fix would be to call $primary2->set_replication_conf in the test file, but then you'd complain that that's supposed to be an internal method :-) (This reminds me that I had to add something that seemed like it should have been unnecessary: wal_level=replica should become set if I request archiving, right? Otherwise the WAL archive is useless. I also had to add max_wal_senders=2 so that pg_basebackup would work, but I'm on the fence about setting that automatically if has_archiving is given.) -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/ "At least to kernel hackers, who really are human, despite occasional rumors to the contrary" (LWN.net)