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 1prxH2-0002fT-7z for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Apr 2023 08:46:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1prxGz-0004RD-Qa for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Apr 2023 08:46:41 +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 1prxGz-0004R4-Gy for pgsql-hackers@lists.postgresql.org; Thu, 27 Apr 2023 08:46:41 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1prxGw-005LPq-FA for pgsql-hackers@postgresql.org; Thu, 27 Apr 2023 08:46:40 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-2f625d52275so7876199f8f.3 for ; Thu, 27 Apr 2023 01:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682585197; x=1685177197; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=L/dVqRCNr9VrnhfqeLU/sUtgHa8M9amqJdZhcD7HGZo=; b=UN7d67u+f1B1bAXIOkztlJDiNHT7RSuhMV3uv95zH4KhNCRIBP1xlQMnIqO3VzFEnE UYQRdoup59rM8O1HTWk/cL/Mx43UeHyY3LstDTqudXA11N+rqESfKBfFb7UKpLEYItku BbmKCaOAFYAp9nFm/C8HcYWkjPSumYf7mxidL20QrgEo5pwhrEwiEBkhWtjlizVmNtIQ 8XIL6JuNwGr6cRL3Lb27asH2X+kXUOBcI+0OjsWNvtQkZQiHuCMTopltlcL7iat3QXKT PRd5H29naoVYjmIUgiXXNLdhV28DZ/3zFDDz5X/Eb1MNYDigrJlfRw9pZz4E9z2uaREt 09gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682585197; x=1685177197; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=L/dVqRCNr9VrnhfqeLU/sUtgHa8M9amqJdZhcD7HGZo=; b=hOebR/7YjkljnzVY3eKV+L/b5g7+zrnQTLLDYY6bYjmwaGr+1/LMaWgnTIEBXMpJtU LCN1Hju8UB60sONApUEye1CB5ZLXJkR2gn9aRGdPMSf0QnnYMZ8fAPrRahoeq/c5SHh6 Ui5WTHQMEUHp4oCm0thi9aghuznCNZqGwqcnBtDfAzeo+DPFt1LFZtjc7k5QDuO1cDNz AdHArzT+Qgnl28/eYJr7F0lvHcs8fL9NhzvdoyRViQDm5suyiXHOqv9VYmUbu2QL+5Xm Wi01Kj79R+aGpCUQaaqPkgKukjgRCFm+41OH+scRxgEMWx+tIa2XanJiuiAOLNMCQn0r HpmQ== X-Gm-Message-State: AC+VfDyNhpZ5KwC2yST+KaLrnjoJyMzbUJliLvc3DSYX+ebhOGbRvZTs isBEJxZ7vHEErjw6sFPhp9A= X-Google-Smtp-Source: ACHHUZ4413bX7h+CzfDJKntq9KYb5/ax8Nqgut4AFA0BgLN0a93jc79+0C3zGnmDkjh1SmdY1VtfBg== X-Received: by 2002:a5d:6748:0:b0:2ce:a34b:2b0b with SMTP id l8-20020a5d6748000000b002cea34b2b0bmr728324wrw.28.1682585196608; Thu, 27 Apr 2023 01:46:36 -0700 (PDT) Received: from [192.168.29.250] ([54.239.6.185]) by smtp.gmail.com with ESMTPSA id g3-20020a5d5543000000b002fe254f6c33sm17856855wrw.92.2023.04.27.01.46.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Apr 2023 01:46:36 -0700 (PDT) Message-ID: <1b59d63b-8e89-17f7-685e-24ae23d04924@gmail.com> Date: Thu, 27 Apr 2023 10:46:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: Fix a test case in 035_standby_logical_decoding.pl Content-Language: en-US To: "Yu Shi (Fujitsu)" , "pgsql-hackers@postgresql.org" References: From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 4/27/23 10:11 AM, Yu Shi (Fujitsu) wrote: > Hi hackers, > > In 035_standby_logical_decoding.pl, I think that the check in the following test > case should be performed on the standby node, instead of the primary node, as > the slot is created on the standby node. Oh right, the current test is not done on the right node, thanks! > The test currently passes because it > only checks the return value of psql. It might be more appropriate to check the > error message. Agree, and it's consistent with what is being done in 006_logical_decoding.pl. > Please see the attached patch. > + +($result, $stdout, $stderr) = $node_standby->psql( 'otherdb', "SELECT lsn FROM pg_logical_slot_peek_changes('behaves_ok_activeslot', NULL, NULL) ORDER BY lsn DESC LIMIT 1;" - ), - 3, - 'replaying logical slot from another database fails'); + ); +ok( $stderr =~ + m/replication slot "behaves_ok_activeslot" was not created in this database/, + "replaying logical slot from another database fails"); That does look good to me. Nit: I wonder if while at it (as it was already there) we could not remove the " ORDER BY lsn DESC LIMIT 1" part of it. It does not change anything regarding the test but looks more appropriate to me. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com