Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uQjDo-00GaWE-5W for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Jun 2025 09:00:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uQjDk-00C6Em-Qd for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Jun 2025 09:00:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uQjDk-00C6Ed-FV for pgsql-hackers@lists.postgresql.org; Sun, 15 Jun 2025 09:00:09 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uQjDi-0029Qn-1y for pgsql-hackers@postgresql.org; Sun, 15 Jun 2025 09:00:08 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43ea40a6e98so41899515e9.1 for ; Sun, 15 Jun 2025 02:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749978003; x=1750582803; darn=postgresql.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=zaIeVcHtERPiCsvsanVX7NZKrJMd8muIrhT65SAFU+I=; b=UH7njQ7gxOyjPV154+BL94UDlm2+s1AO1QXPQuPbpLcxrdH0daPqiRWWIdR0vZ97x3 /nPJz0MhJeM87iMf2W1FHAmdWR1y5TebZD0mTYXPPxbPUjIqmg8VZ6N6fN7ZElXIpbvk fbI2+JygVfBOVF+ibb4RHYJpkkbx4Qv+gMszZpCQP21xNDbZcIAxfn4hxkY+W2q6b7yj tTTf+tXA3odeCxKNvEMDNKc8VfP2XmRIuUFr2dBe0z+ddzj4BUBrQDb3LsCmIozAXNUE oyIc3JTUB41x3/ndromFM+KKvTkwe7n35k0Ww8GJYwwgD4+EhVi2sjGgZRnfEwsQjWev ECxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749978003; x=1750582803; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=zaIeVcHtERPiCsvsanVX7NZKrJMd8muIrhT65SAFU+I=; b=lTpafqoqF1QW230t/JMI+k8vRGf2qR36zZSzjLj0dtSFQiJbM1sGJC3jU8rSNOxDa6 NiPnVBHlDHA5+LowvNCIsVZLsCVKHXlbfrvc+ZMGjgp9OkSLpa+/06ovtMmmArvNooEE DAP6H3FyYPjLcbWcLN9BtHzFHI24eBKRqoxgqsU8yf06SYNu24fiynNCEgf9+l8kar0r r65Yc0P+gU7SelXd7dBUV9O9sAc6zgXZ5GTO6kechas+9afzXMq6Ut57AyTlwnqxHYFG pfnMbOqJxoGcsQISIPaHMBmWutobj/mKQtvw2y15QjGX6DmNJ8RKt8XsMbfj65zZfB7S gMHA== X-Forwarded-Encrypted: i=1; AJvYcCUgcXoTo+5NBclXFbB2viUnrUiZluIsBC7Vl/Ap7gxE+Mw4QEXFGhijnxzvwjKkYUkzMo4wV6N53/dpA1d6@postgresql.org X-Gm-Message-State: AOJu0YxUwYcewuvZEhy/77B0ga4MZU5KC7GQ9PY9siXEzG/t8Pk64cHw MEsmi7JEGjZfDqdtT0IuxjaWDW8o8eH4GkBL5YFkDLJTK/btLXVTFF0p X-Gm-Gg: ASbGncvUvChZlyvlw1wzxshmv34/wn72mXenOnyg/Fnyo0wRL3tzZnY6mr54uD0T2T3 doIUDNLB8g4YL3QsM14PIS0fJ0HriQxRvvQgyqEXVpPCPmf4pNpwDIT4oCgKhyldzj88GEJXRGI eN7z3ewHs06o/JR/uLXThylIyOACpExVkPqYNRHKsTxjxf36AeYQhxPIn4vbc3wqdW6pFR/pIsn jb0/316YDM/MOI/Rw0QO9Onx2PPtZoQxkn1Cm4CIQvQRq+RkcnFD/tifhyYvjN8K04yF/GYFDLj bAUo54okkFbyLpbbFr+PVpd5C6A/HFDraRIvpSbTa4vBX9VfbvDeHjNTSts7MjdBsQ== X-Google-Smtp-Source: AGHT+IGkJGPtA0akhV9pt3Jg9ylpg/gqtMRisET+t3ZIzTUbwRr1N1WCtz+KHoGLwGfZtWMay40NCw== X-Received: by 2002:a05:600c:638e:b0:450:cff7:62f9 with SMTP id 5b1f17b1804b1-4533caa5df0mr42446315e9.22.1749978002905; Sun, 15 Jun 2025 02:00:02 -0700 (PDT) Received: from [192.168.0.50] ([89.149.120.224]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4532e13c192sm104249785e9.26.2025.06.15.02.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Jun 2025 02:00:02 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------n1pkUVSC0MCJj7v5NmGvsX5M" Message-ID: Date: Sun, 15 Jun 2025 12:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly To: Alexander Korotkov , Vitaly Davydov Cc: Amit Kapila , pgsql-hackers , Masahiko Sawada , tomas@vondra.me References: <1d12d2-67235980-35-19a406a0@63439497> <2c1d-68344100-b7-3411b8c0@256938178> <1d97ec-6841b600-3-b7b4780@40747246> <28c8bf-68470780-3-51b29480@89454035> Content-Language: en-US From: Alexander Lakhin In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------n1pkUVSC0MCJj7v5NmGvsX5M Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello Alexander, 10.06.2025 23:14, Alexander Korotkov wrote: > So, my proposal is to commit the attached patchset to the HEAD, and > commit [1] to the back branches. Any objections? As the buildfarm animal prion shows [1], the 046_checkpoint_logical_slot test fails with "-DRELCACHE_FORCE_RELEASE -DCATCACHE_FORCE_RELEASE": # poll_query_until timed out executing this query: # #         SELECT count(*) > 0 FROM pg_stat_activity #         WHERE backend_type = 'client backend' AND wait_event = 'logical-replication-slot-advance-segment' # # expecting this output: # t # last actual query output: # f # with stderr: [04:16:27] t/046_checkpoint_logical_slot.pl ...... Dubious, test returned 29 (wstat 7424, 0x1d00) No subtests run [04:20:58] t/047_checkpoint_physical_slot.pl ..... ok   271294 ms ( 0.00 usr  0.00 sys +  0.37 cusr  0.26 csys =  0.63 CPU) I'm able to reproduce this locally as well. Though the test passes for me with the increased timeout, that is it's not stuck: PG_TEST_TIMEOUT_DEFAULT=360 PROVE_TESTS="t/046*" make -s check -C src/test/recovery/ # +++ tap check in src/test/recovery +++ t/046_checkpoint_logical_slot.pl .. ok All tests successful. Files=1, Tests=1, 533 wallclock secs ( 0.01 usr  0.00 sys +  4.70 cusr  9.61 csys = 14.32 CPU) Result: PASS Could you have a look? [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prion&dt=2025-06-14%2001%3A58%3A06 Best regards, Alexander --------------n1pkUVSC0MCJj7v5NmGvsX5M Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Hello Alexander,

10.06.2025 23:14, Alexander Korotkov wrote:
So, my proposal is to commit the attached patchset to the HEAD, and
commit [1] to the back branches.  Any objections?

As the buildfarm animal prion shows [1], the 046_checkpoint_logical_slot
test fails with "-DRELCACHE_FORCE_RELEASE -DCATCACHE_FORCE_RELEASE":
# poll_query_until timed out executing this query:
#
#         SELECT count(*) > 0 FROM pg_stat_activity
#         WHERE backend_type = 'client backend' AND wait_event = 'logical-replication-slot-advance-segment'
#     
# expecting this output:
# t
# last actual query output:
# f
# with stderr:
[04:16:27] t/046_checkpoint_logical_slot.pl ......
Dubious, test returned 29 (wstat 7424, 0x1d00)
No subtests run
[04:20:58] t/047_checkpoint_physical_slot.pl ..... ok   271294 ms ( 0.00 usr  0.00 sys +  0.37 cusr  0.26 csys =  0.63 CPU)

I'm able to reproduce this locally as well. Though the test passes for me
with the increased timeout, that is it's not stuck:
PG_TEST_TIMEOUT_DEFAULT=360 PROVE_TESTS="t/046*" make -s check -C src/test/recovery/
# +++ tap check in src/test/recovery +++
t/046_checkpoint_logical_slot.pl .. ok
All tests successful.
Files=1, Tests=1, 533 wallclock secs ( 0.01 usr  0.00 sys +  4.70 cusr  9.61 csys = 14.32 CPU)
Result: PASS

Could you have a look?

[1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prion&dt=2025-06-14%2001%3A58%3A06

Best regards,
Alexander
--------------n1pkUVSC0MCJj7v5NmGvsX5M--