BUG #18860: Test src/test/recovery/t/039_end_of_wal.pl is unstable - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18860: Test src/test/recovery/t/039_end_of_wal.pl is unstable
Date
Msg-id 18860-cdf46cd6dbf49448@postgresql.org
Whole thread Raw
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18860
Logged by:          RekGRpth
Email address:      rekgrpth@gmail.com
PostgreSQL version: 17.4
Operating system:   docker alpine
Description:

Test src/test/recovery/t/039_end_of_wal.pl is unstable.

I added the size of the WAL-file during initialization

```diff
diff --git a/src/test/recovery/t/039_end_of_wal.pl
b/src/test/recovery/t/039_end_of_wal.pl
index eb1e051d43d..1aa577bf7c1 100644
--- a/src/test/recovery/t/039_end_of_wal.pl
+++ b/src/test/recovery/t/039_end_of_wal.pl
@@ -112,7 +112,7 @@ sub build_page_header
 # set to "minimal" avoids random standby snapshot records.  Autovacuum
 # could also trigger randomly, generating random WAL activity of its own.
 my $node = PostgreSQL::Test::Cluster->new("node");
-$node->init;
+$node->init(extra => ['--wal-segsize=1']);
 $node->append_conf(
     'postgresql.conf',
     q[wal_level = minimal
```

The test failed
```sh
#   Failed test 'xlp_magic zero'
#   at t/039_end_of_wal.pl line 222.
# Looks like you failed 1 test of 14.
t/039_end_of_wal.pl .. 
# initializing database system by running initdb
# Single-page end-of-WAL detection
ok 1 - xl_tot_len zero
ok 2 - xl_tot_len short
ok 3 - xl_tot_len short at end-of-page
ok 4 - xl_prev bad
ok 5 - xl_crc bad
# Multi-page end-of-WAL detection, header is not split
not ok 6 - xlp_magic zero
ok 7 - xlp_magic bad
ok 8 - xlp_pageaddr bad
ok 9 - xlp_info bad
ok 10 - xlp_info lacks XLP_FIRST_IS_CONTRECORD
ok 11 - xlp_rem_len bad
# Multi-page, but header is split, so page checks are done first
ok 12 - xlp_magic zero (split record header)
ok 13 - xlp_pageaddr bad (split record header)
ok 14 - xlp_rem_len bad (split record header)
1..14
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/14 subtests 

Test Summary Report
-------------------
t/039_end_of_wal.pl (Wstat: 256 (exited 1) Tests: 14 Failed: 1)
  Failed test:  6
  Non-zero exit status: 1
Files=1, Tests=14,  5 wallclock secs ( 0.01 usr  0.00 sys +  1.04 cusr  0.44
csys =  1.49 CPU)
Result: FAIL
```
with error
```sql
unexpected pageaddr 0/114000 in WAL segment 000000010000000000000006, LSN
0/614000, offset 81920
```


pgsql-bugs by date:

Previous
From: Andrei Lepikhov
Date:
Subject: Re: BUG #18854: PostgreSQL chooses a suboptimal execution plan when using a specific WHERE filter
Next
From: PG Bug reporting form
Date:
Subject: BUG #18861: Not able to download rpm package