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 1pusk3-00015F-9M for pgsql-hackers@arkaria.postgresql.org; Fri, 05 May 2023 10:32:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pusk0-0001KO-NS for pgsql-hackers@arkaria.postgresql.org; Fri, 05 May 2023 10:32:44 +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 1pusk0-0001KF-Dc for pgsql-hackers@lists.postgresql.org; Fri, 05 May 2023 10:32:44 +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 1pusjs-000iaV-Mk for pgsql-hackers@lists.postgresql.org; Fri, 05 May 2023 10:32:43 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f18dacd392so10784015e9.0 for ; Fri, 05 May 2023 03:32:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683282755; x=1685874755; 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=CpgHNgc8Wqoeq5qAi2h3LUbVFni0SoMTaNaOrSctPF8=; b=AeQzuwoiWLZuIIfPT6kDw78o4hE18ZKhtTEpupod3z8MCu8aXiQOgws/moJb6wLvHq ECuapGhYbihe6CAwYtsm68eLT1YiwooCTLsCuR3PFJ206H/hiIqZCKCp0d/Ur839bKpd niZiHmdSJT4ySYLvrTwMsIVGq5tams39eE60QfBVG8Jo9316wWPKeA/TJkGZSeD+pnBv zUeRLL7pvY/XM7kXzj4hJxhAXRBkzVrGJcRIXk00ksauC8BZ28FQQ7yL6T0trEGVS3Sy UbE8VhOvijcCyolRU3OPsY7zHC74KmBB5B1/F7SxPnPlBplGKGPJcLg+veqXVyk9J/7O 3M7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683282755; x=1685874755; 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=CpgHNgc8Wqoeq5qAi2h3LUbVFni0SoMTaNaOrSctPF8=; b=IXyFzNstgY1x+eoKIsrv8Mc8CkvGdy2CY5hzPhKelhbwRTiviCaThQdMa6IjGvSlyC n/QTO8PQ3oSfq4y/1BzBxeYlpx0ZK8UPUchSOuFhmEBQWQWFQR3da9hBF13MvAzd/fHf pA0ys5xplP0KtKymWOgSJ8Vmznc2/oBH+H5nTFNmq86E6rqS3Og3PGYCSdPMzW2HmtBc Pgw6/MKoXxpVuOC9lR5R6kaWhtwUaQRZa0aRxU2yKoxOc52BvCjlHfp9FDl8jI6G0gpq Jn5TedvhmRRPQJak40EVEBI8GW0vbD+M/1k7GC4ZKFtb6UHEECweg2luhGwg2HZRPVwt 8V2g== X-Gm-Message-State: AC+VfDw/lcs7rYHfUc4EUDmfbXabhe0Zly6/+ozKGCeAS+GnQF6pbgLx zyLUiMpqPGX0xcszQ92+zFU= X-Google-Smtp-Source: ACHHUZ7mLWDryEjYJp2l7FRIjz/QqzqrTb1nSxg7/HjNkg8rGaQmuQ+51ExZ3/dPOLHxEHkoguYbiA== X-Received: by 2002:a7b:c017:0:b0:3f1:94fe:65e0 with SMTP id c23-20020a7bc017000000b003f194fe65e0mr714951wmb.26.1683282754834; Fri, 05 May 2023 03:32:34 -0700 (PDT) Received: from [192.168.7.14] ([54.239.6.185]) by smtp.gmail.com with ESMTPSA id f24-20020a1cc918000000b003f0ad8d1c69sm7530907wmb.25.2023.05.05.03.32.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 May 2023 03:32:34 -0700 (PDT) Message-ID: <2c544b9f-419d-d18e-47be-f3d6f3d24e4e@gmail.com> Date: Fri, 5 May 2023 12:32:33 +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> <74f80bc1-6b39-b2a8-c716-98beefb75e0b@gmail.com> <17b6b056-4f53-c444-0c94-869547d1a5df@gmail.com> <054defef-de15-53e4-6c5a-d16ccc21d4ba@gmail.com> <8a13f0d8-71f3-773b-7135-5974fd53724b@gmail.com> <6711e200-0d5c-98c3-ba39-7d64a6936f7a@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 11:29 AM, Amit Kapila wrote: > On Fri, May 5, 2023 at 1:16 PM Drouvot, Bertrand > wrote: >> >> >> After multiple attempts, I got one failing one. >> >> Issue is that we expect this file to be removed: >> >> [07:24:27.261](0.899s) #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 >> >> But the standby emits: >> >> 2023-05-05 07:24:27.216 UTC [17909][client backend] [035_standby_logical_decoding.pl][3/6:0] LOG: statement: checkpoint; >> 2023-05-05 07:24:27.216 UTC [17745][checkpointer] LOG: restartpoint starting: immediate wait >> 2023-05-05 07:24:27.259 UTC [17745][checkpointer] LOG: attempting to remove WAL segments older than log file 000000000000000000000002 >> >> So it seems the test is not right (missing activity??), not sure why yet. >> > > Can you try to print the value returned by > XLogGetReplicationSlotMinimumLSN() in KeepLogSeg() on standby? Also, > please try to print "attempting to remove WAL segments ..." on the > primary. We can see, if by any chance some slot is holding us to > remove the required WAL file. > I turned DEBUG2 on. We can also see on the primary: 2023-05-05 08:23:30.843 UTC [16833][checkpointer] LOCATION: CheckPointReplicationSlots, slot.c:1576 2023-05-05 08:23:30.844 UTC [16833][checkpointer] DEBUG: 00000: snapshot of 0+0 running transaction ids (lsn 0/40000D0 oldest xid 746 latest complete 745 next xid 746) 2023-05-05 08:23:30.844 UTC [16833][checkpointer] LOCATION: LogCurrentRunningXacts, standby.c:1377 2023-05-05 08:23:30.845 UTC [16833][checkpointer] LOG: 00000: BDT1 about to call RemoveOldXlogFiles in CreateCheckPoint 2023-05-05 08:23:30.845 UTC [16833][checkpointer] LOCATION: CreateCheckPoint, xlog.c:6835 2023-05-05 08:23:30.845 UTC [16833][checkpointer] LOG: 00000: attempting to remove WAL segments older than log file 000000000000000000000002 2023-05-05 08:23:30.845 UTC [16833][checkpointer] LOCATION: RemoveOldXlogFiles, xlog.c:3560 2023-05-05 08:23:30.845 UTC [16833][checkpointer] DEBUG: 00000: recycled write-ahead log file "000000010000000000000001" 2023-05-05 08:23:30.845 UTC [16833][checkpointer] LOCATION: RemoveXlogFile, xlog.c:3708 2023-05-05 08:23:30.845 UTC [16833][checkpointer] DEBUG: 00000: recycled write-ahead log file "000000010000000000000002" 2023-05-05 08:23:30.845 UTC [16833][checkpointer] LOCATION: RemoveXlogFile, xlog.c:3708 2023-05-05 08:23:30.845 UTC [16833][checkpointer] DEBUG: 00000: SlruScanDirectory invoking callback on pg_subtrans/0000 So, 000000010000000000000003 is not removed on the primary. It has been recycled on: 2023-05-05 08:23:38.605 UTC [16833][checkpointer] DEBUG: 00000: recycled write-ahead log file "000000010000000000000003" Which is later than the test: [08:23:31.931](0.000s) not ok 19 - invalidated logical slots do not lead to retaining WAL FWIW, the failing test with DEBUG2 can be found there: https://cirrus-ci.com/task/5615316688961536 Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com