You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fil_system::prepare_open_for_business()
after the fix for Bug 36808732
Analysis
--------
1. After the fix for Bug 36808732, the cost of checking
the dd metadata was transferred to the
prepare_open_for_business().
2. The fix for Bug 36808732 categorized all tables whose
data directories are outside the default data directory
as moved and these tables needs to be processed in
prepare_open_for_business() which adds to the performance
degradation.
3. In prepare_open_for_business() we are updating the dd
metadata even when there is no update, which also
causes performance degradation during startup.
Fix
---
1. Rollback the fix for Bug 36808732 partially.
2. Register the work threads launched during Validating
files with MySQL so that dd flag can be accessed.
Change-Id: I523038d3a7760184efb64f5c894be8219a9c487d
Copy file name to clipboardExpand all lines: mysql-test/suite/innodb/r/alter_datadir_path.result
+28-3Lines changed: 28 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -232,53 +232,78 @@ DROP TABLE dbtest.t7c;
232
232
CREATE TABLE `t8a` (a INT, b INT) PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY='MYSQL_TMP_DIR/external_dir', PARTITION p1 VALUES LESS THAN (20) DATA DIRECTORY='MYSQL_TMP_DIR/external_dir2');
233
233
CREATE TABLE `t8b` (a INT, b INT) PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY='MYSQL_TMP_DIR/external_dir', PARTITION p1 VALUES LESS THAN (20) DATA DIRECTORY='MYSQL_TMP_DIR/external_dir2');
234
234
CREATE TABLE `t8c` (a INT, b INT) PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY='MYSQL_TMP_DIR/external_dir', PARTITION p1 VALUES LESS THAN (20) DATA DIRECTORY='MYSQL_TMP_DIR/external_dir2');
235
+
# Partition table with one partition in external directory and one in default directory
236
+
CREATE TABLE `t8d` (a INT, b INT) PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY='MYSQL_TMP_DIR/external_dir', PARTITION p1 VALUES LESS THAN (20) );
235
237
# Shutdown server
236
-
# Check that for partition p0 for t8a, t8b, t8c exist in EXTERNAL_DIR and partition p1 for for t8a, t8b, t8c exist in EXTERNAL_DIR2
238
+
# Check that for partition p0 for t8a, t8b, t8c and t8d exist in EXTERNAL_DIR and partition p1 for for t8a, t8b, t8c exist in EXTERNAL_DIR2
237
239
# Listing EXTERNAL_DIR
238
240
t8a#p#p0.ibd
239
241
t8b#p#p0.ibd
240
242
t8c#p#p0.ibd
243
+
t8d#p#p0.ibd
241
244
# Listing EXTERNAL_DIR2
242
245
t8a#p#p1.ibd
243
246
t8b#p#p1.ibd
244
247
t8c#p#p1.ibd
248
+
# List default directory. t8d's p1 partition should be present
# Check that for partition p0 for t8a, t8b, t8c still exist in EXTERNAL_DIR and partition p1 for for t8a, t8b, t8c still exist in EXTERNAL_DIR2
252
258
# Listing EXTERNAL_DIR
253
259
t8a#p#p0.ibd
254
260
t8b#p#p0.ibd
255
261
t8c#p#p0.ibd
262
+
t8d#p#p0.ibd
256
263
# Listing EXTERNAL_DIR2
257
264
t8a#p#p1.ibd
258
265
t8b#p#p1.ibd
259
266
t8c#p#p1.ibd
267
+
# List default directory. t8d's p1 partition should be present
268
+
t8d#p#p1.ibd
260
269
# Shutdown server
261
-
# Now lets move all partitioned tables p0 of t8a, t8b, t8c from EXTERNAL_DIR and partitioned tables p1 of t8a, t8b, t8c from EXTERNAL_DIR2 to default directory
270
+
# Now lets move all partitioned tables p0 of t8a, t8b, t8c, t8d from EXTERNAL_DIR and partitioned tables p1 of t8a, t8b, t8c from EXTERNAL_DIR2 to default directory
Copy file name to clipboardExpand all lines: mysql-test/suite/innodb/t/alter_datadir_path.test
+27-4Lines changed: 27 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@
28
28
#Table t8a: Covers scenario create partitioned table with data directory clause and both partitions in different directories, move to default dir and alter table force
29
29
#Table t8b: Covers scenario create partitioned table with data directory clause and both partitions in different directories, move to default dir and alter table force algo=inplace
30
30
#Table t8c: Covers scenario create partitioned table with data directory clause and both partitions in different directories, move to default dir and alter table force algo=copy
31
+
#Table t8d: Covers scenario create partitioned table with one partition in data directory clause and the other partition in default data dir path, move to default dir and alter table force algo=copy
31
32
#Table t9a: Covers scenario create partitioned table without data directory clause but moving each partition to different external directories and alter table force
32
33
#Table t9b: Covers scenario create partitioned table without data directory clause but moving each partition to different external directories and alter table force algo=inplace
33
34
#Table t9c: Covers scenario create partitioned table without data directory clause but moving each partition to different external directories and alter table force algo=copy
@@ -296,18 +297,24 @@ eval CREATE TABLE `t8a` (a INT, b INT) PARTITION BY RANGE(a) (PARTITION p0 VALUE
296
297
eval CREATE TABLE `t8b` (a INT, b INT) PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (10) $data_directory_clause, PARTITION p1 VALUES LESS THAN (20) $data_directory_clause2);
297
298
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
298
299
eval CREATE TABLE `t8c` (a INT, b INT) PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (10) $data_directory_clause, PARTITION p1 VALUES LESS THAN (20) $data_directory_clause2);
300
+
--echo # Partition table with one partition in external directory and one in default directory
301
+
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
302
+
eval CREATE TABLE `t8d` (a INT, b INT) PARTITION BY RANGE(a) (PARTITION p0 VALUES LESS THAN (10) $data_directory_clause, PARTITION p1 VALUES LESS THAN (20) );
299
303
300
304
--echo # Shutdown server
301
305
--source include/shutdown_mysqld.inc
302
306
303
-
--echo # Check that for partition p0 for t8a, t8b, t8c exist in EXTERNAL_DIR and partition p1 for for t8a, t8b, t8c exist in EXTERNAL_DIR2
307
+
--echo # Check that for partition p0 for t8a, t8b, t8c and t8d exist in EXTERNAL_DIR and partition p1 for for t8a, t8b, t8c exist in EXTERNAL_DIR2
304
308
305
309
--echo # Listing EXTERNAL_DIR
306
310
--list_files $EXTERNAL_DIR/dbtest/ *
307
311
308
312
--echo # Listing EXTERNAL_DIR2
309
313
--list_files $EXTERNAL_DIR2/dbtest/ *
310
314
315
+
--echo # List default directory. t8d's p1 partition should be present
316
+
--list_files $MYSQLD_DATADIR/dbtest *
317
+
311
318
--echo # Restart the server
312
319
--let $innodb_dirs=$EXTERNAL_DIR;$EXTERNAL_DIR2
313
320
let restart_parameters = restart: --innodb-directories=$innodb_dirs;
@@ -318,7 +325,7 @@ let restart_parameters = restart: --innodb-directories=$innodb_dirs;
318
325
ALTER TABLE dbtest.t8a FORCE;
319
326
ALTER TABLE dbtest.t8b FORCE, ALGORITHM=INPLACE;
320
327
ALTER TABLE dbtest.t8c FORCE, ALGORITHM=COPY;
321
-
328
+
ALTER TABLE dbtest.t8d FORCE, ALGORITHM=COPY;
322
329
--echo # Check that for partition p0 for t8a, t8b, t8c still exist in EXTERNAL_DIR and partition p1 for for t8a, t8b, t8c still exist in EXTERNAL_DIR2
323
330
324
331
--echo # Listing EXTERNAL_DIR
@@ -327,10 +334,13 @@ ALTER TABLE dbtest.t8c FORCE, ALGORITHM=COPY;
327
334
--echo # Listing EXTERNAL_DIR2
328
335
--list_files $EXTERNAL_DIR2/dbtest/ *
329
336
337
+
--echo # List default directory. t8d's p1 partition should be present
338
+
--list_files $MYSQLD_DATADIR/dbtest *
339
+
330
340
--echo # Shutdown server
331
341
--source include/shutdown_mysqld.inc
332
342
333
-
--echo # Now lets move all partitioned tables p0 of t8a, t8b, t8c from EXTERNAL_DIR and partitioned tables p1 of t8a, t8b, t8c from EXTERNAL_DIR2 to default directory
343
+
--echo # Now lets move all partitioned tables p0 of t8a, t8b, t8c, t8d from EXTERNAL_DIR and partitioned tables p1 of t8a, t8b, t8c from EXTERNAL_DIR2 to default directory
Copy file name to clipboardExpand all lines: share/messages_to_error_log.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12301,8 +12301,8 @@ ER_IB_INDEX_PART_TOO_LONG
12301
12301
ER_DD_UPDATE_DATADIR_FLAG_FAIL
12302
12302
eng "Failed to update data directory flag for dd table with tablespace id '%llu' when ibd file for '%s' is moved to new location '%s' during server shutdown"
12303
12303
12304
-
ER_IB_MSG_FIL_STATE_MOVED_PREV_OR_HAS_DATADIR
12305
-
eng "%s DD ID: %llu - Tablespace %u, name '%s', found at '%s' outside default data directory. It is either moved or is created with 'DATA DIRECTORY'"
12304
+
ER_IB_MSG_FIL_STATE_MOVED_PREV
12305
+
eng "%s DD ID: %llu - Tablespace %u, name '%s', found at '%s' outside default data directory, but DD misses info about DATA DIRECTORY"
12306
12306
12307
12307
ER_RPL_KILL_OLD_DUMP_THREAD_ENCOUNTERED
12308
12308
eng "Upon reconnection with the replica, while initializing the dump thread for %s <%s>, an existing dump thread with the same %s was detected. The source is terminating the previous dump thread (%u), which is normal and expected."
0 commit comments