Repair corrupt 3PAR System Reporter MySQL DB

My 3PAR System Reporter server stopped sampling. I checked the sampleloop.log and saw MySQL error:

MySQL DB error executing show full columns from statvlun_hires_4: mysqlsel/db server: Table './inservstats/statvlun_hires_4' is marked as crashed and should be repaired  

Here’s what I did to fix:

$ mysqlcheck --all-databases -uroot -p

That identified 2 tables with issues:

inservstats.statpd_hires_4  
warning : 1 client is using or hasn't closed the table properly  
error : Record at pos: 119879784 is not remove-marked  
error : record delete-link-chain corrupted  
error : Corrupt

inservstats.statvlun_hires_4  
warning : Table is marked as crashed  
warning : 1 client is using or hasn't closed the table properly  
error : Record at pos: 702342512 is not remove-marked  
error : record delete-link-chain corrupted  
error : Corrupt  

The others came back OK.

Log in to DB (in my case “inservstats”):

$ mysql -uroot -p inservstats

And then repair table(s):

mysql> REPAIR TABLE statpd_hires_4;  
+----------------------------+--------+----------+----------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+----------------------------+--------+----------+----------------------------------------------+
| inservstats.statpd_hires_4 | repair | warning | Number of rows changed from 242760 to 243404 |
| inservstats.statpd_hires_4 | repair | status | OK |
+----------------------------+--------+----------+----------------------------------------------+
2 rows in set (4 min 50.02 sec)  
mysql>

mysql> REPAIR TABLE statvlun_hires_4;  
+------------------------------+--------+----------+------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+------------------------------+--------+----------+------------------------------------------------+
| inservstats.statvlun_hires_4 | repair | warning | Number of rows changed from 2679897 to 2686814 |
| inservstats.statvlun_hires_4 | repair | status | OK |
+------------------------------+--------+----------+------------------------------------------------+
2 rows in set (19 min 13.59 sec)  
mysql>  

After that I was able to get 3Par System Reporter sampling again. (Confirm by doing a “cat /var/log/sampleloop/sampleloop.log”)

Leave a Reply

Your email address will not be published. Required fields are marked *