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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
4102d525
Commit
4102d525
authored
May 11, 2015
by
Philip Stoev
Committed by
Nirbhay Choubey
Sep 09, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refs codership/mysql-wsrep#113 - tests around FLUSH TABLE, FLUSH TABLES, LOCK TABLE
parent
2106fed8
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
181 additions
and
11 deletions
+181
-11
mysql-test/suite/galera/r/galera_applier_ftwrl_table.result
mysql-test/suite/galera/r/galera_applier_ftwrl_table.result
+15
-0
mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result
...st/suite/galera/r/galera_applier_ftwrl_table_alter.result
+26
-0
mysql-test/suite/galera/r/galera_bf_abort_flush_for_export.result
...st/suite/galera/r/galera_bf_abort_flush_for_export.result
+13
-0
mysql-test/suite/galera/r/galera_bf_abort_lock_table.result
mysql-test/suite/galera/r/galera_bf_abort_lock_table.result
+5
-1
mysql-test/suite/galera/t/galera_applier_ftwrl_table.test
mysql-test/suite/galera/t/galera_applier_ftwrl_table.test
+34
-0
mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt
...uite/galera/t/galera_applier_ftwrl_table_alter-master.opt
+1
-0
mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test
...test/suite/galera/t/galera_applier_ftwrl_table_alter.test
+37
-0
mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test
...test/suite/galera/t/galera_bf_abort_flush_for_export.test
+37
-0
mysql-test/suite/galera/t/galera_bf_abort_lock_table.test
mysql-test/suite/galera/t/galera_bf_abort_lock_table.test
+13
-10
No files found.
mysql-test/suite/galera/r/galera_applier_ftwrl_table.result
0 → 100644
View file @
4102d525
SET SESSION wsrep_sync_wait = 0;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
FLUSH TABLE t1 WITH READ LOCK;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
SET SESSION wsrep_sync_wait = 0;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
DROP TABLE t1;
mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result
0 → 100644
View file @
4102d525
SET SESSION wsrep_sync_wait = 0;
SET SESSION lock_wait_timeout = 60;
SET SESSION innodb_lock_wait_timeout=60;
SET SESSION wait_timeout=60;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
FLUSH TABLE t1 WITH READ LOCK;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
SELECT 1 FROM DUAL;
1
1
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock';
COUNT(*) = 1
1
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = 7;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` int(11) DEFAULT NULL,
PRIMARY KEY (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock';
COUNT(*) = 0
1
DROP TABLE t1;
mysql-test/suite/galera/r/galera_bf_abort_flush_for_export.result
0 → 100644
View file @
4102d525
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
FLUSH TABLES t1 FOR EXPORT;
INSERT INTO t1 VALUES (2);
SET SESSION wsrep_sync_wait = 0;
UNLOCK TABLES;
COMMIT;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
wsrep_local_aborts_increment
1
DROP TABLE t1;
mysql-test/suite/galera/r/galera_bf_abort_lock_table.result
View file @
4102d525
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
LOCK TABLE t1 WRITE;
INSERT INTO t1 VALUES (1);;
INSERT INTO t1 VALUES (2);
UNLOCK TABLES;
COMMIT;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
wsrep_local_aborts_increment
1
DROP TABLE t1;
mysql-test/suite/galera/t/galera_applier_ftwrl_table.test
0 → 100644
View file @
4102d525
#
# Test that applying plays well with FLUSH TABLE table_name WITH READ LOCK. The applier
# thread should block until UNLOCK TABLEs.
#
--
source
include
/
galera_cluster
.
inc
--
source
include
/
have_innodb
.
inc
--
connection
node_1
SET
SESSION
wsrep_sync_wait
=
0
;
CREATE
TABLE
t1
(
f1
INTEGER
PRIMARY
KEY
)
ENGINE
=
InnoDB
;
FLUSH
TABLE
t1
WITH
READ
LOCK
;
--
connection
node_2
INSERT
INTO
t1
VALUES
(
1
);
INSERT
INTO
t1
VALUES
(
2
);
--
connect
node_1a
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_1
--
connection
node_1a
SET
SESSION
wsrep_sync_wait
=
0
;
--
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
USER
=
'system user'
AND
STATE
=
'Waiting for table metadata lock'
--
source
include
/
wait_condition
.
inc
SELECT
COUNT
(
*
)
=
0
FROM
t1
;
--
connection
node_1
UNLOCK
TABLES
;
SET
SESSION
wsrep_sync_wait
=
7
;
SELECT
COUNT
(
*
)
=
2
FROM
t1
;
DROP
TABLE
t1
;
mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter-master.opt
0 → 100644
View file @
4102d525
--lock_wait_timeout=5 --innodb_lock_wait_timeout=5 --wait_timeout=5
mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test
0 → 100644
View file @
4102d525
#
# Test that applying a DDL plays well with FLUSH TABLE table_name WITH READ LOCK. The applier
# thread should block until UNLOCK TABLEs.
#
--
source
include
/
galera_cluster
.
inc
--
source
include
/
have_innodb
.
inc
--
connection
node_1
SET
SESSION
wsrep_sync_wait
=
0
;
# Those values are valid only for connection node_1. The global values from the -master.opt file apply to applier threads.
SET
SESSION
lock_wait_timeout
=
60
;
SET
SESSION
innodb_lock_wait_timeout
=
60
;
SET
SESSION
wait_timeout
=
60
;
CREATE
TABLE
t1
(
f1
INTEGER
PRIMARY
KEY
)
ENGINE
=
InnoDB
;
FLUSH
TABLE
t1
WITH
READ
LOCK
;
--
connection
node_2
ALTER
TABLE
t1
ADD
COLUMN
f2
INTEGER
;
--
connection
node_1
SELECT
1
FROM
DUAL
;
# Sleep for longer than the global timeout ...
--
sleep
6
SELECT
COUNT
(
*
)
=
1
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
USER
=
'system user'
AND
STATE
=
'Waiting for table metadata lock'
;
UNLOCK
TABLES
;
SET
SESSION
wsrep_sync_wait
=
7
;
SHOW
CREATE
TABLE
t1
;
SELECT
COUNT
(
*
)
=
0
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
USER
=
'system user'
AND
STATE
=
'Waiting for table metadata lock'
;
DROP
TABLE
t1
;
mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test
0 → 100644
View file @
4102d525
--
source
include
/
galera_cluster
.
inc
--
source
include
/
have_innodb
.
inc
#
# Test that a local FLUSH TABLES FOR BACKUP will NOT be broken by an incoming remote transaction against that table
#
CREATE
TABLE
t1
(
f1
INTEGER
PRIMARY
KEY
)
ENGINE
=
InnoDB
;
--
connection
node_2
SET
AUTOCOMMIT
=
OFF
;
--
let
$wsrep_local_bf_aborts_before
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
FLUSH
TABLES
t1
FOR
EXPORT
;
--
connection
node_1
INSERT
INTO
t1
VALUES
(
2
);
--
connection
node_2
SET
SESSION
wsrep_sync_wait
=
0
;
--
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
USER
=
'system user'
AND
STATE
=
'Waiting for table metadata lock'
--
source
include
/
wait_condition
.
inc
UNLOCK
TABLES
;
--
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
0
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
USER
=
'system user'
AND
STATE
=
'Waiting for table metadata lock'
--
source
include
/
wait_condition
.
inc
COMMIT
;
SELECT
COUNT
(
*
)
=
1
FROM
t1
;
--
let
$wsrep_local_bf_aborts_after
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
--
disable_query_log
--
eval
SELECT
$wsrep_local_bf_aborts_after
-
$wsrep_local_bf_aborts_before
=
0
AS
wsrep_local_aborts_increment
;
--
enable_query_log
DROP
TABLE
t1
;
mysql-test/suite/galera/t/galera_bf_abort_lock_table.test
View file @
4102d525
...
...
@@ -2,7 +2,7 @@
--
source
include
/
have_innodb
.
inc
#
# Test that a local LOCK TABLE will be broken by an incoming remote transaction against that table
# Test that a local LOCK TABLE will
NOT
be broken by an incoming remote transaction against that table
#
CREATE
TABLE
t1
(
f1
INTEGER
PRIMARY
KEY
)
ENGINE
=
InnoDB
;
...
...
@@ -12,22 +12,25 @@ SET AUTOCOMMIT=OFF;
--
let
$wsrep_local_bf_aborts_before
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
LOCK
TABLE
t1
WRITE
;
# Issue a concurrent INSERT against the lock table that will block
--
connect
node_2a
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_2
--
send
INSERT
INTO
t1
VALUES
(
1
);
--
connection
node_1
INSERT
INTO
t1
VALUES
(
2
);
# The concurent insert is allowed to complete because the LOCK TABLE is now broken
--
connection
node_2a
--
error
0
--
reap
--
connection
node_2
--
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
USER
=
'system user'
AND
STATE
=
'Waiting for table metadata lock'
--
source
include
/
wait_condition
.
inc
UNLOCK
TABLES
;
--
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
0
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
USER
=
'system user'
AND
STATE
=
'Waiting for table metadata lock'
--
source
include
/
wait_condition
.
inc
COMMIT
;
SELECT
COUNT
(
*
)
=
1
FROM
t1
;
--
let
$wsrep_local_bf_aborts_after
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
--
disable_query_log
--
eval
SELECT
$wsrep_local_bf_aborts_after
-
$wsrep_local_bf_aborts_before
=
1
AS
wsrep_local_aborts_increment
;
--
eval
SELECT
$wsrep_local_bf_aborts_after
-
$wsrep_local_bf_aborts_before
=
0
AS
wsrep_local_aborts_increment
;
--
enable_query_log
DROP
TABLE
t1
;
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