diff options
author | Noah Misch | 2024-06-28 02:21:05 +0000 |
---|---|---|
committer | Noah Misch | 2024-06-28 02:21:05 +0000 |
commit | 0844b3968985447ed0a6937cfc8639e379da2fe6 (patch) | |
tree | 2b725f6ddb66d185fa8c9346c8b3f780b1be0a29 /src/bin/pgbench | |
parent | 22a4b104ba70f6f486197ab28a28cd9bcdd4f4ad (diff) |
Improve test coverage for changes to inplace-updated catalogs.
This covers both regular and inplace changes, since bugs arise at their
intersection. Where marked, these witness extant bugs. Back-patch to
v12 (all supported versions).
Reviewed (in an earlier version) by Robert Haas.
Discussion: https://postgr.es/m/20240512232923.aa.nmisch@google.com
Diffstat (limited to 'src/bin/pgbench')
-rw-r--r-- | src/bin/pgbench/t/001_pgbench_with_server.pl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/bin/pgbench/t/001_pgbench_with_server.pl b/src/bin/pgbench/t/001_pgbench_with_server.pl index 59ea5387ed9..956e290f3ef 100644 --- a/src/bin/pgbench/t/001_pgbench_with_server.pl +++ b/src/bin/pgbench/t/001_pgbench_with_server.pl @@ -68,6 +68,34 @@ $node->pgbench( "CREATE TYPE pg_temp.e AS ENUM ($labels); DROP TYPE pg_temp.e;" }); +# Test inplace updates from VACUUM concurrent with heap_update from GRANT. +# The PROC_IN_VACUUM environment can't finish MVCC table scans consistently, +# so this fails rarely. To reproduce consistently, add a sleep after +# GetCatalogSnapshot(non-catalog-rel). +Test::More->builder->todo_start('PROC_IN_VACUUM scan breakage'); +$node->safe_psql('postgres', 'CREATE TABLE ddl_target ()'); +$node->pgbench( + '--no-vacuum --client=5 --protocol=prepared --transactions=50', + 0, + [qr{processed: 250/250}], + [qr{^$}], + 'concurrent GRANT/VACUUM', + { + '001_pgbench_grant@9' => q( + DO $$ + BEGIN + PERFORM pg_advisory_xact_lock(42); + FOR i IN 1 .. 10 LOOP + GRANT SELECT ON ddl_target TO PUBLIC; + REVOKE SELECT ON ddl_target FROM PUBLIC; + END LOOP; + END + $$; +), + '001_pgbench_vacuum_ddl_target@1' => "VACUUM ddl_target;", + }); +Test::More->builder->todo_end; + # Trigger various connection errors $node->pgbench( 'no-such-database', |