pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Stabilize 026_overwrite_contrecord test
5+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2026-09-08 a8e66b3086 c13e961c60 8f4dfcd8e6 7e321bb93e 66fca522c3 d874a3591c abea7cc043  Stabilize 026_overwrite_contrecord test
* Stabilize 026_overwrite_contrecord test
@ 2026-09-03 00:28  Fujii Masao <masao.fujii@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Fujii Masao @ 2026-09-03 00:28 UTC (permalink / raw)
  To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

Hi,

I investigated the 026_overwrite_contrecord.pl test failure reported by
buildfarm member skink [1], since it occurred just after commit
5d13f753054 that I pushed. The failure seems unrelated to that commit,
though.

The test failed while starting the standby:

    31/324 recovery - postgresql:recovery/026_overwrite_contrecord
    ERROR 324.69s (exit status 255 or 0xff)

The primary took long enough to generate WAL that a time-based checkpoint
occurred before the test stopped it:

    LOG:  checkpoint starting: time
    LOG:  checkpoint complete: ... lsn=0/2093DC8, redo lsn=0/1F8F6A0

The test then removed the tail WAL segment as part of its test scenario.
Because the checkpoint record was in that segment, the standby initialized
from the resulting backup could not find the checkpoint record and failed
with a PANIC:

    LOG:  invalid checkpoint record
    PANIC:  could not locate a valid checkpoint record at 0/2093DC8

So, it seems that the unrelated checkpoint activity caused the test
failure.

The attached patch fixes this by setting checkpoint_timeout high enough
to prevent unrelated checkpoints during this test. This follows the same
approach used by other recovery tests, such as 043_no_contrecord_switch.pl.

Thoughts?

Regards,

