0

MySql tables got corrupted with the following error,

016-05-17 09:57:07 30503 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_index_stats uses space ID: 2 at filepath: ./mysql/innodb_index_stats.ibd. Cannot open tablespace t0db/be_command_log which uses space ID: 2 at filepath: ./t0db/be_command_log.ibd
2016-05-17 09:57:07 7f3fa1f3c7e0  InnoDB: Operating system error number 2 in a file operation.

I have found multiple blogs and answers about fixing this issue and I myself got it recovered from it by dropping and recreating the tables.

But, here I am more interested in knowing what has caused this corruption?

I got this corruption when I, I had just loaded the latest Firmware on my cluster and had powered down all nodes in preparation for rebooting them to activate the new FW. I powered up a node, but crm_mon showed MySql error. Upon investigation I found the error was due to the corrupted tablesspace files.

Please help me in getting the reasoning behind this corruption.

Cheers!

Bhupesh Pant
  • 4,053
  • 5
  • 45
  • 70
  • 1
    Database corruption happens. Errors in the database code (rare), stray cosmic rays, improper database shutdown. I'm sure others can come up with outer examples. Anything that can fail, will. – Gilbert Le Blanc Jun 14 '16 at 13:35
  • @GilbertLeBlanc, So do you mean to say its unavoidable? And when you say improper db shutdown, I think it is db that handles it. we only configure it for proper shutdowns and start. – Bhupesh Pant Jun 14 '16 at 15:48
  • 1
    Improper database shutdown -> Abruptly losing power on the database server. It's one reason why all servers should have uninterruptible power supplies. – Gilbert Le Blanc Jun 14 '16 at 16:45
  • Check the directories, files, and their ownership and permissions. `2` means "No such file or directory". – Rick James Jun 24 '16 at 16:01

0 Answers0