pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: test_aio: Fix broken error recovery assertions in 001_aio
3+ messages / 1 participants
[nested] [flat]

* pgsql: test_aio: Fix broken error recovery assertions in 001_aio
@ 2026-08-20 22:05  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2026-08-20 22:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

test_aio: Fix broken error recovery assertions in 001_aio

The three error recovery checks in `test_handle()` used "qr/^|ok$/" to
look for the marker "ok" in psql's output.  '^' matches every string, so
the assertions passed no matter what psql printed.

Spelling the regex correctly as "qr/^ok\|$/" exposed that the explicit
xact case was actually failing, reporting an incorrect "current
transaction is aborted" instead of showing that an AIO handle can be
acquired again after an error.  This is rewritten with a ROLLBACK,
similarly to the subxact counterpart.

While on it, the subxact case had no marker column in its query, so add
one there for consistency, and reformat to use same pattern.

Author: Jelte Fennema-Nio <me@jeltef.nl>
Discussion: https://postgr.es/m/DKSU6GI1YLG5.3VF6M4IRKQ7XE@jeltef.nl
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9d23f862d60854d797dcab40f46b21aff45d4db5

Modified Files
--------------
src/test/modules/test_aio/t/001_aio.pl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)



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

* pgsql: test_aio: Fix broken error recovery assertions in 001_aio
@ 2026-08-20 22:05  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2026-08-20 22:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

test_aio: Fix broken error recovery assertions in 001_aio

The three error recovery checks in `test_handle()` used "qr/^|ok$/" to
look for the marker "ok" in psql's output.  '^' matches every string, so
the assertions passed no matter what psql printed.

Spelling the regex correctly as "qr/^ok\|$/" exposed that the explicit
xact case was actually failing, reporting an incorrect "current
transaction is aborted" instead of showing that an AIO handle can be
acquired again after an error.  This is rewritten with a ROLLBACK,
similarly to the subxact counterpart.

While on it, the subxact case had no marker column in its query, so add
one there for consistency, and reformat to use same pattern.

Author: Jelte Fennema-Nio <me@jeltef.nl>
Discussion: https://postgr.es/m/DKSU6GI1YLG5.3VF6M4IRKQ7XE@jeltef.nl
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/497de6394e687e18b007f571ede7505465c6ee21

Modified Files
--------------
src/test/modules/test_aio/t/001_aio.pl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)



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

* pgsql: test_aio: Fix broken error recovery assertions in 001_aio
@ 2026-08-20 22:05  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2026-08-20 22:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

test_aio: Fix broken error recovery assertions in 001_aio

The three error recovery checks in `test_handle()` used "qr/^|ok$/" to
look for the marker "ok" in psql's output.  '^' matches every string, so
the assertions passed no matter what psql printed.

Spelling the regex correctly as "qr/^ok\|$/" exposed that the explicit
xact case was actually failing, reporting an incorrect "current
transaction is aborted" instead of showing that an AIO handle can be
acquired again after an error.  This is rewritten with a ROLLBACK,
similarly to the subxact counterpart.

While on it, the subxact case had no marker column in its query, so add
one there for consistency, and reformat to use same pattern.

Author: Jelte Fennema-Nio <me@jeltef.nl>
Discussion: https://postgr.es/m/DKSU6GI1YLG5.3VF6M4IRKQ7XE@jeltef.nl
Backpatch-through: 18

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/86ed13547589d8401b3b1e1ec2873903b287cb80

Modified Files
--------------
src/test/modules/test_aio/t/001_aio.pl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)



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


end of thread, other threads:[~2026-08-20 22:05 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-20 22:05 pgsql: test_aio: Fix broken error recovery assertions in 001_aio Michael Paquier <michael@paquier.xyz>
2026-08-20 22:05 pgsql: test_aio: Fix broken error recovery assertions in 001_aio Michael Paquier <michael@paquier.xyz>
2026-08-20 22:05 pgsql: test_aio: Fix broken error recovery assertions in 001_aio Michael Paquier <michael@paquier.xyz>

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