← Back to team overview

maria-discuss team mailing list archive

Re: crashed tables (mariadb-5.5.33a)



>>>>> "Reindl" == Reindl Harald <h.reindl@xxxxxxxxxxxxx> writes:


>>> 131023 11:30:02 [ERROR] mysqld: Table './hvb/andersentag_meta' is marked as crashed and should be repaired
>>> 131023 11:30:02 [Warning] Checking table:   './hvb/andersentag_meta'
>>> 131023 11:30:02 [ERROR] hvb.andersentag_meta: 1 client is using or hasn't closed the table properly

Reindl> Am 23.10.2013 17:38, schrieb Jocelyn Fournier:
>> I suspect the DELAY_KEY_WRITE to be guilty in your case, are all the crashed table created with DELAY_KEY_WRITE=1 ?

Reindl> yes they are because *any* tables are created this way for years
Reindl> also in production for around 10000 tables and that is why this
Reindl> scares me to replace MySQL with MariaDB for now

I don't know of any issue with DELAY_KEY_WRITE that could cause this
issue.  What DELAY_KEY_WRITE could cause is that if your server is
going down hard, a repair would be needed to reconstruct the index.

In your case it looks you only get a warning that the table is not
closed properly but the automatic check finds the table correct.

To be able to find out what is wrong, it's first good to know how what
could generate this error/warning.

MyISAM works the following way:

- On read access the table is opened, but not touched.
- On first write, we increase a counter in the .MYI file that is used
  to detect if the file is properly closed.
- When table is closed, we decrement the counter just before we close
  the file.

Even if one gets the warning that the table was 'in use' this doesn't
normally mean that one will loose any data.  MyISAM will write all
changes to disk at the end of each statement. The only exception is if
DELAY_KEY_WRITE is used in which case the index, which can always be
reconstructed, is not written until close.

The reasons one can get this error are:
- mysqld was killed while some MyISAM that was modified was opened.
- One copied an MyISAM table while it was modified.
- One copied an MyISAM file that was not closed properly.

To find out what is wrong, it would be good to once and for all that
all your tables are ok.

You can do it the following way on the slave:

Stop the slave.
run myisamchk --check --fast --force data-directory/*/*.MYI

After the above, you can know for sure that all your tables are
properly marked as closed.  The --force option will do a check and
repair of any table that was not correct.

If you get any new errors that the table was not closed properly and
there has not been any restart of mysqld then we know that there is
some bug in the mysqld that doesn't properly decrement the table on

I am not aware of any such bugs and the open/close code has not been
touched in a very long time.  But of course anything is possible.  If
this is the case we would like to find a way to repeat your issue so
that we can fix this ASAP.


Follow ups