Dear friends, I'm writing here again because I get some more troubles with something like "silent data lost" in case of unproper mysql server shutdown.
I'm speaking of some installation (default server config) in Windows 7 enviroment in small-office computer PC for web application. I underline that I found this problem in more then one case with different hardware and different application.
The result of this problem is that I silently lost some data, my application logs has many record but in database table everything was rollback to some days before. I'm sure that there was a good commit BEFORE the data lost, but from the logs seems that the database shutdown was interrupted by a poweroff.
This is the story:
2015-05-05 some data insertion in tables found in the application log.
2015-05-17 some data insertion in tables found in the application log.
2015-05-18 server started and the database was rollback to 2015-05-05
I have all database logs and also innodb monitor output, but I did not find nothing but this:
****
2015-05-18 19:49:31 2252 [Note] InnoDB: The log sequence numbers 15207593 and 15207593 in ibdata files do not match the log sequence number 15234000 in the ib_logfiles!
2015-05-18 19:49:31 2252 [Note] InnoDB: Database was not shutdown normally!
2015-05-18 19:49:31 2252 [Note] InnoDB: Starting crash recovery.
2015-05-18 19:49:31 2252 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-05-18 19:49:32 2252 [Note] InnoDB: Restoring possible half-written data pages
2015-05-18 19:49:32 2252 [Note] InnoDB: from the doublewrite buffer...
2015-05-18 19:49:35 2252 [Note] InnoDB: 128 rollback segment(s) are active.
2015-05-18 19:49:35 2252 [Note] InnoDB: Waiting for purge to start
2015-05-18 19:49:35 2252 [Note] InnoDB: 5.6.21 started; log sequence number 15234000
****
These are the innodb log seq monitor at 2015-05-17 shutdown:
***
=====================================
2015-05-17 21:26:11 17a8 INNODB MONITOR OUTPUT
=====================================
...
---
LOG
---
Log sequence number 15233585
Log flushed up to 15233585
Pages flushed up to 15233585
Last checkpoint at 15233585
0 pending log writes, 0 pending chkp writes
154 log i/o's done, 0.00 log i/o's/second
***
These are the innodb log seq monitor at 2015-06-03 startup:
***
=====================================
2015-06-03 20:51:42 12b4 INNODB MONITOR OUTPUT
=====================================
...
---
LOG
---
Log sequence number 15234656
Log flushed up to 15234656
Pages flushed up to 15234441
Last checkpoint at 15234441
0 pending log writes, 0 pending chkp writes
9 log i/o's done, 0.20 log i/o's/second
***
I do not want to spam more logs, but if can be useful I can post them here.
The only clue I got is that the computer shutdown of 2015-05-17 may have been interrupted with a power off. This is the last log of Host.err:
2015-05-17 21:26:41 2360 [Note] InnoDB: Starting shutdown...
My question is:
How can I prevent this problem by mysql configuration (obviously apart properly power off the pc)?
How can I see this error? In the mysql logs I have only "note" logs and no errors!
I'm speaking of some installation (default server config) in Windows 7 enviroment in small-office computer PC for web application. I underline that I found this problem in more then one case with different hardware and different application.
The result of this problem is that I silently lost some data, my application logs has many record but in database table everything was rollback to some days before. I'm sure that there was a good commit BEFORE the data lost, but from the logs seems that the database shutdown was interrupted by a poweroff.
This is the story:
2015-05-05 some data insertion in tables found in the application log.
2015-05-17 some data insertion in tables found in the application log.
2015-05-18 server started and the database was rollback to 2015-05-05
I have all database logs and also innodb monitor output, but I did not find nothing but this:
****
2015-05-18 19:49:31 2252 [Note] InnoDB: The log sequence numbers 15207593 and 15207593 in ibdata files do not match the log sequence number 15234000 in the ib_logfiles!
2015-05-18 19:49:31 2252 [Note] InnoDB: Database was not shutdown normally!
2015-05-18 19:49:31 2252 [Note] InnoDB: Starting crash recovery.
2015-05-18 19:49:31 2252 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-05-18 19:49:32 2252 [Note] InnoDB: Restoring possible half-written data pages
2015-05-18 19:49:32 2252 [Note] InnoDB: from the doublewrite buffer...
2015-05-18 19:49:35 2252 [Note] InnoDB: 128 rollback segment(s) are active.
2015-05-18 19:49:35 2252 [Note] InnoDB: Waiting for purge to start
2015-05-18 19:49:35 2252 [Note] InnoDB: 5.6.21 started; log sequence number 15234000
****
These are the innodb log seq monitor at 2015-05-17 shutdown:
***
=====================================
2015-05-17 21:26:11 17a8 INNODB MONITOR OUTPUT
=====================================
...
---
LOG
---
Log sequence number 15233585
Log flushed up to 15233585
Pages flushed up to 15233585
Last checkpoint at 15233585
0 pending log writes, 0 pending chkp writes
154 log i/o's done, 0.00 log i/o's/second
***
These are the innodb log seq monitor at 2015-06-03 startup:
***
=====================================
2015-06-03 20:51:42 12b4 INNODB MONITOR OUTPUT
=====================================
...
---
LOG
---
Log sequence number 15234656
Log flushed up to 15234656
Pages flushed up to 15234441
Last checkpoint at 15234441
0 pending log writes, 0 pending chkp writes
9 log i/o's done, 0.20 log i/o's/second
***
I do not want to spam more logs, but if can be useful I can post them here.
The only clue I got is that the computer shutdown of 2015-05-17 may have been interrupted with a power off. This is the last log of Host.err:
2015-05-17 21:26:41 2360 [Note] InnoDB: Starting shutdown...
My question is:
How can I prevent this problem by mysql configuration (obviously apart properly power off the pc)?
How can I see this error? In the mysql logs I have only "note" logs and no errors!