public inbox for [email protected]  
help / color / mirror / Atom feed
Failing test_aio tests due to too low(illegal?) segsize_blocks
3+ messages / 2 participants
[nested] [flat]

* Failing test_aio tests due to too low(illegal?) segsize_blocks
@ 2026-04-08 06:51  Jakub Wartak <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Jakub Wartak @ 2026-04-08 06:51 UTC (permalink / raw)
  To: PostgreSQL Hackers <[email protected]>; +Cc: Andres Freund <[email protected]>

For some reason I've ended up using -Dsegsize_blocks=4 and I've started
getting ninja test errors after getting back from vacation leave like
below (so this test was included only since then):

stderr:
#   Failed test 'worker: normal: test reading of invalid block 2,3 in
larger read: expected stderr'
#   at /git/postgres/src/test/modules/test_aio/t/001_aio.pl line 989.
#                   'psql:<stdin>:55: ERROR:  read crossing segment boundary'
#     doesn't match '(?^:^psql:<stdin>:\d+: ERROR:  2 invalid pages
among blocks 1..4 of relation "base/.*/.*\nDETAIL:  Block 2 held the
first invalid page\.\nHINT:[^\n]+$)'
#   Failed test 'worker: normal: test zeroing of invalid block 2,3 in
larger read, ZERO_ON_ERROR: expected stderr'
#   at /git/postgres/src/test/modules/test_aio/t/001_aio.pl line 999.
#                   'psql:<stdin>:59: ERROR:  read crossing segment boundary'
#     doesn't match '(?^:^psql:<stdin>:\d+: WARNING:  zeroing out 2
invalid pages among blocks 1..4 of relation "base/.*/.*\nDETAIL:
Block 2 held the first zeroed page\.\nHINT:[^\n]+$)'
#   Failed test 'worker: normal: test zeroing of invalid block 2,3 in
larger read, zero_damaged_pages: expected stderr'
#   at /git/postgres/src/test/modules/test_aio/t/001_aio.pl line 1009.
#                   'psql:<stdin>:66: ERROR:  read crossing segment boundary'
[..]
#   at /git/postgres/src/test/modules/test_aio/t/001_aio.pl line 1353.
#                   'psql:<stdin>:62: ERROR:  read crossing segment boundary'
#     doesn't match '(?^:^psql:<stdin>:\d+: ERROR:  invalid page in
block 4 of relation "base/\d+/\d+"$)'
#   Failed test 'worker: test reading of valid block 1, checksum
failed 2, 3, invalid 3-5, zero=true: expected stderr'
#   at /git/postgres/src/test/modules/test_aio/t/001_aio.pl line 1375.
#                   'psql:<stdin>:77: ERROR:  read crossing segment boundary'
[..]

with segsize_blocks=5 I've got:

#   Failed test 'worker: temp rel: test reading of invalid block 4,
valid block 5: expected stderr'
#   at /git/postgres/src/test/modules/test_aio/t/001_aio.pl line 1158.
#                   'psql:<stdin>:66: ERROR:  read crossing segment boundary'
#     doesn't match '(?^:^psql:<stdin>:\d+: ERROR:  invalid page in
block 4 of relation "base/\d+/t\d+_\d+"$)'
#   Failed test 'worker: test reading of valid block 1, checksum
failed 2, 3, invalid 3-5, zero=true: expected stderr'
#   at /git/postgres/src/test/modules/test_aio/t/001_aio.pl line 1375.
#                   'psql:<stdin>:77: ERROR:  read crossing segment boundary'
#     doesn't match '(?^:^psql:<stdin>:\d+: WARNING:  zeroing 3
page\(s\) and ignoring 2 checksum failure\(s\) among blocks 1..5 of
relation ")'
# die: death by signal at
/git/postgres/src/test/perl/PostgreSQL/Test/Cluster.pm line 181.

.cirrus file show usage of segsize_blocks=6, and also 8 works fine without
errors, so it's just nuisance on my side, but it took some minutes for me
to realize this and I'll just ask maybe we should just block usage of
RELSEG_SIZE < 6 blocks in meson/configure? (patch attached)

-J.


Attachments:

  [text/x-patch] v1-0001-Limit-minimum-allowed-segsize-blocks-in-autoconf-.patch (1.9K, 2-v1-0001-Limit-minimum-allowed-segsize-blocks-in-autoconf-.patch)
  download | inline diff:
From 7156e31d14f1b2b37ee3b82a5ca4a8c69bbcf3a3 Mon Sep 17 00:00:00 2001
From: Jakub Wartak <[email protected]>
Date: Wed, 8 Apr 2026 08:47:25 +0200
Subject: [PATCH v1] Limit minimum allowed segsize-blocks in autoconf/meson to
 avoid blowing up tests

---
 configure    | 4 ++++
 configure.ac | 4 ++++
 meson.build  | 3 +++
 3 files changed, 11 insertions(+)

diff --git a/configure b/configure
index f66c1054a7a..af49854e7df 100755
--- a/configure
+++ b/configure
@@ -3796,6 +3796,10 @@ if test $segsize_blocks -ne 0 -a $segsize -ne 1; then
 $as_echo "$as_me: WARNING: both --with-segsize and --with-segsize-blocks specified, --with-segsize-blocks wins" >&2;}
 fi
 
+if test $segsize_blocks -ne 0 -a $segsize_blocks -lt 6; then
+  as_fn_error $? "too small segsize-blocks specified" "$LINENO" 5
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for segment size" >&5
 $as_echo_n "checking for segment size... " >&6; }
 if test $segsize_blocks -eq 0; then
diff --git a/configure.ac b/configure.ac
index 8d176bd3468..c01bfceb7a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -290,6 +290,10 @@ if test $segsize_blocks -ne 0 -a $segsize -ne 1; then
   AC_MSG_WARN([both --with-segsize and --with-segsize-blocks specified, --with-segsize-blocks wins])
 fi
 
+if test $segsize_blocks -ne 0 -a $segsize_blocks -lt 6; then
+  AC_MSG_ERROR([too small segsize-blocks specified])
+fi
+
 AC_MSG_CHECKING([for segment size])
 if test $segsize_blocks -eq 0; then
   # this expression is set up to avoid unnecessary integer overflow
diff --git a/meson.build b/meson.build
index be97e986e5d..d77343f5a64 100644
--- a/meson.build
+++ b/meson.build
@@ -512,6 +512,9 @@ if get_option('segsize_blocks') != 0
   if get_option('segsize') != 1
     warning('both segsize and segsize_blocks specified, segsize_blocks wins')
   endif
+  if get_option('segsize_blocks') < 6
+    error('too small segsize_blocks specified')
+  endif
 
   segsize = get_option('segsize_blocks')
 else
-- 
2.43.0



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

* Re: Failing test_aio tests due to too low(illegal?) segsize_blocks
@ 2026-04-08 18:57  Andres Freund <[email protected]>
  parent: Jakub Wartak <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Andres Freund @ 2026-04-08 18:57 UTC (permalink / raw)
  To: Jakub Wartak <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]>

Hi,

On 2026-04-08 08:51:30 +0200, Jakub Wartak wrote:
> For some reason I've ended up using -Dsegsize_blocks=4 and I've started
> getting ninja test errors after getting back from vacation leave like
> below (so this test was included only since then):

It's IIRC not the only test that fails if you do that.


> .cirrus file show usage of segsize_blocks=6, and also 8 works fine without
> errors, so it's just nuisance on my side, but it took some minutes for me
> to realize this and I'll just ask maybe we should just block usage of
> RELSEG_SIZE < 6 blocks in meson/configure? (patch attached)

-1.  I find it quite useful for testing some edge cases to be able to
configure with less.

If you really care, I'd be ok with a patch that makes the relevant test_aio
tests errors out with if it's set to a too low value...

Greetings,

Andres Freund





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

* Re: Failing test_aio tests due to too low(illegal?) segsize_blocks
@ 2026-04-09 08:35  Jakub Wartak <[email protected]>
  parent: Andres Freund <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Jakub Wartak @ 2026-04-09 08:35 UTC (permalink / raw)
  To: Andres Freund <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]>

On Wed, Apr 8, 2026 at 8:57 PM Andres Freund <[email protected]> wrote:
>
> Hi,
>
> On 2026-04-08 08:51:30 +0200, Jakub Wartak wrote:
> > For some reason I've ended up using -Dsegsize_blocks=4 and I've started
> > getting ninja test errors after getting back from vacation leave like
> > below (so this test was included only since then):
>
> It's IIRC not the only test that fails if you do that.
>
>
> > .cirrus file show usage of segsize_blocks=6, and also 8 works fine without
> > errors, so it's just nuisance on my side, but it took some minutes for me
> > to realize this and I'll just ask maybe we should just block usage of
> > RELSEG_SIZE < 6 blocks in meson/configure? (patch attached)
>
> -1.  I find it quite useful for testing some edge cases to be able to
> configure with less.
>
> If you really care, I'd be ok with a patch that makes the relevant test_aio
> tests errors out with if it's set to a too low value...

Ah, true, with segsize_blocks=2 I've got failures in basebackup,
amcheck, test_aio.
I'm not going into that dragons' den. Ok, so maybe it would be useful to just
issue some sort of warning about that some test may fail when using value less
than 6?

-J.





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


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

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-08 06:51 Failing test_aio tests due to too low(illegal?) segsize_blocks Jakub Wartak <[email protected]>
2026-04-08 18:57 ` Andres Freund <[email protected]>
2026-04-09 08:35   ` Jakub Wartak <[email protected]>

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