← Back to team overview

maria-discuss team mailing list archive

Re: Cannot open datafile for read-only: './dbmail/#sql2-704-271.ibd' OS error: 71

 

On Mon, Sep 16, 2019 at 5:26 PM Reindl Harald <h.reindl@xxxxxxxxxxxxx> wrote:
> Am 16.09.19 um 15:58 schrieb Sergei Golubchik:
> > It looks like the only way to get rid of this warning would be to drop
> > this table manually. Like, `create table t1 ... engine=innodb`
> > then copy t1.idb and t1.frm to #sql2-704-271.* and then drop t1 and
> > `#mysql50#sql2-704-271` tables.

Actually, you should not copy the .ibd file, because that could
trigger an assertion failure in InnoDB. (Heikki's opinion was that the
best thing to do when encountering corruption is to take down the
whole server. I disagree, but it would be a lot of work to fix all the
code.)

InnoDB should allow DROP TABLE just fine even if the .ibd file does not exist.

> it's a shame that you simply can't get rid of garbage from the global
> tablespace

Starting with MDEV-14585 InnoDB actually does drop #sql- tables during
startup. The #sql2 tables are intentionally preserved, because during
ALTER TABLE…ALGORIHTM=COPY there are multiple internal commits, and if
the server is killed at the right moment, then the user table will be
known only by #sql- and #sql2 names. We do not want to remove the only
copy of the table.

Ultimately, for new DDL statements, this should be fixed when
MDEV-17567 implements Atomic DDL. I do not think that we can even then
safely remove #sql2 tables from old installations, because we must
think of upgrade scenarios.

Best regards,

Marko


Follow ups

References