Debian Codegraph @

mysql-test/suite/innodb/r/doublewrite_reduced_odirect.result

raw
1 ###########################################
2 # Test with O_DIRECT enabled
3 ###########################################
4 SHOW VARIABLES LIKE 'innodb_doublewrite';
5 Variable_name Value
6 innodb_doublewrite ON
7 SHOW VARIABLES LIKE 'innodb_fil_make_page_dirty_debug';
8 Variable_name Value
9 innodb_fil_make_page_dirty_debug 4294967295
10 SHOW VARIABLES LIKE 'innodb_saved_page_number_debug';
11 Variable_name Value
12 innodb_saved_page_number_debug 0
13 # Wait for purge to complete
14 create table t1 (f1 int primary key, f2 blob) engine=innodb STATS_PERSISTENT=0;
15 START TRANSACTION;
16 INSERT INTO t1 VALUES(1, repeat('#',12));
17 INSERT INTO t1 VALUES(2, repeat('+',12));
18 INSERT INTO t1 VALUES(3, repeat('/',12));
19 INSERT INTO t1 VALUES(4, repeat('-',12));
20 INSERT INTO t1 VALUES(5, repeat('.',12));
21 COMMIT WORK;
22 SET GLOBAL innodb_fast_shutdown = 0;
23 # Take backup of original datadir
24 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
25 # ---------------------------------------------------------------
26 # Test Begin: Test if recovery works if first page of user
27 # tablespace is full of zeroes.
28 SHOW VARIABLES LIKE 'innodb_doublewrite';
29 Variable_name Value
30 innodb_doublewrite DETECT_ONLY
31 # Ensure that dirty pages of table t1 is flushed.
32 FLUSH TABLES t1 FOR EXPORT;
33 UNLOCK TABLES;
34 SELECT space FROM INFORMATION_SCHEMA.INNODB_TABLESPACEs
35 WHERE name = 'test/t1' INTO @space_id;
36 SET GLOBAL innodb_checkpoint_disabled=1;
37 SET GLOBAL innodb_limit_optimistic_insert_debug=2;
38 BEGIN;
39 INSERT INTO t1 VALUES (6, repeat('%', 12));
40 INSERT INTO t1 SELECT f1+8,f2 FROM t1;
41 SET GLOBAL innodb_checkpoint_disabled = 1;
42 # Make the first page dirty for table t1
43 SET GLOBAL innodb_saved_page_number_debug = 0;
44 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
45 ERROR HY000: Lost connection to MySQL server during query
46 # Make the first page (page_no=0) of the user tablespace
47 # full of zeroes.
48 # restoring original datadir
49 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
50 # Test End - 1
51 # ---------------------------------------------------------------
52 # Test Begin: Test if recovery works if first page of user
53 # tablespace is corrupted.
54 SHOW VARIABLES LIKE 'innodb_doublewrite';
55 Variable_name Value
56 innodb_doublewrite DETECT_ONLY
57 SELECT space from INFORMATION_SCHEMA.INNODB_TABLESPACES
58 WHERE name = 'test/t1' INTO @space_id;
59 # Ensure that dirty pages of table t1 is flushed.
60 FLUSH TABLES t1 FOR EXPORT;
61 UNLOCK TABLES;
62 SET GLOBAL innodb_checkpoint_disabled=1;
63 BEGIN;
64 INSERT INTO t1 VALUES (6, repeat('%', 12));
65 SET GLOBAL innodb_checkpoint_disabled = 1;
66 # Make the first page dirty for table t1
67 SET GLOBAL innodb_saved_page_number_debug = 0;
68 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
69 ERROR HY000: Lost connection to MySQL server during query
70 # Corrupt the first page (page_no=0) of the user tablespace.
71 # restoring original datadir
72 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
73 # Test End - 2
74 # ---------------------------------------------------------------
75 # Test Begin: Test if recovery works if 2nd page of user
76 # tablespace is full of zeroes.
77 SHOW VARIABLES LIKE 'innodb_doublewrite';
78 Variable_name Value
79 innodb_doublewrite DETECT_ONLY
80 SELECT space FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
81 WHERE name = 'test/t1' INTO @space_id;
82 # Ensure that dirty pages of table t1 is flushed.
83 FLUSH TABLES t1 FOR EXPORT;
84 UNLOCK TABLES;
85 SET GLOBAL innodb_checkpoint_disabled=1;
86 BEGIN;
87 INSERT INTO t1 VALUES (6, repeat('%', 400));
88 SET GLOBAL innodb_checkpoint_disabled = 1;
89 # Make the 2nd page dirty for table t1
90 SET GLOBAL innodb_saved_page_number_debug = 1;
91 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
92 ERROR HY000: Lost connection to MySQL server during query
93 # Make the 2nd page (page_no=1) of the tablespace all zeroes.
94 # restoring original datadir
95 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
96 # Test End - 3
97 # ---------------------------------------------------------------
98 # Test Begin: Test if recovery works if 2nd page of user
99 # tablespace is corrupted.
100 SHOW VARIABLES LIKE 'innodb_doublewrite';
101 Variable_name Value
102 innodb_doublewrite DETECT_ONLY
103 SELECT space FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
104 WHERE name = 'test/t1' into @space_id;
105 FLUSH TABLES t1 FOR EXPORT;
106 UNLOCK TABLES;
107 SET GLOBAL innodb_checkpoint_disabled=1;
108 BEGIN;
109 INSERT INTO t1 VALUES (6, repeat('%', 400));
110 # Make the 2nd page dirty for table t1
111 SET GLOBAL innodb_saved_page_number_debug = 1;
112 SET GLOBAL innodb_checkpoint_disabled = 1;
113 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
114 ERROR HY000: Lost connection to MySQL server during query
115 # Corrupt the 2nd page (page_no=1) of the user tablespace.
116 # restoring original datadir
117 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
118 # Test End - 4
119 # ---------------------------------------------------------------
120 # Test Begin: Test if recovery works if first page of
121 # system tablespace is full of zeroes.
122 SHOW VARIABLES LIKE 'innodb_doublewrite';
123 Variable_name Value
124 innodb_doublewrite DETECT_ONLY
125 SET GLOBAL innodb_master_thread_disabled_debug=1;
126 BEGIN;
127 INSERT INTO t1 VALUES (6, repeat('%', 400));
128 SET GLOBAL innodb_checkpoint_disabled = 1;
129 # Make the first page dirty for system tablespace
130 SET GLOBAL innodb_saved_page_number_debug = 0;
131 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
132 ERROR HY000: Lost connection to MySQL server during query
133 # Make the first page (page_no=0) of the system tablespace
134 # all zeroes.
135 # restoring original datadir
136 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
137 # Test End - 5
138 # ---------------------------------------------------------------
139 # Test Begin: Test if recovery works if first page of
140 # system tablespace is corrupted.
141 SHOW VARIABLES LIKE 'innodb_doublewrite';
142 Variable_name Value
143 innodb_doublewrite DETECT_ONLY
144 SET GLOBAL innodb_master_thread_disabled_debug=1;
145 BEGIN;
146 INSERT INTO t1 VALUES (6, repeat('%', 400));
147 SET GLOBAL innodb_checkpoint_disabled = 1;
148 # Make the first page dirty for system tablespace
149 SET GLOBAL innodb_saved_page_number_debug = 0;
150 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
151 ERROR HY000: Lost connection to MySQL server during query
152 # Corrupt the first page (page_no=0) of the system tablespace.
153 # restoring original datadir
154 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
155 # Test End - 6
156 # ---------------------------------------------------------------
157 # Test Begin: Test if recovery works if 2nd page of
158 # system tablespace is full of zeroes.
159 SHOW VARIABLES LIKE 'innodb_doublewrite';
160 Variable_name Value
161 innodb_doublewrite DETECT_ONLY
162 SET GLOBAL innodb_master_thread_disabled_debug=1;
163 BEGIN;
164 INSERT INTO t1 VALUES (6, repeat('%', 400));
165 SET GLOBAL innodb_checkpoint_disabled = 1;
166 # Make the second page dirty for system tablespace
167 SET GLOBAL innodb_saved_page_number_debug = 1;
168 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
169 ERROR HY000: Lost connection to MySQL server during query
170 # Make the 2nd page (page_no=1) of the system tablespace
171 # all zeroes.
172 # restoring original datadir
173 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
174 # Test End - 7
175 # ---------------------------------------------------------------
176 # Test Begin: Test if recovery works if 2nd page of
177 # system tablespace is corrupted.
178 SHOW VARIABLES LIKE 'innodb_doublewrite';
179 Variable_name Value
180 innodb_doublewrite DETECT_ONLY
181 SET GLOBAL innodb_master_thread_disabled_debug=1;
182 BEGIN;
183 INSERT INTO t1 VALUES (6, repeat('%', 400));
184 SET GLOBAL innodb_checkpoint_disabled = 1;
185 # Make the second page dirty for system tablespace
186 SET GLOBAL innodb_saved_page_number_debug = 1;
187 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
188 ERROR HY000: Lost connection to MySQL server during query
189 # Make the 2nd page (page_no=1) of the system tablespace
190 # all zeroes.
191 # restoring original datadir
192 # restart
193 # Test End - 8
194 # ---------------------------------------------------------------
195 DROP TABLE t1;