[1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink&dt=2026-09-02%2020%3A46%3A37

-- 
Fujii Masao

Attachments:

v1-0001-Stabilize-026_overwrite_contrecord-test.patch (application/octet-stream, 1.7K) download From 36bf002beaf5359981ab5099d339d730e1ea4f3c Mon Sep 17 00:00:00 2001 From: Fujii Masao <fujii@postgresql.org> Date: Thu, 3 Sep 2026 08:20:51 +0900 Subject: [PATCH v1] Stabilize 026_overwrite_contrecord test On slow machines, this test can take long enough to generate WAL that a time-based checkpoint occurs before the primary is stopped. If the checkpoint record is written to the tail WAL segment that the test later removes, a standby initialized from the resulting backup tries to read the missing checkpoint record and fails with a PANIC during startup. This caused the test to fail on buildfarm member skink. Fix this by setting checkpoint_timeout high enough to prevent unrelated checkpoints during the test. This follows the approach used by other recovery tests, such as 043_no_contrecord_switch.pl, that depend on a specific WAL layout. Backpatch to all supported versions. --- src/test/recovery/t/026_overwrite_contrecord.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/recovery/t/026_overwrite_contrecord.pl b/src/test/recovery/t/026_overwrite_contrecord.pl index 82567ca6bfc..8db06739902 100644 --- a/src/test/recovery/t/026_overwrite_contrecord.pl +++ b/src/test/recovery/t/026_overwrite_contrecord.pl @@ -17,10 +17,13 @@ use Test::More; my $node = PostgreSQL::Test::Cluster->new('primary'); $node->init(allows_streaming => 1); -# We need these settings for stability of WAL behavior. +# We need these settings for stability of WAL behavior. checkpoint_timeout +# avoids noise from checkpoint activity, and autovacuum is disabled to avoid +# any WAL activity generated by it. $node->append_conf( 'postgresql.conf', qq( autovacuum = off +checkpoint_timeout = '30min' wal_keep_size = 1GB )); $node->start; -- 2.55.0
^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: Stabilize 026_overwrite_contrecord test
@ 2026-09-03 00:33  Michael Paquier <michael@paquier.xyz>
  parent: Fujii Masao <masao.fujii@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Michael Paquier @ 2026-09-03 00:33 UTC (permalink / raw)
  To: Fujii Masao <masao.fujii@gmail.com>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On Thu, Sep 03, 2026 at 09:28:22AM +0900, Fujii Masao wrote:
> The attached patch fixes this by setting checkpoint_timeout high enough
> to prevent unrelated checkpoints during this test. This follows the same
> approach used by other recovery tests, such as 043_no_contrecord_switch.pl.

Yes, this failure is also something that was puzzling me a bit, but I
did not take the time to dig into it.  Enforcing a larger checkpoint
timeout sounds like a safety measure good enough, at quick glance.

Thanks.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Stabilize 026_overwrite_contrecord test
@ 2026-09-03 17:00  Alexander Lakhin <exclusion@gmail.com>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 5+ messages in thread

From: Alexander Lakhin @ 2026-09-03 17:00 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; Fujii Masao <masao.fujii@gmail.com>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

Hello Michael and Fujii-san,

03.09.2026 03:33, Michael Paquier wrote:
> On Thu, Sep 03, 2026 at 09:28:22AM +0900, Fujii Masao wrote:
>> The attached patch fixes this by setting checkpoint_timeout high enough
>> to prevent unrelated checkpoints during this test. This follows the same
>> approach used by other recovery tests, such as 043_no_contrecord_switch.pl.
> Yes, this failure is also something that was puzzling me a bit, but I
> did not take the time to dig into it.  Enforcing a larger checkpoint
> timeout sounds like a safety measure good enough, at quick glance.

Please look at:
https://wiki.postgresql.org/wiki/Known_Buildfarm_Test_Failures

where all such failures are enumerated with links to corresponding
reports/discussions, e.g. I reported this one previously:
https://www.postgresql.org/message-id/9ffdb19a-7a89-424e-925a-dd981c37f0ba%40gmail.com

Best regards,
Alexander

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Stabilize 026_overwrite_contrecord test
@ 2026-09-04 14:02  Fujii Masao <masao.fujii@gmail.com>
  parent: Alexander Lakhin <exclusion@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Fujii Masao @ 2026-09-04 14:02 UTC (permalink / raw)
  To: Alexander Lakhin <exclusion@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On Fri, Sep 4, 2026 at 2:00 AM Alexander Lakhin <exclusion@gmail.com> wrote:
> 03.09.2026 03:33, Michael Paquier wrote:
> Yes, this failure is also something that was puzzling me a bit, but I
> did not take the time to dig into it.  Enforcing a larger checkpoint
> timeout sounds like a safety measure good enough, at quick glance.

Thanks!

> where all such failures are enumerated with links to corresponding
> reports/discussions, e.g. I reported this one previously:
> https://www.postgresql.org/message-id/9ffdb19a-7a89-424e-925a-dd981c37f0ba%40gmail.com

Thanks for the pointer!

Reading your previous report, my understanding is that the failure was
also caused by a checkpoint during the test. So the proposed fix, which
increases checkpoint_timeout to prevent such checkpoints,
seems consistent with that analysis.

So, barring any objections, I'll commit the patch.

Regards,

-- 
Fujii Masao






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Stabilize 026_overwrite_contrecord test
@ 2026-09-08 07:52  Fujii Masao <masao.fujii@gmail.com>
  parent: Fujii Masao <masao.fujii@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Fujii Masao @ 2026-09-08 07:52 UTC (permalink / raw)
  To: Alexander Lakhin <exclusion@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On Fri, Sep 4, 2026 at 11:02 PM Fujii Masao <masao.fujii@gmail.com> wrote:
> So, barring any objections, I'll commit the patch.

I've pushed the patch. Thanks!

Regards,

-- 
Fujii Masao






^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2026-09-08 07:52 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03 00:28 Stabilize 026_overwrite_contrecord test Fujii Masao <masao.fujii@gmail.com>
2026-09-03 00:33 ` Michael Paquier <michael@paquier.xyz>
2026-09-03 17:00   ` Alexander Lakhin <exclusion@gmail.com>
2026-09-04 14:02     ` Fujii Masao <masao.fujii@gmail.com>
2026-09-08 07:52       ` Fujii Masao <masao.fujii@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox