🌐 AI搜索 & 代理 主页
Skip to content

Commit bd43940

Browse files
committed
Increase timeout in multixid_conversion upgrade test
The workload to generate multixids before upgrade is very slow on buildfarm members running with JIT enabled. The workload runs a lot of small queries, so it's unsurprising that JIT makes it slower. On my laptop it nevertheless runs in under 10 s even with JIT enabled, while some buildfarm members have been hitting the 180 s timeout. That seems extreme, but I suppose it's still expected on very slow and busy buildfarm animals. The timeout applies to the BackgroundPsql sessions as whole rather than the individual queries. Bump up the timeout to avoid the test failures. Add periodic progress reports to the test output so that we get a better picture of just how slow the test is. In the passing, also fix comments about how many multixids and members the workload generates. The comments were written based on 10 parallel connections, but it actually uses 20. Discussion: https://www.postgresql.org/message-id/b7faf07c-7d2c-4f35-8c43-392e057153ef@gmail.com
1 parent ecb553a commit bd43940

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/bin/pg_upgrade/t/007_multixact_conversion.pl

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
# upgrading them. The workload is a mix of KEY SHARE locking queries
2727
# and UPDATEs, and commits and aborts, to generate a mix of multixids
2828
# with different statuses. It consumes around 3000 multixids with
29-
# 30000 members. That's enough to span more than one multixids
30-
# 'offsets' page, and more than one 'members' segment.
29+
# 60000 members in total. That's enough to span more than one
30+
# multixids 'offsets' page, and more than one 'members' segment with
31+
# the default block size.
3132
#
3233
# The workload leaves behind a table called 'mxofftest' containing a
3334
# small number of rows referencing some of the generated multixids.
@@ -68,15 +69,23 @@ sub mxact_workload
6869
# verbose by setting this.
6970
my $verbose = 0;
7071

72+
# Bump the timeout on the connections to avoid false negatives on
73+
# slow test systems. The timeout covers the whole duration that
74+
# the connections are open rather than the individual queries.
75+
my $connection_timeout_secs =
76+
4 * $PostgreSQL::Test::Utils::timeout_default;
77+
7178
# Open multiple connections to the database. Start a transaction
7279
# in each connection.
7380
for (0 .. $nclients)
7481
{
7582
# Use the psql binary from the new installation. The
7683
# BackgroundPsql functionality doesn't work with older psql
7784
# versions.
78-
my $conn = $binnode->background_psql('',
79-
connstr => $node->connstr('postgres'));
85+
my $conn = $binnode->background_psql(
86+
'',
87+
connstr => $node->connstr('postgres'),
88+
timeout => $connection_timeout_secs);
8089

8190
$conn->query_safe("SET log_statement=none", verbose => $verbose)
8291
unless $verbose;
@@ -88,12 +97,14 @@ sub mxact_workload
8897

8998
# Run queries using cycling through the connections in a
9099
# round-robin fashion. We keep a transaction open in each
91-
# connection at all times, and lock/update the rows. With 10
100+
# connection at all times, and lock/update the rows. With 20
92101
# connections, each SELECT FOR KEY SHARE query generates a new
93-
# multixid, containing the 10 XIDs of all the transactions running
94-
# at the time.
102+
# multixid, containing the XIDs of all the transactions running at
103+
# the time, ie. around 20 XIDs.
95104
for (my $i = 0; $i < 3000; $i++)
96105
{
106+
note "generating multixids $i / 3000\n" if ($i % 100 == 0);
107+
97108
my $conn = $connections[ $i % $nclients ];
98109

99110
my $sql = ($i % $abort_every == 0) ? "ABORT" : "COMMIT";

0 commit comments

Comments
 (0)