Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
649451ae
Commit
649451ae
authored
Oct 01, 2018
by
Jan Lindström
Committed by
GitHub
Oct 01, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #875 from tempesta-tech/sysprg/MDEV-16656
MDEV-16656: DROP DATABASE crashes the Galera Cluster
parents
865237e5
c62e49d0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
6 deletions
+126
-6
mysql-test/suite/galera/r/galera_drop_database.result
mysql-test/suite/galera/r/galera_drop_database.result
+17
-0
mysql-test/suite/galera/t/galera_drop_database.test
mysql-test/suite/galera/t/galera_drop_database.test
+65
-0
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0fts.cc
+22
-3
storage/xtradb/fts/fts0fts.cc
storage/xtradb/fts/fts0fts.cc
+22
-3
No files found.
mysql-test/suite/galera/r/galera_drop_database.result
0 → 100644
View file @
649451ae
CREATE DATABASE fts;
USE fts;
CREATE TABLE fts_t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB;
CREATE TABLE fts_t2 (f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB;
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
INSERT INTO fts_t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
INSERT INTO fts_t2 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
DROP TABLE ten;
UPDATE fts_t1 SET f2 = 'abcd';
UPDATE fts_t2 SET f2 = 'efjh';
USE fts;
DROP TABLE fts_t1;
DROP TABLE fts_t2;
SHOW TABLES;
Tables_in_fts
DROP DATABASE fts;
mysql-test/suite/galera/t/galera_drop_database.test
0 → 100644
View file @
649451ae
#
# This test tests a DROP empty database
#
--
source
include
/
galera_cluster
.
inc
--
source
include
/
have_innodb
.
inc
# Save original auto_increment_offset values.
--
let
$node_1
=
node_1
--
let
$node_2
=
node_2
--
source
include
/
auto_increment_offset_save
.
inc
CREATE
DATABASE
fts
;
USE
fts
;
CREATE
TABLE
fts_t1
(
f1
INT
PRIMARY
KEY
AUTO_INCREMENT
,
f2
VARCHAR
(
100
),
FULLTEXT
(
f2
))
ENGINE
=
InnoDB
;
CREATE
TABLE
fts_t2
(
f2
VARCHAR
(
100
),
FULLTEXT
(
f2
))
ENGINE
=
InnoDB
;
# Insert 1K rows
CREATE
TABLE
ten
(
f1
INTEGER
)
ENGINE
=
InnoDB
;
INSERT
INTO
ten
VALUES
(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
),(
10
);
INSERT
INTO
fts_t1
(
f2
)
SELECT
'foobarbaz'
FROM
ten
AS
a1
,
ten
AS
a2
,
ten
AS
a3
;
INSERT
INTO
fts_t2
(
f2
)
SELECT
'foobarbaz'
FROM
ten
AS
a1
,
ten
AS
a2
,
ten
AS
a3
;
DROP
TABLE
ten
;
UPDATE
fts_t1
SET
f2
=
'abcd'
;
UPDATE
fts_t2
SET
f2
=
'efjh'
;
--
connection
node_2
let
$wsrep_cluster_address
=
`SELECT @@global.wsrep_node_incoming_address`
;
--
source
include
/
restart_mysqld
.
inc
--
connection
node_1
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
2
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_size'
;
--
source
include
/
wait_condition
.
inc
--
let
$galera_connection_name
=
node_2a
--
let
$galera_server_number
=
2
--
source
include
/
galera_connect
.
inc
--
connection
node_2a
--
source
include
/
wait_until_ready
.
inc
--
connection
node_1
--
let
$restart_parameters
=
--
wsrep
-
cluster
-
address
=
gcomm
://
$wsrep_cluster_address
--
source
include
/
restart_mysqld
.
inc
--
connection
node_2a
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
2
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_size'
;
--
source
include
/
wait_condition
.
inc
--
let
$galera_connection_name
=
node_1a
--
let
$galera_server_number
=
1
--
source
include
/
galera_connect
.
inc
--
connection
node_1a
--
source
include
/
wait_until_ready
.
inc
USE
fts
;
DROP
TABLE
fts_t1
;
DROP
TABLE
fts_t2
;
SHOW
TABLES
;
DROP
DATABASE
fts
;
# Restore original auto_increment_offset values.
--
let
$node_1
=
node_1a
--
let
$node_2
=
node_2a
--
source
include
/
auto_increment_offset_restore
.
inc
--
source
include
/
galera_end
.
inc
storage/innobase/fts/fts0fts.cc
View file @
649451ae
...
@@ -2762,7 +2762,7 @@ fts_cmp_set_sync_doc_id(
...
@@ -2762,7 +2762,7 @@ fts_cmp_set_sync_doc_id(
mutex_enter
(
&
cache
->
doc_id_lock
);
mutex_enter
(
&
cache
->
doc_id_lock
);
/* For each sync operation, we will add next_doc_id by 1,
/* For each sync operation, we will add next_doc_id by 1,
so to mark a sync operation */
so to mark a sync operation */
if
(
cache
->
next_doc_id
<
cache
->
synced_doc_id
+
1
)
{
if
(
cache
->
next_doc_id
<
=
cache
->
synced_doc_id
)
{
cache
->
next_doc_id
=
cache
->
synced_doc_id
+
1
;
cache
->
next_doc_id
=
cache
->
synced_doc_id
+
1
;
}
}
mutex_exit
(
&
cache
->
doc_id_lock
);
mutex_exit
(
&
cache
->
doc_id_lock
);
...
@@ -6665,7 +6665,6 @@ fts_rename_aux_tables_to_hex_format(
...
@@ -6665,7 +6665,6 @@ fts_rename_aux_tables_to_hex_format(
"All the fts index associated with the table are "
"All the fts index associated with the table are "
"marked as corrupted. Please rebuild the "
"marked as corrupted. Please rebuild the "
"index again."
,
parent_table
->
name
);
"index again."
,
parent_table
->
name
);
fts_sql_rollback
(
trx_rename
);
/* Corrupting the fts index related to parent table. */
/* Corrupting the fts index related to parent table. */
trx_t
*
trx_corrupt
;
trx_t
*
trx_corrupt
;
...
@@ -7042,7 +7041,27 @@ fts_check_and_drop_orphaned_tables(
...
@@ -7042,7 +7041,27 @@ fts_check_and_drop_orphaned_tables(
/* If the aux table is in decimal format, we should
/* If the aux table is in decimal format, we should
rename it, so push it to aux_tables_to_rename */
rename it, so push it to aux_tables_to_rename */
if
(
!
drop
&&
rename
)
{
if
(
!
drop
&&
rename
)
{
ib_vector_push
(
aux_tables_to_rename
,
aux_table
);
/* 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
<
fts_aux_table_t
*>
(
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
);
}
}
}
if
(
i
+
1
<
ib_vector_size
(
tables
))
{
if
(
i
+
1
<
ib_vector_size
(
tables
))
{
...
...
storage/xtradb/fts/fts0fts.cc
View file @
649451ae
...
@@ -2761,7 +2761,7 @@ fts_cmp_set_sync_doc_id(
...
@@ -2761,7 +2761,7 @@ fts_cmp_set_sync_doc_id(
mutex_enter
(
&
cache
->
doc_id_lock
);
mutex_enter
(
&
cache
->
doc_id_lock
);
/* For each sync operation, we will add next_doc_id by 1,
/* For each sync operation, we will add next_doc_id by 1,
so to mark a sync operation */
so to mark a sync operation */
if
(
cache
->
next_doc_id
<
cache
->
synced_doc_id
+
1
)
{
if
(
cache
->
next_doc_id
<
=
cache
->
synced_doc_id
)
{
cache
->
next_doc_id
=
cache
->
synced_doc_id
+
1
;
cache
->
next_doc_id
=
cache
->
synced_doc_id
+
1
;
}
}
mutex_exit
(
&
cache
->
doc_id_lock
);
mutex_exit
(
&
cache
->
doc_id_lock
);
...
@@ -6664,7 +6664,6 @@ fts_rename_aux_tables_to_hex_format(
...
@@ -6664,7 +6664,6 @@ fts_rename_aux_tables_to_hex_format(
"All the fts index associated with the table are "
"All the fts index associated with the table are "
"marked as corrupted. Please rebuild the "
"marked as corrupted. Please rebuild the "
"index again."
,
parent_table
->
name
);
"index again."
,
parent_table
->
name
);
fts_sql_rollback
(
trx_rename
);
/* Corrupting the fts index related to parent table. */
/* Corrupting the fts index related to parent table. */
trx_t
*
trx_corrupt
;
trx_t
*
trx_corrupt
;
...
@@ -7041,7 +7040,27 @@ fts_check_and_drop_orphaned_tables(
...
@@ -7041,7 +7040,27 @@ fts_check_and_drop_orphaned_tables(
/* If the aux table is in decimal format, we should
/* If the aux table is in decimal format, we should
rename it, so push it to aux_tables_to_rename */
rename it, so push it to aux_tables_to_rename */
if
(
!
drop
&&
rename
)
{
if
(
!
drop
&&
rename
)
{
ib_vector_push
(
aux_tables_to_rename
,
aux_table
);
/* 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
<
fts_aux_table_t
*>
(
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
);
}
}
}
if
(
i
+
1
<
ib_vector_size
(
tables
))
{
if
(
i
+
1
<
ib_vector_size
(
tables
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment