Comment 7 for bug 1428385

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote : Re: Percona Server 5.6.22-72.0 failed to start

There are two problem here:

1. How you ended up with tablespace size stored in header being exactly 153M bigger than total size of all ibdata* files when you had it set as:

innodb_data_file_path = /ssd/data/ibdata1:806578M;/mysql3/inno_db/data/ibdata2:390354M;/mysql4/inno_db/data/ibdata3:729522M;/mysql5/inno_db/data/ibdata4:50M:autoextend

To find this out I asked for the entire error log, while you sent me last part for the startup attemp, but nothing before that. This is why we later asked for /var/log/messages etc... Probably the file was extending when some crash or unplanned restart happened, and error log should show that.

2. Why you can start it with adding the same file twice into innodb_data_filke_path, once for the real size and second time for 153M and autoextend:

innodb_data_file_path = /ssd/data/ibdata1:806578M;/mysql3/inno_db/data/ibdata2:390354M;/mysql4/inno_db/data/ibdata3:729522M;/mysql5/inno_db/data/ibdata4:370481M;/mysql5/inno_db/data/ibdata4:153M:autoextend

but can not start with just:

innodb_data_file_path = /ssd/data/ibdata1:806578M; /mysql3/inno_db/data/ibdata2:390354M; /mysql4/inno_db/data/ibdata3:729522M;/mysql5/inno_db/data/ibdata4:370481M:autoextend

It would be nice to get error log content for this attemp as well (or, again, entire error log, with everything you've tried and what happened before).

For the second problem, in the source code (storage/innobase/srv/srv0start.cc, current 5.6) we clearly see:

...
   2769 sum_of_data_file_sizes = 0;
   2770
   2771 for (i = 0; i < srv_n_data_files; i++) {
   2772 sum_of_data_file_sizes += srv_data_file_sizes[i];
   2773 }

...
   2821 if (!srv_read_only_mode
   2822 && srv_auto_extend_last_data_file
   2823 && sum_of_data_file_sizes < tablespace_size_in_header) {
   2824
   2825 ut_print_timestamp(stderr);
   2826 fprintf(stderr,
   2827 " InnoDB: Error: tablespace size stored in header"
   2828 " is %lu pages, but\n",
   2829 (ulong) tablespace_size_in_header);
   2830 ut_print_timestamp(stderr);
   2831 fprintf(stderr,
   2832 " InnoDB: the sum of data file sizes"
   2833 " is only %lu pages\n",
   2834 (ulong) sum_of_data_file_sizes);
   2835
   2836 if (srv_force_recovery == 0) {
   2837
   2838 ut_print_timestamp(stderr);
   2839 fprintf(stderr,
   2840 " InnoDB: Cannot start InnoDB. The tail of"
...

and from that it's clear that only total size from all entries in innodb_data_file_path and having autoextend for the last one matter for further startup. Nobody seems to try to check for duplicate file entries.

So, if there is some other value to try for startup, it's this one:

innodb_data_file_path = /ssd/data/ibdata1:806578M; /mysql3/inno_db/data/ibdata2:390354M; /mysql4/inno_db/data/ibdata3:729522M;/mysql5/inno_db/data/ibdata4:370634M:autoextend

I've added 153M of "missing" size according to header to the already existing single entry for /mysql5/inno_db/data/ibdata4. I expect server to start with this value.