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:
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:
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.
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:
... data_file_ sizes = 0; data_file_ sizes += srv_data_ file_sizes[ i];
2769 sum_of_
2770
2771 for (i = 0; i < srv_n_data_files; i++) {
2772 sum_of_
2773 }
... only_mode extend_ last_data_ file data_file_ sizes < tablespace_ size_in_ header) { timestamp( stderr) ; size_in_ header) ; timestamp( stderr) ; data_file_ sizes); timestamp( stderr) ;
2821 if (!srv_read_
2822 && srv_auto_
2823 && sum_of_
2824
2825 ut_print_
2826 fprintf(stderr,
2827 " InnoDB: Error: tablespace size stored in header"
2828 " is %lu pages, but\n",
2829 (ulong) tablespace_
2830 ut_print_
2831 fprintf(stderr,
2832 " InnoDB: the sum of data file sizes"
2833 " is only %lu pages\n",
2834 (ulong) sum_of_
2835
2836 if (srv_force_recovery == 0) {
2837
2838 ut_print_
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.