From e855912733287d496cb2f429c8019005aaac9d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 4 Oct 2018 13:29:29 +0300 Subject: Test by reverting MDEV-16656: DROP DATABASE crashes the Galera Cluster --- mysql-test/suite/galera/disabled.def | 3 ++- storage/innobase/fts/fts0fts.cc | 25 +++---------------------- storage/xtradb/fts/fts0fts.cc | 25 +++---------------------- 3 files changed, 8 insertions(+), 45 deletions(-) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index efd02a14fec..603031f52b7 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -33,4 +33,5 @@ galera_gc_fc_limit : MDEV-17061 Test failure on galera.galera_gc_fc_limit partition : MDEV-13881 galera.partition failed in buildbot with wrong result galera_as_slave_replication_budle : MDEV-15785 Test case galera_as_slave_replication_bundle caused debug assertion galera_wan : MDEV-17259: Test failure on galera.galera_wan -#galera_pc_ignore_sb : MDEV-17357 Test failure on galera.galera_pc_ignore_sb +galera_pc_ignore_sb : MDEV-17357 Test failure on galera.galera_pc_ignore_sb +galera_drop_database : test diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index 04aaff96b91..a5b2bbb47ce 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -2762,7 +2762,7 @@ retry: mutex_enter(&cache->doc_id_lock); /* For each sync operation, we will add next_doc_id by 1, so to mark a sync operation */ - if (cache->next_doc_id <= cache->synced_doc_id) { + if (cache->next_doc_id < cache->synced_doc_id + 1) { cache->next_doc_id = cache->synced_doc_id + 1; } mutex_exit(&cache->doc_id_lock); @@ -6665,6 +6665,7 @@ fts_rename_aux_tables_to_hex_format( "All the fts index associated with the table are " "marked as corrupted. Please rebuild the " "index again.", parent_table->name); + fts_sql_rollback(trx_rename); /* Corrupting the fts index related to parent table. */ trx_t* trx_corrupt; @@ -7041,27 +7042,7 @@ fts_check_and_drop_orphaned_tables( /* If the aux table is in decimal format, we should rename it, so push it to aux_tables_to_rename */ if (!drop && rename) { - /* It is necessary to check that the table with - this name is missing in the vector - otherwise it - can be renamed twice: */ - bool rename_table = true; - for (ulint count = 0; - count < ib_vector_size(aux_tables_to_rename); - count++) { - fts_aux_table_t* rename_aux = - static_cast( - ib_vector_get(aux_tables_to_rename, - count)); - if (strcmp(rename_aux->name, - aux_table->name) == 0) { - rename_table = false; - break; - } - } - if (rename_table) { - ib_vector_push(aux_tables_to_rename, - aux_table); - } + ib_vector_push(aux_tables_to_rename, aux_table); } if (i + 1 < ib_vector_size(tables)) { diff --git a/storage/xtradb/fts/fts0fts.cc b/storage/xtradb/fts/fts0fts.cc index d5128955f56..5981c24c470 100644 --- a/storage/xtradb/fts/fts0fts.cc +++ b/storage/xtradb/fts/fts0fts.cc @@ -2761,7 +2761,7 @@ retry: mutex_enter(&cache->doc_id_lock); /* For each sync operation, we will add next_doc_id by 1, so to mark a sync operation */ - if (cache->next_doc_id <= cache->synced_doc_id) { + if (cache->next_doc_id < cache->synced_doc_id + 1) { cache->next_doc_id = cache->synced_doc_id + 1; } mutex_exit(&cache->doc_id_lock); @@ -6664,6 +6664,7 @@ fts_rename_aux_tables_to_hex_format( "All the fts index associated with the table are " "marked as corrupted. Please rebuild the " "index again.", parent_table->name); + fts_sql_rollback(trx_rename); /* Corrupting the fts index related to parent table. */ trx_t* trx_corrupt; @@ -7040,27 +7041,7 @@ fts_check_and_drop_orphaned_tables( /* If the aux table is in decimal format, we should rename it, so push it to aux_tables_to_rename */ if (!drop && rename) { - /* It is necessary to check that the table with - this name is missing in the vector - otherwise it - can be renamed twice: */ - bool rename_table = true; - for (ulint count = 0; - count < ib_vector_size(aux_tables_to_rename); - count++) { - fts_aux_table_t* rename_aux = - static_cast( - ib_vector_get(aux_tables_to_rename, - count)); - if (strcmp(rename_aux->name, - aux_table->name) == 0) { - rename_table = false; - break; - } - } - if (rename_table) { - ib_vector_push(aux_tables_to_rename, - aux_table); - } + ib_vector_push(aux_tables_to_rename, aux_table); } if (i + 1 < ib_vector_size(tables)) { -- cgit v1.2.1