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

Commit3db0598

Browse files
committed
Improve stability of tests for VACUUM (SKIP_LOCKED)
Concurrent autovacuums running with the main regression test suitecould cause the tests with VACUUM (SKIP_LOCKED) to generate randomlyWARNING messages. For these tests, set client_min_messages to ERROR toget rid of those random failures, as disabling autovacuum for therelations operated would not completely close the failure window.For isolation tests, disable autovacuum for the relations vacuumed withSKIP_LOCKED. The tests are designed so as LOCK commands are takenin a first session before running a concurrent VACUUM (SKIP_LOCKED) in asecond to generate WARNING messages, but a concurrent autovacuum couldcause the tests to be slower.Reported-by: Tom LaneAuthor: Michael PaquierReviewed-by: Andres Freund, Tom LaneDiscussion:https://postgr.es/m/25294.1573077278@sss.pgh.pa.usBackpatch-through: 12
1 parent2dc08bd commit3db0598

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

‎src/test/isolation/specs/vacuum-skip-locked.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ setup
77
{
88
CREATETABLEparted (aINT)PARTITIONBYLIST (a);
99
CREATETABLEpart1PARTITIONOFpartedFORVALUESIN (1);
10+
ALTERTABLEpart1SET (autovacuum_enabled=false);
1011
CREATETABLEpart2PARTITIONOFpartedFORVALUESIN (2);
12+
ALTERTABLEpart2SET (autovacuum_enabled=false);
1113
}
1214

1315
teardown

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ ERROR: unrecognized ANALYZE option "nonexistentarg"
196196
LINE 1: ANALYZE (nonexistentarg) does_not_exit;
197197
^
198198
-- ensure argument order independence, and that SKIP_LOCKED on non-existing
199-
-- relation still errors out.
199+
-- relation still errors out. Suppress WARNING messages caused by concurrent
200+
-- autovacuums.
201+
SET client_min_messages TO 'ERROR';
200202
ANALYZE (SKIP_LOCKED, VERBOSE) does_not_exist;
201203
ERROR: relation "does_not_exist" does not exist
202204
ANALYZE (VERBOSE, SKIP_LOCKED) does_not_exist;
@@ -205,6 +207,7 @@ ERROR: relation "does_not_exist" does not exist
205207
VACUUM (SKIP_LOCKED) vactst;
206208
VACUUM (SKIP_LOCKED, FULL) vactst;
207209
ANALYZE (SKIP_LOCKED) vactst;
210+
RESET client_min_messages;
208211
-- ensure VACUUM and ANALYZE don't have a problem with serializable
209212
SET default_transaction_isolation = serializable;
210213
VACUUM vactst;

‎src/test/regress/sql/vacuum.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,17 @@ ANALYZE (nonexistent-arg) does_not_exist;
158158
ANALYZE (nonexistentarg) does_not_exit;
159159

160160
-- ensure argument order independence, and that SKIP_LOCKED on non-existing
161-
-- relation still errors out.
161+
-- relation still errors out. Suppress WARNING messages caused by concurrent
162+
-- autovacuums.
163+
SET client_min_messages TO'ERROR';
162164
ANALYZE (SKIP_LOCKED, VERBOSE) does_not_exist;
163165
ANALYZE (VERBOSE, SKIP_LOCKED) does_not_exist;
164166

165167
-- SKIP_LOCKED option
166168
VACUUM (SKIP_LOCKED) vactst;
167169
VACUUM (SKIP_LOCKED, FULL) vactst;
168170
ANALYZE (SKIP_LOCKED) vactst;
171+
RESET client_min_messages;
169172

170173
-- ensure VACUUM and ANALYZE don't have a problem with serializable
171174
SET default_transaction_isolation= serializable;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp