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
c6660901
Commit
c6660901
authored
Apr 21, 2015
by
sjaakola
Committed by
Nirbhay Choubey
Sep 09, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refs codership/mysql-wsrep#113
Protecting non replicated FLUSH session from brute force aborts
parent
045b31c8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
4 deletions
+25
-4
sql/sql_class.cc
sql/sql_class.cc
+1
-0
sql/sql_parse.cc
sql/sql_parse.cc
+17
-0
sql/wsrep_hton.cc
sql/wsrep_hton.cc
+1
-1
sql/wsrep_mysqld.cc
sql/wsrep_mysqld.cc
+4
-3
sql/wsrep_mysqld.h
sql/wsrep_mysqld.h
+2
-0
No files found.
sql/sql_class.cc
View file @
c6660901
...
...
@@ -861,6 +861,7 @@ extern "C" const char *wsrep_thd_exec_mode_str(THD *thd)
return
(
!
thd
)
?
"void"
:
(
thd
->
wsrep_exec_mode
==
LOCAL_STATE
)
?
"local"
:
(
thd
->
wsrep_exec_mode
==
LOCAL_FLUSH
)
?
"flush"
:
(
thd
->
wsrep_exec_mode
==
REPL_RECV
)
?
"applier"
:
(
thd
->
wsrep_exec_mode
==
TOTAL_ORDER
)
?
"total order"
:
(
thd
->
wsrep_exec_mode
==
LOCAL_COMMIT
)
?
"local commit"
:
"void"
;
...
...
sql/sql_parse.cc
View file @
c6660901
...
...
@@ -4165,6 +4165,11 @@ case SQLCOM_PREPARE:
}
case
SQLCOM_UNLOCK_TABLES
:
#ifdef WITH_WSREP
mysql_mutex_lock
(
&
thd
->
LOCK_wsrep_thd
);
if
(
thd
->
wsrep_exec_mode
==
LOCAL_FLUSH
)
thd
->
wsrep_exec_mode
=
LOCAL_STATE
;
mysql_mutex_unlock
(
&
thd
->
LOCK_wsrep_thd
);
#endif
/* WITH_WSREP */
/*
It is critical for mysqldump --single-transaction --master-data that
UNLOCK TABLES does not implicitely commit a connection which has only
...
...
@@ -4667,6 +4672,12 @@ case SQLCOM_PREPARE:
FALSE
,
UINT_MAX
,
FALSE
))
goto
error
;
#ifdef WITH_WSREP
mysql_mutex_lock
(
&
thd
->
LOCK_wsrep_thd
);
thd
->
wsrep_exec_mode
=
LOCAL_FLUSH
;
mysql_mutex_unlock
(
&
thd
->
LOCK_wsrep_thd
);
#endif
/* WITH_WSREP */
if
(
flush_tables_with_read_lock
(
thd
,
all_tables
))
goto
error
;
...
...
@@ -4687,6 +4698,12 @@ case SQLCOM_PREPARE:
{
WSREP_TO_ISOLATION_BEGIN
(
WSREP_MYSQL_DB
,
NULL
,
NULL
)
}
else
{
mysql_mutex_lock
(
&
thd
->
LOCK_wsrep_thd
);
thd
->
wsrep_exec_mode
=
LOCAL_FLUSH
;
mysql_mutex_unlock
(
&
thd
->
LOCK_wsrep_thd
);
}
#endif
/* WITH_WSREP*/
/*
...
...
sql/wsrep_hton.cc
View file @
c6660901
...
...
@@ -40,7 +40,7 @@ void wsrep_cleanup_transaction(THD *thd)
thd
->
wsrep_ws_handle
.
trx_id
=
WSREP_UNDEFINED_TRX_ID
;
thd
->
wsrep_trx_meta
.
gtid
=
WSREP_GTID_UNDEFINED
;
thd
->
wsrep_trx_meta
.
depends_on
=
WSREP_SEQNO_UNDEFINED
;
thd
->
wsrep_exec_mode
=
LOCAL_STATE
;
if
(
thd
->
wsrep_exec_mode
!=
LOCAL_FLUSH
)
thd
->
wsrep_exec_mode
=
LOCAL_STATE
;
return
;
}
...
...
sql/wsrep_mysqld.cc
View file @
c6660901
...
...
@@ -1499,12 +1499,13 @@ wsrep_grant_mdl_exception(MDL_context *requestor_ctx,
mysql_mutex_unlock
(
&
granted_thd
->
LOCK_wsrep_thd
);
ret
=
TRUE
;
}
else
if
(
granted_thd
->
lex
->
sql_command
==
SQLCOM_FLUSH
)
else
if
(
granted_thd
->
lex
->
sql_command
==
SQLCOM_FLUSH
||
granted_thd
->
wsrep_exec_mode
==
LOCAL_FLUSH
)
{
WSREP_DEBUG
(
"
mdl granted over FLUSH BF
"
);
WSREP_DEBUG
(
"
BF thread waiting for FLUSH
"
);
ticket
->
wsrep_report
(
wsrep_debug
);
mysql_mutex_unlock
(
&
granted_thd
->
LOCK_wsrep_thd
);
ret
=
TRU
E
;
ret
=
FALS
E
;
}
else
if
(
request_thd
->
lex
->
sql_command
==
SQLCOM_DROP_TABLE
)
{
...
...
sql/wsrep_mysqld.h
View file @
c6660901
...
...
@@ -30,6 +30,8 @@ class THD;
enum
wsrep_exec_mode
{
/* Transaction processing before replication. */
LOCAL_STATE
,
/* Local flush. */
LOCAL_FLUSH
,
/* Slave thread applying write sets from other nodes or replaying thread. */
REPL_RECV
,
/* Total-order-isolation mode */
...
...
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