Not the answer you need?
Register and ask your own question!

Import tablespace crashes at rem0rec.c line 561 related to index->id in .exp file

danzhidanzhi EntrantCurrent User Role Beginner
Import tablespace failed (MySQL 5.5) because InnoDB panic and abort at storage/innobase/rem/rem0rec.c line 561. I compare with the .exp file with the one from another backup noticed the index->id field is different. If I overwrite the .exp file with the "good" one from another backup, the restore actually succeeded! In either case, the backup was generated from another machine. It suggests that the crash has something to do the index->id field in .exp file.

What is exactly the index->id field? How do I check whether the value is correct? How to prevent the crash?


InnoDB: Using DIRECT_IO for IMPORT TABLESPACE.
InnoDB: Import: The extended import of bb_replica_1/bb_local_secondary_index_0 is being started.
InnoDB: Import: 1 indexes have been detected.
InnoDB: Starting chunked import: Wed May 10 00:27:21 2017
InnoDB: chunk size: 8
InnoDB: free_limit_bytes: 10485760
InnoDB: Progress in %: [errp:5] 1 [errp:9] [errp:11] 2 [errp:13] [errp:15] [errp:17] [errp:19] 3 [errp:22] 4 [errp:26] [errp:28] [errp:31] 5 [errp:33] [errp:35] 6 7 8 9 10 [errp:66] [errp:68] [errp:70] 11 [errp:75] 12 [errp:81] [errp:83] 13 [errp:86]170510 0:27:21 InnoDB: Assertion failure in thread 140530323629824 in file /local/p4clients/pkgbuild-gUZYA/workspace/build/BBMysql/BigBirdMysql-5.5.11.147.54/RHEL5_64/DEV.STD.PTHREAD/build/private/mysql/build/storage/innobase/rem/rem0rec.c line 561
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
170510 0:27:21 - mysqld got signal 6 ;

mysql/storage/innobase/rem/rem0rec.c
546 if (dict_table_is_comp(index->table)) {
547 switch (UNIV_EXPECT(rec_get_status(rec),
548 REC_STATUS_ORDINARY)) {
549 case REC_STATUS_ORDINARY:
550 n = dict_index_get_n_fields(index);
551 break;
552 case REC_STATUS_NODE_PTR:
553 n = dict_index_get_n_unique_in_tree(index) + 1;
554 break;
555 case REC_STATUS_INFIMUM:
556 case REC_STATUS_SUPREMUM:
557 /* infimum or supremum record */
558 n = 1;
559 break;
560 default:
561 ut_error;
562 return(NULL);
563 }
564 } else {
565 n = rec_get_n_fields_old(rec);
566 }

The original .exp file involved in the crash.
> hexdump -C bb_local_secondary_index_0.exp
00000000 78 70 6f 72 74 69 6e 66 00 00 00 01 62 62 5f 72 |xportinf....bb_r|
00000010 65 70 6c 69 63 61 5f 31 35 30 39 2f 62 62 5f 6c |eplica_1509/bb_l|
00000020 6f 63 61 6c 5f 73 65 63 6f 6e 64 61 72 79 5f 69 |ocal_secondary_i|
00000030 6e 64 65 78 5f 30 00 00 00 00 00 00 00 00 00 00 |ndex_0..........|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200 00 00 00 00 00 00 01 70 00 00 00 03 50 52 49 4d |.......p....PRIM|
00000210 41 52 59 00 00 00 00 00 00 00 00 00 00 00 00 00 |ARY.............|
00000220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00004000

Code that generate the .exp file (line 6077 write the index->id)
percona-xtrabackup/storage/innobase/xtrabackup/src/xtrabackup.cc code
6019 strcpy(info_file_path +
6020 strlen(info_file_path) -
6021 4, ".exp");

6061 /* init exp file */
6062 memset(page, 0, UNIV_PAGE_SIZE);
6063 mach_write_to_4(page , 0x78706f72UL);
6064 mach_write_to_4(page + 4, 0x74696e66UL);/*"xportinf"*/
6065 mach_write_to_4(page + 8, n_index);
6066 strncpy((char *) page + 12,
6067 table_name, 500);
6068
6069 msg("xtrabackup: export metadata of "
6070 "table '%s' to file `%s` "
6071 "(%lu indexes)\n",
6072 table_name, info_file_path,
6073 n_index);
6074
6075 n_index = 1;
6076 while (index) {
6077 mach_write_to_8(page + n_index * 512, index->id);
6078 mach_write_to_4(page + n_index * 512 + 8,
6079 index->page);
6080 strncpy((char *) page + n_index * 512 +
6081 12, index->name, 500);
6082
6083 msg("xtrabackup: name=%s, "
6084 "id.low=%lu, page=%lu\n",
6085 index->name,
6086 (ulint)(index->id &
6087 0xFFFFFFFFUL),
6088 (ulint) index->page);
6089 index = dict_table_get_next_index(index);
6090 n_index++;
6091 }

Comments

  • danzhidanzhi Entrant Current User Role Beginner
    The issue was due to slight table schema differences on the import mysql. Once the table schema is fixed, the error disappears! Unfortunately import tablespace does not tell a higher level error to indicate the schema mismatch so it took a while to figure out.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.