]> granicus.if.org Git - postgresql/commitdiff
Speed up isolation test for concurrent VACUUM/ANALYZE behavior.
authorRobert Haas <rhaas@postgresql.org>
Thu, 7 Dec 2017 16:09:49 +0000 (11:09 -0500)
committerRobert Haas <rhaas@postgresql.org>
Thu, 7 Dec 2017 16:11:07 +0000 (11:11 -0500)
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

src/test/isolation/expected/vacuum-concurrent-drop.out
src/test/isolation/specs/vacuum-concurrent-drop.spec

index 72d80a1de1e89105435228babb5cd62634fccd68..bb92e80b92396cf1a89a7cf2f071a312554251ab 100644 (file)
@@ -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; <waiting ...>
+step vac_specified: VACUUM part1, part2; <waiting ...>
 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; <waiting ...>
+step vac_all_parts: VACUUM parted; <waiting ...>
 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; <waiting ...>
+step analyze_specified: ANALYZE part1, part2; <waiting ...>
 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; <waiting ...>
+step analyze_all_parts: ANALYZE parted; <waiting ...>
 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; <waiting ...>
+step vac_analyze_specified: VACUUM ANALYZE part1, part2; <waiting ...>
 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; <waiting ...>
+step vac_analyze_all_parts: VACUUM ANALYZE parted; <waiting ...>
 step drop_and_commit: 
-       DROP TABLE test2;
+       DROP TABLE part2;
        COMMIT;
 
-step vac_analyze_all: <... completed>
+step vac_analyze_all_parts: <... completed>
index 31fc161e022454ed74f947c77bec642532f042f4..cae40926677f109579423f347a13c2b03631ebd5 100644 (file)
@@ -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"