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 1mVhK2-0006N6-Ma for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Sep 2021 21:41:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mVhK1-0000fr-Kv for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Sep 2021 21:41:01 +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 1mVhK1-0000fj-DG for pgsql-hackers@lists.postgresql.org; Wed, 29 Sep 2021 21:41:01 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVhJu-0006mS-Ur for pgsql-hackers@lists.postgresql.org; Wed, 29 Sep 2021 21:41:00 +0000 Received: (Authenticated sender: adsend@dunslane.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 609E8100002; Wed, 29 Sep 2021 21:40:48 +0000 (UTC) Subject: Re: prevent immature WAL streaming To: Alvaro Herrera 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 References: <202109292127.7q66qhxhde67@alvherre.pgsql> From: Andrew Dunstan Message-ID: <41423ae2-eceb-16d6-0ee3-11abc3a5c50f@dunslane.net> Date: Wed, 29 Sep 2021 17:40:47 -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: <202109292127.7q66qhxhde67@alvherre.pgsql> 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 9/29/21 5:27 PM, Alvaro Herrera wrote: > 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 :-) It claims that but it's also used here: src/bin/pg_basebackup/t/010_pg_basebackup.pl (Also, good perl style would start purely internal method names with an underscore.) cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com