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
63c5bee5
Commit
63c5bee5
authored
Apr 28, 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 - Extended the protection of local FLUSH
sessions to cover all exclusive MDL locks
parent
417f778e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
23 deletions
+26
-23
sql/mdl.cc
sql/mdl.cc
+17
-0
sql/mdl.h
sql/mdl.h
+2
-1
sql/sql_class.cc
sql/sql_class.cc
+0
-1
sql/sql_parse.cc
sql/sql_parse.cc
+0
-17
sql/wsrep_hton.cc
sql/wsrep_hton.cc
+1
-1
sql/wsrep_mysqld.cc
sql/wsrep_mysqld.cc
+1
-1
sql/wsrep_mysqld.h
sql/wsrep_mysqld.h
+0
-2
sql/wsrep_thd.cc
sql/wsrep_thd.cc
+5
-0
No files found.
sql/mdl.cc
View file @
63c5bee5
...
...
@@ -3373,4 +3373,21 @@ void MDL_ticket::wsrep_report(bool debug)
psi_stage
->
m_name
);
}
}
bool
MDL_context
::
wsrep_has_explicit_locks
()
{
MDL_ticket
*
ticket
=
NULL
;
Ticket_iterator
it
(
m_tickets
[
MDL_EXPLICIT
]);
while
((
ticket
=
it
++
))
{
if
(
ticket
->
m_type
==
MDL_EXCLUSIVE
)
{
return
true
;
}
}
return
false
;
}
#endif
/* WITH_WSREP */
sql/mdl.h
View file @
63c5bee5
...
...
@@ -934,7 +934,8 @@ class MDL_context
public:
#ifdef WITH_WSREP
THD
*
wsrep_get_thd
()
const
{
return
get_thd
();
}
#endif
bool
wsrep_has_explicit_locks
();
#endif
/* WITH_WSREP */
void
find_deadlock
();
ulong
get_thread_id
()
const
{
return
thd_get_thread_id
(
get_thd
());
}
...
...
sql/sql_class.cc
View file @
63c5bee5
...
...
@@ -861,7 +861,6 @@ 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 @
63c5bee5
...
...
@@ -4165,11 +4165,6 @@ 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
...
...
@@ -4672,12 +4667,6 @@ 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
;
...
...
@@ -4698,12 +4687,6 @@ 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 @
63c5bee5
...
...
@@ -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
;
if
(
thd
->
wsrep_exec_mode
!=
LOCAL_FLUSH
)
thd
->
wsrep_exec_mode
=
LOCAL_STATE
;
thd
->
wsrep_exec_mode
=
LOCAL_STATE
;
return
;
}
...
...
sql/wsrep_mysqld.cc
View file @
63c5bee5
...
...
@@ -1500,7 +1500,7 @@ wsrep_grant_mdl_exception(MDL_context *requestor_ctx,
ret
=
TRUE
;
}
else
if
(
granted_thd
->
lex
->
sql_command
==
SQLCOM_FLUSH
||
granted_thd
->
wsrep_exec_mode
==
LOCAL_FLUSH
)
granted_thd
->
mdl_context
.
wsrep_has_explicit_locks
()
)
{
WSREP_DEBUG
(
"BF thread waiting for FLUSH"
);
ticket
->
wsrep_report
(
wsrep_debug
);
...
...
sql/wsrep_mysqld.h
View file @
63c5bee5
...
...
@@ -30,8 +30,6 @@ 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 */
...
...
sql/wsrep_thd.cc
View file @
63c5bee5
...
...
@@ -611,3 +611,8 @@ int wsrep_thd_in_locking_session(void *thd_ptr)
return
0
;
}
bool
wsrep_thd_has_explicit_locks
(
THD
*
thd
)
{
assert
(
thd
);
return
(
thd
->
mdl_context
.
wsrep_has_explicit_locks
());
}
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