Debian Codegraph @

mysql-test/suite/innodb_undo/r/undo_tablespace_debug.result

raw
1 #
2 # Inject failures in order to get code coverage.
3 # Use explicit undo tablespaces and make the implicit spaces inactive.
4 #
5 SET GLOBAL innodb_fast_shutdown = 0;
6 # restart
7 SET @old_truncate_frequency = @@innodb_purge_rseg_truncate_frequency;
8 SET GLOBAL innodb_purge_rseg_truncate_frequency=5;
9 CREATE UNDO TABLESPACE undo_003 ADD DATAFILE 'undo_003.ibu';
10 CREATE UNDO TABLESPACE undo_004 ADD DATAFILE 'undo_004.ibu';
11 CREATE UNDO TABLESPACE undo_005 ADD DATAFILE 'undo_005.ibu';
12 ALTER UNDO TABLESPACE innodb_undo_001 SET INACTIVE;
13 ALTER UNDO TABLESPACE innodb_undo_002 SET INACTIVE;
14 SELECT NAME, SPACE_TYPE, STATE FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
15 WHERE SPACE_TYPE = 'Undo' ORDER BY NAME;
16 NAME SPACE_TYPE STATE
17 innodb_undo_001 Undo empty
18 innodb_undo_002 Undo empty
19 undo_003 Undo active
20 undo_004 Undo active
21 undo_005 Undo active
22 SELECT TABLESPACE_NAME, FILE_TYPE, FILE_NAME FROM INFORMATION_SCHEMA.FILES
23 WHERE FILE_NAME LIKE '%undo%' ORDER BY TABLESPACE_NAME;
24 TABLESPACE_NAME FILE_TYPE FILE_NAME
25 innodb_undo_001 UNDO LOG ./undo_001
26 innodb_undo_002 UNDO LOG ./undo_002
27 undo_003 UNDO LOG ./undo_003.ibu
28 undo_004 UNDO LOG ./undo_004.ibu
29 undo_005 UNDO LOG ./undo_005.ibu
30 #
31 # Bug#28966457: IF CREATE UNDO TABLESPACE FAILS, INCOMPLETE UNDO
32 # TABLESPACE SHOULD BE CLEANED UP
33 #
34 SET GLOBAL DEBUG="+d,ib_undo_tablespace_create_fail";
35 CREATE UNDO TABLESPACE undo_006 ADD DATAFILE 'undo_006.ibu';
36 ERROR HY000: Failed to create UNDO TABLESPACE undo_006
37 SET GLOBAL DEBUG="-d,ib_undo_tablespace_create_fail";
38 SELECT NAME, SPACE_TYPE, STATE FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
39 WHERE SPACE_TYPE = 'Undo' ORDER BY NAME;
40 NAME SPACE_TYPE STATE
41 innodb_undo_001 Undo empty
42 innodb_undo_002 Undo empty
43 undo_003 Undo active
44 undo_004 Undo active
45 undo_005 Undo active
46 SELECT TABLESPACE_NAME, FILE_TYPE, FILE_NAME FROM INFORMATION_SCHEMA.FILES
47 WHERE FILE_NAME LIKE '%undo%' ORDER BY TABLESPACE_NAME;
48 TABLESPACE_NAME FILE_TYPE FILE_NAME
49 innodb_undo_001 UNDO LOG ./undo_001
50 innodb_undo_002 UNDO LOG ./undo_002
51 undo_003 UNDO LOG ./undo_003.ibu
52 undo_004 UNDO LOG ./undo_004.ibu
53 undo_005 UNDO LOG ./undo_005.ibu
54 # Make sure file is not left behind in datadir
55 #
56 # Inject a failure to open an undo tablespace after it is created.
57 # The file remains on disk along with the truncate log file.
58 #
59 SET GLOBAL DEBUG="+d,ib_undo_tablespace_open_fail";
60 CREATE UNDO TABLESPACE undo_006 ADD DATAFILE 'undo_006.ibu';
61 ERROR HY000: Failed to create UNDO TABLESPACE undo_006
62 SET GLOBAL DEBUG="-d,ib_undo_tablespace_open_fail";
63 SELECT NAME, SPACE_TYPE, STATE FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
64 WHERE SPACE_TYPE = 'Undo' ORDER BY NAME;
65 NAME SPACE_TYPE STATE
66 innodb_undo_001 Undo empty
67 innodb_undo_002 Undo empty
68 undo_003 Undo active
69 undo_004 Undo active
70 undo_005 Undo active
71 SELECT TABLESPACE_NAME, FILE_TYPE, FILE_NAME FROM INFORMATION_SCHEMA.FILES
72 WHERE FILE_NAME LIKE '%undo%' ORDER BY TABLESPACE_NAME;
73 TABLESPACE_NAME FILE_TYPE FILE_NAME
74 innodb_undo_001 UNDO LOG ./undo_001
75 innodb_undo_002 UNDO LOG ./undo_002
76 undo_003 UNDO LOG ./undo_003.ibu
77 undo_004 UNDO LOG ./undo_004.ibu
78 undo_005 UNDO LOG ./undo_005.ibu
79 # Make sure file is not left behind in datadir
80 #
81 # Inject a failure to get the MDL during undo truncate.
82 #
83 SET GLOBAL DEBUG="+d,ib_undo_trunc_fail_get_mdl";
84 ALTER UNDO TABLESPACE undo_003 SET INACTIVE;
85 ALTER UNDO TABLESPACE undo_003 SET ACTIVE;
86 SELECT NAME, SPACE_TYPE, STATE FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
87 WHERE SPACE_TYPE = 'Undo' ORDER BY NAME;
88 NAME SPACE_TYPE STATE
89 innodb_undo_001 Undo empty
90 innodb_undo_002 Undo empty
91 undo_003 Undo active
92 undo_004 Undo active
93 undo_005 Undo active
94 #
95 # Inject a failure to locate the undo space during undo truncate.
96 #
97 SET GLOBAL DEBUG="+d,ib_undo_trunc_fail_marked_space";
98 ALTER UNDO TABLESPACE undo_003 SET INACTIVE;
99 ALTER UNDO TABLESPACE undo_003 SET ACTIVE;
100 SELECT NAME, SPACE_TYPE, STATE FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
101 WHERE SPACE_TYPE = 'Undo' ORDER BY NAME;
102 NAME SPACE_TYPE STATE
103 innodb_undo_001 Undo empty
104 innodb_undo_002 Undo empty
105 undo_003 Undo active
106 undo_004 Undo active
107 undo_005 Undo active
108 #
109 # Inject a failure to write the undo trunc log file.
110 #
111 SET GLOBAL DEBUG="+d,ib_undo_trunc_fail_start_logging";
112 ALTER UNDO TABLESPACE undo_003 SET INACTIVE;
113 ALTER UNDO TABLESPACE undo_003 SET ACTIVE;
114 SELECT NAME, SPACE_TYPE, STATE FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
115 WHERE SPACE_TYPE = 'Undo' ORDER BY NAME;
116 NAME SPACE_TYPE STATE
117 innodb_undo_001 Undo empty
118 innodb_undo_002 Undo empty
119 undo_003 Undo active
120 undo_004 Undo active
121 undo_005 Undo active
122 #
123 # Inject a simulated fast shutdown during undo truncate. The injection
124 # does't really shutdown, it just does not finish the truncate.
125 #
126 SET GLOBAL DEBUG="+d,ib_undo_trunc_fail_fast_shutdown";
127 ALTER UNDO TABLESPACE undo_003 SET INACTIVE;
128 ALTER UNDO TABLESPACE undo_003 SET ACTIVE;
129 SELECT NAME, SPACE_TYPE, STATE FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
130 WHERE SPACE_TYPE = 'Undo' ORDER BY NAME;
131 NAME SPACE_TYPE STATE
132 innodb_undo_001 Undo empty
133 innodb_undo_002 Undo empty
134 undo_003 Undo active
135 undo_004 Undo active
136 undo_005 Undo active
137 #
138 # Inject a failure to actually truncate the undo space.
139 #
140 SET GLOBAL DEBUG="+d,ib_undo_trunc_fail_truncate";
141 ALTER UNDO TABLESPACE undo_003 SET INACTIVE;
142 ALTER UNDO TABLESPACE undo_003 SET ACTIVE;
143 SELECT NAME, SPACE_TYPE, STATE FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
144 WHERE SPACE_TYPE = 'Undo' ORDER BY NAME;
145 NAME SPACE_TYPE STATE
146 innodb_undo_001 Undo empty
147 innodb_undo_002 Undo empty
148 undo_003 Undo active
149 undo_004 Undo active
150 undo_005 Undo active
151 #
152 # Cleanup
153 #
154 SET GLOBAL DEBUG="-d,ib_undo_trunc_fail_get_mdl";
155 SET GLOBAL DEBUG="-d,ib_undo_trunc_fail_marked_space";
156 SET GLOBAL DEBUG="-d,ib_undo_trunc_fail_start_logging";
157 SET GLOBAL DEBUG="-d,ib_undo_trunc_fail_fast_shutdown";
158 SET GLOBAL DEBUG="-d,ib_undo_trunc_fail_truncate";
159 ALTER UNDO TABLESPACE innodb_undo_001 SET ACTIVE;
160 ALTER UNDO TABLESPACE innodb_undo_002 SET ACTIVE;
161 ALTER UNDO TABLESPACE undo_003 SET INACTIVE;
162 ALTER UNDO TABLESPACE undo_004 SET INACTIVE;
163 ALTER UNDO TABLESPACE undo_005 SET INACTIVE;
164 DROP UNDO TABLESPACE undo_003;
165 DROP UNDO TABLESPACE undo_004;
166 DROP UNDO TABLESPACE undo_005;
167 SET GLOBAL innodb_purge_rseg_truncate_frequency=@old_truncate_frequency;