/*遍历ibd文件的分支*/
#0 FetchIndexRootPages::operator() (this=0x7fffec4d7020, offset=0, block=0x7ffe90987958) at storage/innobase/row/row0import.cc:697
#1 0x0000000001c1e577 in fil_iterate (iter=..., block=0x7ffe90987958, callback=...) at storage/innobase/fil/fil0fil.cc:6451
#2 0x0000000001c1f070 in fil_tablespace_iterate (table=0x7ffe9094dcc0, n_io_buffers=1, callback=...) at storage/innobase/fil/fil0fil.cc:6666
#3 0x0000000001a1c3c7 in row_import_for_mysql (table=0x7ffe9094dcc0, prebuilt=0x7ffe90950980) at storage/innobase/row/row0import.cc:3667
#4 0x00000000018fd7ef in ha_innobase::discard_or_import_tablespace (this=0x7ffe9094acc0, discard=0 '\000') at storage/innobase/handler/ha_innodb.cc:12399
#5 0x0000000000f70250 in handler::ha_discard_or_import_tablespace (this=0x7ffe9094acc0, discard=0 '\000') at sql/handler.cc:4825
#6 0x00000000015fb719 in mysql_discard_or_import_tablespace (thd=0x7ffe90007a40, table_list=0x7ffe9001aea0, discard=false) at sql/sql_table.cc:6106
#7 0x0000000001777890 in Sql_cmd_discard_import_tablespace::execute (this=0x7ffe9001b428, thd=0x7ffe90007a40) at sql/sql_alter.cc:380
#8 0x0000000001571387 in mysql_execute_command (thd=0x7ffe90007a40, first_level=true) at sql/sql_parse.cc:4835
#9 0x00000000015733d9 in mysql_parse (thd=0x7ffe90007a40, parser_state=0x7fffec4d9680) at sql/sql_parse.cc:5570
#10 0x0000000001568a58 in dispatch_command (thd=0x7ffe90007a40, com_data=0x7fffec4d9e10, command=COM_QUERY) at sql/sql_parse.cc:1484
#11 0x00000000015678a4 in do_command (thd=0x7ffe90007a40) at sql/sql_parse.cc:1025
#12 0x00000000016976a5 in handle_connection (arg=0xfd66370) at sql/conn_handler/connection_handler_per_thread.cc:306
#13 0x0000000001d37234 in pfs_spawn_thread (arg=0xfd39b70) at storage/perfschema/pfs.cc:2190
#14 0x00007ffff7bc6e65 in start_thread () from /lib64/libpthread.so.0
#15 0x00007ffff660788d in clone () from /lib64/libc.so.6
/*遍历ibd文件的分支*/
#0 buf_flush_init_for_writing (block=0x7ffe90987958, page=0x7ffe90aa4000 "\274\271\257\026", page_zip_=0x0, newest_lsn=12577200611, skip_checksum=false) at storage/innobase/buf/buf0flu.cc:954
#1 0x0000000001a18bd5 in PageConverter::operator() (this=0x7fffec4d7640, offset=0, block=0x7ffe90987958) at storage/innobase/row/row0import.cc:2075
#2 0x0000000001c1e577 in fil_iterate (iter=..., block=0x7ffe90987958, callback=...) at storage/innobase/fil/fil0fil.cc:6451
#3 0x0000000001c1f070 in fil_tablespace_iterate (table=0x7ffe9094dcc0, n_io_buffers=1, callback=...) at storage/innobase/fil/fil0fil.cc:6666
#4 0x0000000001a1c682 in row_import_for_mysql (table=0x7ffe9094dcc0, prebuilt=0x7ffe90950980) at storage/innobase/row/row0import.cc:3740
#5 0x00000000018fd7ef in ha_innobase::discard_or_import_tablespace (this=0x7ffe9094acc0, discard=0 '\000') at storage/innobase/handler/ha_innodb.cc:12399
#6 0x0000000000f70250 in handler::ha_discard_or_import_tablespace (this=0x7ffe9094acc0, discard=0 '\000') at sql/handler.cc:4825
#7 0x00000000015fb719 in mysql_discard_or_import_tablespace (thd=0x7ffe90007a40, table_list=0x7ffe9001aea0, discard=false) at sql/sql_table.cc:6106
#8 0x0000000001777890 in Sql_cmd_discard_import_tablespace::execute (this=0x7ffe9001b428, thd=0x7ffe90007a40) at sql/sql_alter.cc:380
#9 0x0000000001571387 in mysql_execute_command (thd=0x7ffe90007a40, first_level=true) at sql/sql_parse.cc:4835
#10 0x00000000015733d9 in mysql_parse (thd=0x7ffe90007a40, parser_state=0x7fffec4d9680) at sql/sql_parse.cc:5570
#11 0x0000000001568a58 in dispatch_command (thd=0x7ffe90007a40, com_data=0x7fffec4d9e10, command=COM_QUERY) at sql/sql_parse.cc:1484
#12 0x00000000015678a4 in do_command (thd=0x7ffe90007a40) at sql/sql_parse.cc:1025
#13 0x00000000016976a5 in handle_connection (arg=0xfd66370) at sql/conn_handler/connection_handler_per_thread.cc:306
#14 0x0000000001d37234 in pfs_spawn_thread (arg=0xfd39b70) at storage/perfschema/pfs.cc:2190
#15 0x00007ffff7bc6e65 in start_thread () from /lib64/libpthread.so.0
#16 0x00007ffff660788d in clone () from /lib64/libc.so.6
/*把当前系统最新的lsn写入到ibd文件中*/
mach_write_to_8(page + FIL_PAGE_LSN, newest_lsn);
mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,newest_lsn);
/*把page checksum写入到ibd文件中*/
switch ((srv_checksum_algorithm_t) srv_checksum_algorithm) {
case SRV_CHECKSUM_ALGORITHM_CRC32:
case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
checksum = buf_calc_page_crc32(page);
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum);
alter table xxx.xx import tablespace; 会修改idb的每个page文件,如果磁盘性能差,会导致性能变慢