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 1puwLT-0002th-QT for pgsql-hackers@arkaria.postgresql.org; Fri, 05 May 2023 14:23:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1puwLS-00073m-Na for pgsql-hackers@arkaria.postgresql.org; Fri, 05 May 2023 14:23:38 +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 1puwLR-00073d-IC for pgsql-hackers@lists.postgresql.org; Fri, 05 May 2023 14:23:38 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1puwLO-000gkd-L8 for pgsql-hackers@lists.postgresql.org; Fri, 05 May 2023 14:23:36 +0000 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-2f58125b957so1723782f8f.3 for ; Fri, 05 May 2023 07:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683296613; x=1685888613; 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=iNnJP4C/ERMOEpcW+0BBb4pXQBJeZTtMXNk9pcYiaeU=; b=m8zMyVkMk1UB7mKGPeNXivq8WImsgUXBH2QviqCWWzx0XbqCE0KQe2HmsYz57sE/B7 wkVAxJtXTF06pVvlXQC+vzaxp70VH4gVSBXXZxLku2hgQUe9fY4wGB0yb2iJuzkKdu7B RaEYR41xTniuD1QuAM2cx70A6pF5pV3IcgaL+dTPRbwVA8lkyXGI42/xdd9FddFJHVg8 PRC4Q4GpoyL0sq7lJoHG0wb2t/7r84YKjKz3oZVKX/T6yqfBJyva960hc0YHraewYc/h 5Ar4fJF1ryJZpUFnJwNX2UlVA8fu29A35axr8G0LhEg1vFWrr8b58iplTv10XK4I+yJm 8puQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683296613; x=1685888613; 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=iNnJP4C/ERMOEpcW+0BBb4pXQBJeZTtMXNk9pcYiaeU=; b=FAeknDqha04FG1Q5wuDHH55n+zeLOCfA14K3lg1hBEbAJI+hin+3iiPgrwkiq3juiI wauTeguGYC0Yv9s0FTkeJWCTZrrGNueYA2vjwGZ6+k6ITpJE1DHYpWz1pgtMeME8RJ5P 5V5jrD6eF7fW9EjR27HXA9xgrQ2RRWkSjHQKUvrWbHmVkSfEozRfcszF33UEy8cQmXuv wg0quhcY/Tvx2JJ54BALBi23AJrBYIcdclIBztypK+t4jAAsWapUYMIR52LrZl/zlIoP y6Oov2e9O6CrYz2ZRcvHC8ZeFlEbdwLOMxFxwzjcz90xemTAAlHgWwz3bmWkrULKTEDe pdbA== X-Gm-Message-State: AC+VfDxMMl7u2nRlSkPIOwsq0ldamrgDvTgm4GnOVVxmI2TLIcnqRTvn 1PIac9/MCA5a2TtK70o7HZw= X-Google-Smtp-Source: ACHHUZ6NWEhpFOC6ii29rGeBKey9T+5JuSJKFgqc4pjGzTcjDNWEj57IJOwYhdADBO6ZJLI05KdPzw== X-Received: by 2002:a05:6000:1148:b0:2fa:88f2:b04c with SMTP id d8-20020a056000114800b002fa88f2b04cmr1778172wrx.20.1683296613069; Fri, 05 May 2023 07:23:33 -0700 (PDT) Received: from [192.168.7.14] ([54.239.6.185]) by smtp.gmail.com with ESMTPSA id u1-20020a5d4681000000b003062f894b64sm2609249wrq.22.2023.05.05.07.23.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 May 2023 07:23:32 -0700 (PDT) Message-ID: <3576f684-718d-ddd6-f4b0-f8ad64ad3330@gmail.com> Date: Fri, 5 May 2023 16:23:31 +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: Add two missing tests in 035_standby_logical_decoding.pl Content-Language: en-US To: Amit Kapila Cc: vignesh C , "Yu Shi (Fujitsu)" , PostgreSQL Hackers References: <2fefa454-5a70-2174-ddbf-4a0e41537139@gmail.com> <054defef-de15-53e4-6c5a-d16ccc21d4ba@gmail.com> <8a13f0d8-71f3-773b-7135-5974fd53724b@gmail.com> <6711e200-0d5c-98c3-ba39-7d64a6936f7a@gmail.com> <2c544b9f-419d-d18e-47be-f3d6f3d24e4e@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 On 5/5/23 2:28 PM, Amit Kapila wrote: > On Fri, May 5, 2023 at 5:36 PM Drouvot, Bertrand > wrote: > > It seems due to some reason the current wal file is not switched due > to some reason. Oh wait, here is a NON failing one: https://cirrus-ci.com/task/5086849685782528 (I modified the .cirrus.yml so that we can download the "testrun.zip" file even if the test is not failing). So, in this testrun.zip we can see, that the test is ok: $ grep -i retain ./build/testrun/recovery/035_standby_logical_decoding/log/regress_log_035_standby_logical_decoding [10:06:08.789](0.000s) ok 19 - invalidated logical slots do not lead to retaining WAL and that the WAL file we expect to be removed is: $ grep "WAL file is" ./build/testrun/recovery/035_standby_logical_decoding/log/regress_log_035_standby_logical_decoding [10:06:08.789](0.925s) # BDT WAL file is /Users/admin/pgsql/build/testrun/recovery/035_standby_logical_decoding/data/t_035_standby_logical_decoding_standby_data/pgdata/pg_wal/000000010000000000000003 This WAL file has been removed by the standby: $ grep -i 000000010000000000000003 ./build/testrun/recovery/035_standby_logical_decoding/log/035_standby_logical_decoding_standby.log | grep -i recy 2023-05-05 10:06:08.787 UTC [17521][checkpointer] DEBUG: 00000: recycled write-ahead log file "000000010000000000000003" But on the primary, it has been recycled way after that time: $ grep -i 000000010000000000000003 ./build/testrun/recovery/035_standby_logical_decoding/log/035_standby_logical_decoding_primary.log | grep -i recy 2023-05-05 10:06:13.370 UTC [16785][checkpointer] DEBUG: 00000: recycled write-ahead log file "000000010000000000000003" As, the checkpoint on the primary after the WAL file switch only recycled (001 and 002): $ grep -i recycled ./build/testrun/recovery/035_standby_logical_decoding/log/035_standby_logical_decoding_primary.log 2023-05-05 10:05:57.196 UTC [16785][checkpointer] LOG: 00000: checkpoint complete: wrote 4 buffers (3.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.001 s, total=0.027 s; sync files=0, longest=0.000 s, average=0.000 s; distance=11219 kB, estimate=11219 kB; lsn=0/2000060, redo lsn=0/2000028 2023-05-05 10:06:08.138 UTC [16785][checkpointer] DEBUG: 00000: recycled write-ahead log file "000000010000000000000001" 2023-05-05 10:06:08.138 UTC [16785][checkpointer] DEBUG: 00000: recycled write-ahead log file "000000010000000000000002" 2023-05-05 10:06:08.138 UTC [16785][checkpointer] LOG: 00000: checkpoint complete: wrote 20 buffers (15.6%); 0 WAL file(s) added, 0 removed, 2 recycled; write=0.001 s, sync=0.001 s, total=0.003 s; sync files=0, longest=0.000 s, average=0.000 s; distance=32768 kB, estimate=32768 kB; lsn=0/40000D0, redo lsn=0/4000098 So, even on a successful test, we can see that the WAL file we expect to be removed on the standby has not been recycled on the primary before the test. > I think we need to add more DEBUG info to find that > out. Can you please try to print 'RedoRecPtr', '_logSegNo', and > recptr? > Yes, will do. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com