Failing test_aio tests due to too low(illegal?) segsize_blocks

Started by Jakub Wartak6 months ago3 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliessuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t139246
psql -h localhost -U postgres

Built from patchset v1 (message #1), September 20, 2026 at 01:41 PM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t139246_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t139246_1 && git checkout t139246_1

Patchset v1 (message #1) is on t139246_1

Jump to latest
#1Jakub Wartak
jakub.wartak@enterprisedb.com

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:

t139246_1
v1-0001-Limit-minimum-allowed-segsize-blocks-in-autoconf-.patchtext/x-patch; charset=US-ASCII; name=v1-0001-Limit-minimum-allowed-segsize-blocks-in-autoconf-.patchDownload+11-1
#2Andres Freund
andres@anarazel.de
In reply to: Jakub Wartak (#1)
Re: Failing test_aio tests due to too low(illegal?) segsize_blocks

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

#3Jakub Wartak
jakub.wartak@enterprisedb.com
In reply to: Andres Freund (#2)
Re: Failing test_aio tests due to too low(illegal?) segsize_blocks

On Wed, Apr 8, 2026 at 8:57 PM Andres Freund <andres@anarazel.de> 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.