| Bug #16827 | Better InnoDB error message if ibdata files omitted from my.cnf | ||
|---|---|---|---|
| Submitted: | 27 Jan 2006 6:53 | Modified: | 8 Apr 2006 15:37 |
| Reporter: | Michael Loftis | ||
| Status: | Closed | ||
| Category: | Server: InnoDB | Severity: | S2 (Serious) |
| Version: | 4.1.11 | OS: | Linux (Debian 3.0 Woody) |
| Assigned to: | Bugs System | Target Version: | |
[27 Jan 2006 6:53]
Michael Loftis
[27 Jan 2006 14:01]
Heikki Tuuri
Michael, the error means serious corruption of the InnoDB tablespace. It is trying to initialize the undo log lists at the server startup, but a pointer points outside of the tablespace. Please post the COMPLETE UNEDITED .err log from the server, both before and after the upgrade. Please explain in detail how did you make the upgrade. I have never before seen this error in an upgrade. Regards, Heikki
[27 Jan 2006 21:38]
Michael Loftis
That's it, that's the whole error log. What happened was that for some reason the particular package I was using silently overwrote the my.cnf file. It then didn't have the complete list of data files that it was supposed to use. When it started up it was totally unable to detect this condition and instead of giving an error message that might help one to quickly diagnose the issue, it gave that rather worrying, and unhelpful message instead. I'll be contacting the package maintainers once I figure out why it overwrote the my.cnf file which it should never do in Debian, atleast not w/o leaving a .dpkg-old file which it didn't do, that tells me it's broken. The snippet I gave is *all* that it logs. I can try to go back to before the upgrade but the shutdown was error free and clean, and the issue really is that when an ibdata area was removed accidentally from the configuration, innodb essentially stopped the whole thing from coming up with the given traceback and messages.
[28 Jan 2006 11:04]
Heikki Tuuri
Michael, ok, the problem was that the new my.cnf was unaware of ibdata2 etc. that you had. Hmm... the solution to situations like this would be to keep information of all ibdata files and ib_logfiles in ibdata1. Then InnoDB would detect that my.cnf is wrong. But a problem is that people can edit my.cnf and move ibdata files to different directories, split ibdata files etc., and that will not get reflected in ibdata1! But in this particular case we COULD detect that the combined size of ibdata files that are specified in my.cnf is smaller than the tablespace size that InnoDB has stored internally. That is always a very serious error. I will look if we can easily notice this and print a warning to the .err log. Thank you, Heikki
[6 Feb 2006 18:42]
Heikki Tuuri
Michael, I tested 4.1.16. It does detect if the combined size of ibdata files is smaller than the tablespace size that is stamped in ibdata1. I cannot explain why in your case mysqld did start up. Do you have any theory? Regards, Heikki heikki@127:~/mysql-4.1.16/sql$ ./mysqld InnoDB: Error: tablespace size stored in header is 1920 pages, but InnoDB: the sum of data file sizes is 640 pages InnoDB: Cannot start InnoDB. The tail of the system tablespace is InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an InnoDB: inappropriate way, removing ibdata files from there? InnoDB: You can set innodb_force_recovery=1 in my.cnf to force InnoDB: a startup if you are trying to recover a badly corrupt database. 060206 19:38:56 [ERROR] Can't init databases 060206 19:38:56 [ERROR] Aborting 060206 19:38:56 [Note] ./mysqld: Shutdown complete
[6 Feb 2006 18:52]
Heikki Tuuri
Michael, ok, I found the explanation. InnoDB does the check of the tablespace size only at the end of its startup. In your case mysqld crashed before that. Hmm... maybe the easiest thing is to change the error message that InnoDB DID print in your case. Assigning this to Osku. He should add: "InnoDB: If you get this error at mysqld startup, please check that your my.cnf\n" "InnoDB: matches the ibdata files that you have in the MySQL server.\n" This should be fixed in 5.0 and 5.1. Thank you, Heikki
[9 Feb 2006 22:23]
Michael Loftis
Thanks sorry about not responding immediately, but yes this is exactly what I was hoping for. I/we here probabyl won't get caught by it again, but this will help reduce confustion for others. I have yet to open a debian bug ticket though to fix the root of this cause (dpkg being told by install scripts to blow a way a .cnf file) Thanks!
[5 Apr 2006 21:15]
Elliot Murphy
Fixed in InnoDB snapshot368; fixes are in 5.0.20.
[8 Apr 2006 15:37]
Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.
If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information
about accessing the source trees is available at
http://www.mysql.com/doc/en/Installing_source_tree.html
Additional info:
Documented bugfix in 5.0.20 changelog. Closed.
