4031 Marko Mäkelä 2012-06-18
Bug#14198766 (followup) row_drop_table_for_mysql releases dict latch
while holding dict locks
The original patch had a problem: it could release the dictionary latch
after waiting that the background statistics thread had stopped using
the table. Fix that.
ha_innobase::commit_inplace_alter_table(): Invoke fts_optimize_remove_table()
first, before acquiring the data dictionary latch.
Approved by Jimmy Yang on IM.
modified:
storage/innobase/handler/handler0alter.cc
4030 Vasil Dimov 2012-06-18
Followup to vasil.dimov@stripped
Also skip corrupted, to be dropped and online ddl indexes during
stats snapshot create.
modified:
storage/innobase/dict/dict0stats.cc
=== modified file 'storage/innobase/handler/handler0alter.cc'
--- a/storage/innobase/handler/handler0alter.cc revid:vasil.dimov@stripped
+++ b/storage/innobase/handler/handler0alter.cc revid:marko.makela@oracle.com-20120618104154-6n87ry4rfm9sl630
@@ -3458,6 +3458,18 @@ ha_innobase::commit_inplace_alter_table(
trx_start_for_ddl(trx, op);
}
+ if (new_clustered) {
+ if (prebuilt->table->fts) {
+ ut_ad(!prebuilt->table->fts->add_wq);
+ fts_optimize_remove_table(prebuilt->table);
+ }
+
+ if (ctx->indexed_table->fts) {
+ ut_ad(!ctx->indexed_table->fts->add_wq);
+ fts_optimize_remove_table(ctx->indexed_table);
+ }
+ }
+
/* Latch the InnoDB data dictionary exclusively so that no deadlocks
or lock waits can happen in it during the data dictionary operation. */
row_mysql_lock_data_dictionary(trx);
@@ -3477,22 +3489,6 @@ ha_innobase::commit_inplace_alter_table(
requested to be dropped were not created in the copy
of the table. */
- if (prebuilt->table->fts || ctx->indexed_table->fts) {
- row_mysql_unlock_data_dictionary(trx);
-
- if (prebuilt->table->fts) {
- ut_ad(!prebuilt->table->fts->add_wq);
- fts_optimize_remove_table(prebuilt->table);
- }
-
- if (ctx->indexed_table->fts) {
- ut_ad(!ctx->indexed_table->fts->add_wq);
- fts_optimize_remove_table(ctx->indexed_table);
- }
-
- row_mysql_lock_data_dictionary(trx);
- }
-
/* A new clustered index was defined for the table
and there was no error at this point. We can
now rename the old table as a temporary table,
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-trunk branch (marko.makela:4030 to 4031) Bug#14198766 | marko.makela | 18 Jun |