Bug #107959 | copy ddl rollback cause some inconsistence | ||
---|---|---|---|
Submitted: | 25 Jul 2022 9:25 | Modified: | 27 Jul 2022 12:59 |
Reporter: | Haiping Zhang | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S2 (Serious) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | ddl log |
[25 Jul 2022 9:25]
Haiping Zhang
[25 Jul 2022 12:15]
MySQL Verification Team
Hi Mr. Zhang, Thank you for your bug report. We can see that you are using latest available 8.0 release for your analysis. We have inspected carefully your analysis and your patches and we find that they are essentially correct, although some changes might be necessary. Verified as reported. Thank you for your contribution.
[25 Jul 2022 12:41]
Haiping Zhang
Revert the [Suggested fix] 1. What we should do is to skip the evicted table in row_rename_table_for_mysql, just like ``` diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 6e430c26a6f..4e377281108 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -4182,6 +4182,19 @@ dberr_t row_rename_table_for_mysql(const char *old_name, const char *new_name, goto funct_exit; } + /* A special case during replay ddl log where we try to open the + table (t1) but get the temp table cache element (#sql2-xxx). */ + if (replay && table && !table->is_intrinsic() && + strcmp(old_name, table->name.m_name) != 0) { + ut_a(!old_is_tmp && new_is_tmp && + row_is_mysql_tmp_table_name(table->name.m_name)); + ib::error() << "Replaying ddl log fetchs wrong cache element. " + << "target name:" << old_name << ", fetched name:" + << table->name.m_name; + err = DB_TABLE_NOT_FOUND; + goto funct_exit; + } + ``` 2. dd_table_open_on_dd_obj return directly once it find a dict_table_t with same table id in table_id_hash. This is somewhat not rigorous. 3. It's also confusing why we should rename tablespace during applying Log_Type::RENAME_TABLE_LOG, since Log_Type::RENAME_SPACE_LOG does the same thing. Thanks very much
[27 Jul 2022 12:59]
Haiping Zhang
if dict table of #sql2-xxx is also evicted, other errors will happen. I think we can't load info from dd storage when ddl rollback, just skip if dict cache is not in memory.
[27 Jul 2022 13:02]
MySQL Verification Team
Hi, Thank you for the additional info .....
[2 Aug 2024 6:52]
zongyi chen
it happend to me too.it will lead to crash and destroy atomicity ddl. so should it be fixed soon?
[2 Aug 2024 9:35]
MySQL Verification Team
Hi Mr. chen, We truly do not know. Each Development team has schedules of it's own, which are changed on the weekly basis. Hence, nobody can truly answer your question.