Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc4118d3

Browse files
committed
Make stats regression test more robust in the face of parallel query.
Commit60690a6 attempted to fix the wait_for_stats() function in thistest so that it would wait properly if the tenk2 scans were done inparallel workers instead of the main session (typically as a consequence offorce_parallel_mode being turned on). However, we made it test for whetherthe main session's actions had been reported by looking for inserts on'trunc_stats_test'. This is the Wrong Thing, because those aren't the lastupdates we expect the main session to do. As shown by recent failures onbuildfarm member frogmouth, it's entirely likely that the trunc_stats_testupdates will be reported in a separate message from later updates, whichmeans there can be a window in which wait_for_stats() will exit but not allthe updates we are expecting to see will have arrived. We should test forthe last updates we're expecting, namely those on 'trunc_stats_test4'.Unfortunately, I doubt that this explains frogmouth's failures, becausethere's no reason to believe that it's running the tenk2 queries inparallel. Still, the test is wrong on its own terms, so fix and back-patchto 9.6 where parallel query came in.
1 parent69db3b0 commitc4118d3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎src/test/regress/expected/stats.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ begin
5959
FROM pg_stat_user_tables AS st, pg_class AS cl, prevstats AS pr
6060
WHERE st.relname='tenk2' AND cl.relname='tenk2';
6161

62-
-- check to see if updates have been sensed
62+
-- check to see ifallupdates have been sensed
6363
SELECT (n_tup_ins > 0) INTO updated3
64-
FROM pg_stat_user_tables WHERE relname='trunc_stats_test';
64+
FROM pg_stat_user_tables WHERE relname='trunc_stats_test4';
6565

6666
exit when updated1 and updated2 and updated3;
6767

‎src/test/regress/sql/stats.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ begin
5454
FROM pg_stat_user_tablesAS st, pg_classAS cl, prevstatsAS pr
5555
WHEREst.relname='tenk2'ANDcl.relname='tenk2';
5656

57-
-- check to see if updates have been sensed
57+
-- check to see ifallupdates have been sensed
5858
SELECT (n_tup_ins>0) INTO updated3
59-
FROM pg_stat_user_tablesWHERE relname='trunc_stats_test';
59+
FROM pg_stat_user_tablesWHERE relname='trunc_stats_test4';
6060

6161
exit when updated1and updated2and updated3;
6262

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp