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 1pquza-0004vp-64 for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Apr 2023 12:08:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pquzZ-0005jm-5O for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Apr 2023 12:08:25 +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 1pquzY-0005jc-Rp for pgsql-hackers@lists.postgresql.org; Mon, 24 Apr 2023 12:08:24 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pquzS-004nLt-5U for pgsql-hackers@lists.postgresql.org; Mon, 24 Apr 2023 12:08:24 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f178da219bso43401785e9.1 for ; Mon, 24 Apr 2023 05:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682338096; x=1684930096; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=epOTGwr0ndkGOoZRPJwQjbVG3QNBrz5z8MIDavZEenQ=; b=WMK4a0PzASmZ2PDvzPQGhD6HUGsWwxH1qFsu7HP79nRWhJYQGx6K+uYumtwIzvpw5F Bydwc6pBezYVZ7foKWTZ3YEr5SQ/MMpXFm8hQhO0jRpqWIR5P/d+cPXydhsk1vfnWJOo LMYyg9BESpwVp4Od8pxbqgphNh5t2L4uWUuBA1yvfubRha37AUS5TgRAbjjkUnymO0Az YLpZvtNyVkS1sQBh4l+tacJJ+TUc0uIqYlPl5gmpqxibWh165C9Leo3wyXVcr7hWeiaC +cFNM/xffsG7vEDTx3tvkNAHPJlcKRTMr/SQCsA1vujLMDLw1i0rO6sO1yKi+dlI1qqX AeIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682338096; x=1684930096; h=content-transfer-encoding:in-reply-to:from:references:cc: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=epOTGwr0ndkGOoZRPJwQjbVG3QNBrz5z8MIDavZEenQ=; b=HM+vXowjzdKVG6mJLI4qer0898CD1aEKPwMDcERp0nd4inxjr8CYIHqDhnQRUPYmkv aSmMoLLxW2yoOAv7nEPNTM4Fty3nD3/CPLxu6NYBQA+EElnIa7u8innzHFzAS8+1rARX /vI+rv2/7/6vbhFNoAyD0XAAvxW8EuJNlBSPtHKW2gVvc4i1CB3Sx50qnMSK0ormSnOW lqOu6T8GGTCOMgJIoXvafYI5U5y9ETDDbGYKllFL3uf6AzF7CZVVApCaG7e4gCuvC8/K DJthaSNTB9MW6ml+0Lj5/djKjTTsDI9SA/EWpT/MxJXV7Y8fqcvH1LjCb2A8IC9kRLpw 1/yg== X-Gm-Message-State: AAQBX9d7g/KoWECKRksb1yMCBK9nZqdk81B6oCE1Zml9SyYk9AuIlHVV Yq8JSljDp1h10KIrIVDAMBE= X-Google-Smtp-Source: AKy350bd0UVp8ABnkC5b5a/kGGhsbW+Sa1h0aZHjUQHWosCqFueBkHiGRMdarPNaAnEwnKLrUP+hAA== X-Received: by 2002:a1c:f30e:0:b0:3f1:6d22:eaa0 with SMTP id q14-20020a1cf30e000000b003f16d22eaa0mr7791955wmq.2.1682338096251; Mon, 24 Apr 2023 05:08:16 -0700 (PDT) Received: from [192.168.22.124] ([54.239.6.184]) by smtp.gmail.com with ESMTPSA id m10-20020a5d56ca000000b002c54c9bd71fsm10646808wrw.93.2023.04.24.05.08.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Apr 2023 05:08:15 -0700 (PDT) Message-ID: <74f80bc1-6b39-b2a8-c716-98beefb75e0b@gmail.com> Date: Mon, 24 Apr 2023 14:06:59 +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.0 Subject: Re: Add two missing tests in 035_standby_logical_decoding.pl Content-Language: en-US To: Amit Kapila Cc: vignesh C , PostgreSQL Hackers References: <2fefa454-5a70-2174-ddbf-4a0e41537139@gmail.com> <9ab1827c-9a57-8c48-59b2-c5fb62c21be3@gmail.com> From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 4/24/23 11:45 AM, Amit Kapila wrote: > On Mon, Apr 24, 2023 at 11:54 AM Amit Kapila wrote: >> >> On Mon, Apr 24, 2023 at 11:24 AM Drouvot, Bertrand >> wrote: >>> >> >> Few comments: >> ============ >> > > +# We can not test if the WAL file still exists immediately. > +# We need to let some time to the standby to actually "remove" it. > +my $i = 0; > +while (1) > +{ > + last if !-f $standby_walfile; > + if ($i++ == 10 * $default_timeout) > + { > + die > + "could not determine if WAL file has been retained or not, can't continue"; > + } > + usleep(100_000); > +} > > Is this adhoc wait required because we can't guarantee that the > checkpoint is complete on standby even after using wait_for_catchup? Yes, the restart point on the standby is not necessary completed even after wait_for_catchup is done. > Is there a guarantee that it can never fail on some slower machines? > We are waiting here at a maximum for 10 * $default_timeout (means 3 minutes) before we time out. Would you prefer to wait more than 3 minutes at a maximum? > BTW, for the second test is it necessary that we first ensure that the > WAL file has not been retained on the primary? > I was not sure it's worth it too. Idea was more: it's useless to verify it is removed on the standby if we are not 100% sure it has been removed on the primary first. But yeah, we can get rid of this test if you prefer. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com