From: Robert Haas Date: Thu, 7 Dec 2017 16:09:49 +0000 (-0500) Subject: Speed up isolation test for concurrent VACUUM/ANALYZE behavior. X-Git-Tag: REL_11_BETA1~1101 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a3edbb3302173f8ac465570b6273392aa6e20b1;p=postgresql Speed up isolation test for concurrent VACUUM/ANALYZE behavior. Per Tom Lane, the old test sometimes times out with CLOBBER_CACHE_ALWAYS. Nathan Bossart Discussion: http://postgr.es/m/28614.1512583046@sss.pgh.pa.us --- diff --git a/src/test/isolation/expected/vacuum-concurrent-drop.out b/src/test/isolation/expected/vacuum-concurrent-drop.out index 72d80a1de1..bb92e80b92 100644 --- a/src/test/isolation/expected/vacuum-concurrent-drop.out +++ b/src/test/isolation/expected/vacuum-concurrent-drop.out @@ -3,74 +3,74 @@ Parsed test spec with 2 sessions starting permutation: lock vac_specified drop_and_commit step lock: BEGIN; - LOCK test1 IN SHARE MODE; + LOCK part1 IN SHARE MODE; -step vac_specified: VACUUM test1, test2; +step vac_specified: VACUUM part1, part2; step drop_and_commit: - DROP TABLE test2; + DROP TABLE part2; COMMIT; -WARNING: skipping vacuum of "test2" --- relation no longer exists +WARNING: skipping vacuum of "part2" --- relation no longer exists step vac_specified: <... completed> -starting permutation: lock vac_all drop_and_commit +starting permutation: lock vac_all_parts drop_and_commit step lock: BEGIN; - LOCK test1 IN SHARE MODE; + LOCK part1 IN SHARE MODE; -step vac_all: VACUUM; +step vac_all_parts: VACUUM parted; step drop_and_commit: - DROP TABLE test2; + DROP TABLE part2; COMMIT; -step vac_all: <... completed> +step vac_all_parts: <... completed> starting permutation: lock analyze_specified drop_and_commit step lock: BEGIN; - LOCK test1 IN SHARE MODE; + LOCK part1 IN SHARE MODE; -step analyze_specified: ANALYZE test1, test2; +step analyze_specified: ANALYZE part1, part2; step drop_and_commit: - DROP TABLE test2; + DROP TABLE part2; COMMIT; -WARNING: skipping analyze of "test2" --- relation no longer exists +WARNING: skipping analyze of "part2" --- relation no longer exists step analyze_specified: <... completed> -starting permutation: lock analyze_all drop_and_commit +starting permutation: lock analyze_all_parts drop_and_commit step lock: BEGIN; - LOCK test1 IN SHARE MODE; + LOCK part1 IN SHARE MODE; -step analyze_all: ANALYZE; +step analyze_all_parts: ANALYZE parted; step drop_and_commit: - DROP TABLE test2; + DROP TABLE part2; COMMIT; -step analyze_all: <... completed> +step analyze_all_parts: <... completed> starting permutation: lock vac_analyze_specified drop_and_commit step lock: BEGIN; - LOCK test1 IN SHARE MODE; + LOCK part1 IN SHARE MODE; -step vac_analyze_specified: VACUUM ANALYZE test1, test2; +step vac_analyze_specified: VACUUM ANALYZE part1, part2; step drop_and_commit: - DROP TABLE test2; + DROP TABLE part2; COMMIT; -WARNING: skipping vacuum of "test2" --- relation no longer exists +WARNING: skipping vacuum of "part2" --- relation no longer exists step vac_analyze_specified: <... completed> -starting permutation: lock vac_analyze_all drop_and_commit +starting permutation: lock vac_analyze_all_parts drop_and_commit step lock: BEGIN; - LOCK test1 IN SHARE MODE; + LOCK part1 IN SHARE MODE; -step vac_analyze_all: VACUUM ANALYZE; +step vac_analyze_all_parts: VACUUM ANALYZE parted; step drop_and_commit: - DROP TABLE test2; + DROP TABLE part2; COMMIT; -step vac_analyze_all: <... completed> +step vac_analyze_all_parts: <... completed> diff --git a/src/test/isolation/specs/vacuum-concurrent-drop.spec b/src/test/isolation/specs/vacuum-concurrent-drop.spec index 31fc161e02..cae4092667 100644 --- a/src/test/isolation/specs/vacuum-concurrent-drop.spec +++ b/src/test/isolation/specs/vacuum-concurrent-drop.spec @@ -7,39 +7,39 @@ setup { - CREATE TABLE test1 (a INT); - CREATE TABLE test2 (a INT); + CREATE TABLE parted (a INT) PARTITION BY LIST (a); + CREATE TABLE part1 PARTITION OF parted FOR VALUES IN (1); + CREATE TABLE part2 PARTITION OF parted FOR VALUES IN (2); } teardown { - DROP TABLE IF EXISTS test1; - DROP TABLE IF EXISTS test2; + DROP TABLE IF EXISTS parted; } session "s1" step "lock" { BEGIN; - LOCK test1 IN SHARE MODE; + LOCK part1 IN SHARE MODE; } step "drop_and_commit" { - DROP TABLE test2; + DROP TABLE part2; COMMIT; } session "s2" -step "vac_specified" { VACUUM test1, test2; } -step "vac_all" { VACUUM; } -step "analyze_specified" { ANALYZE test1, test2; } -step "analyze_all" { ANALYZE; } -step "vac_analyze_specified" { VACUUM ANALYZE test1, test2; } -step "vac_analyze_all" { VACUUM ANALYZE; } +step "vac_specified" { VACUUM part1, part2; } +step "vac_all_parts" { VACUUM parted; } +step "analyze_specified" { ANALYZE part1, part2; } +step "analyze_all_parts" { ANALYZE parted; } +step "vac_analyze_specified" { VACUUM ANALYZE part1, part2; } +step "vac_analyze_all_parts" { VACUUM ANALYZE parted; } permutation "lock" "vac_specified" "drop_and_commit" -permutation "lock" "vac_all" "drop_and_commit" +permutation "lock" "vac_all_parts" "drop_and_commit" permutation "lock" "analyze_specified" "drop_and_commit" -permutation "lock" "analyze_all" "drop_and_commit" +permutation "lock" "analyze_all_parts" "drop_and_commit" permutation "lock" "vac_analyze_specified" "drop_and_commit" -permutation "lock" "vac_analyze_all" "drop_and_commit" +permutation "lock" "vac_analyze_all_parts" "drop_and_commit"