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
4dff0296
Commit
4dff0296
authored
Oct 27, 2010
by
Mikael Ronstrom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more wait states for THD wait service
parent
4cce72a9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
54 additions
and
12 deletions
+54
-12
include/mysql/plugin_audit.h.pp
include/mysql/plugin_audit.h.pp
+9
-3
include/mysql/plugin_ftparser.h.pp
include/mysql/plugin_ftparser.h.pp
+9
-3
include/mysql/service_thd_wait.h
include/mysql/service_thd_wait.h
+9
-3
sql/item_func.cc
sql/item_func.cc
+6
-0
sql/lock.cc
sql/lock.cc
+12
-0
sql/mdl.cc
sql/mdl.cc
+6
-0
sql/scheduler.cc
sql/scheduler.cc
+1
-1
storage/innobase/srv/srv0srv.c
storage/innobase/srv/srv0srv.c
+2
-2
No files found.
include/mysql/plugin_audit.h.pp
View file @
4dff0296
...
...
@@ -33,10 +33,16 @@ MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
int
allocate_lex_string
);
#include <mysql/service_thd_wait.h>
typedef
enum
_thd_wait_type_e
{
THD_WAIT_
MUTEX
=
1
,
THD_WAIT_
SLEEP
=
1
,
THD_WAIT_DISKIO
=
2
,
THD_WAIT_ROW_TABLE_LOCK
=
3
,
THD_WAIT_GLOBAL_LOCK
=
4
THD_WAIT_ROW_LOCK
=
3
,
THD_WAIT_GLOBAL_LOCK
=
4
,
THD_WAIT_META_DATA_LOCK
=
5
,
THD_WAIT_TABLE_LOCK
=
6
,
THD_WAIT_USER_LOCK
=
7
,
THD_WAIT_BINLOG
=
8
,
THD_WAIT_GROUP_COMMIT
=
9
,
THD_WAIT_LAST
=
10
}
thd_wait_type
;
extern
struct
thd_wait_service_st
{
void
(
*
thd_wait_begin_func
)(
void
*
,
thd_wait_type
);
...
...
include/mysql/plugin_ftparser.h.pp
View file @
4dff0296
...
...
@@ -33,10 +33,16 @@ MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
int
allocate_lex_string
);
#include <mysql/service_thd_wait.h>
typedef
enum
_thd_wait_type_e
{
THD_WAIT_
MUTEX
=
1
,
THD_WAIT_
SLEEP
=
1
,
THD_WAIT_DISKIO
=
2
,
THD_WAIT_ROW_TABLE_LOCK
=
3
,
THD_WAIT_GLOBAL_LOCK
=
4
THD_WAIT_ROW_LOCK
=
3
,
THD_WAIT_GLOBAL_LOCK
=
4
,
THD_WAIT_META_DATA_LOCK
=
5
,
THD_WAIT_TABLE_LOCK
=
6
,
THD_WAIT_USER_LOCK
=
7
,
THD_WAIT_BINLOG
=
8
,
THD_WAIT_GROUP_COMMIT
=
9
,
THD_WAIT_LAST
=
10
}
thd_wait_type
;
extern
struct
thd_wait_service_st
{
void
(
*
thd_wait_begin_func
)(
void
*
,
thd_wait_type
);
...
...
include/mysql/service_thd_wait.h
View file @
4dff0296
...
...
@@ -51,10 +51,16 @@ extern "C" {
#endif
typedef
enum
_thd_wait_type_e
{
THD_WAIT_
MUTEX
=
1
,
THD_WAIT_
SLEEP
=
1
,
THD_WAIT_DISKIO
=
2
,
THD_WAIT_ROW_TABLE_LOCK
=
3
,
THD_WAIT_GLOBAL_LOCK
=
4
THD_WAIT_ROW_LOCK
=
3
,
THD_WAIT_GLOBAL_LOCK
=
4
,
THD_WAIT_META_DATA_LOCK
=
5
,
THD_WAIT_TABLE_LOCK
=
6
,
THD_WAIT_USER_LOCK
=
7
,
THD_WAIT_BINLOG
=
8
,
THD_WAIT_GROUP_COMMIT
=
9
,
THD_WAIT_LAST
=
10
}
thd_wait_type
;
extern
struct
thd_wait_service_st
{
...
...
sql/item_func.cc
View file @
4dff0296
...
...
@@ -52,6 +52,8 @@
#include "sp.h"
#include "set_var.h"
#include "debug_sync.h"
#include <mysql/plugin.h>
#include <mysql/service_thd_wait.h>
#ifdef NO_EMBEDDED_ACCESS_CHECKS
#define sp_restore_security_context(A,B) while (0) {}
...
...
@@ -3802,7 +3804,9 @@ longlong Item_func_get_lock::val_int()
while
(
ull
->
locked
&&
!
thd
->
killed
)
{
DBUG_PRINT
(
"info"
,
(
"waiting on lock"
));
thd_wait_begin
(
thd
,
THD_WAIT_USER_LOCK
);
error
=
interruptible_wait
(
thd
,
&
ull
->
cond
,
&
LOCK_user_locks
,
timeout
);
thd_wait_end
(
thd
);
if
(
error
==
ETIMEDOUT
||
error
==
ETIME
)
{
DBUG_PRINT
(
"info"
,
(
"lock wait timeout"
));
...
...
@@ -4026,7 +4030,9 @@ longlong Item_func_sleep::val_int()
error
=
0
;
while
(
!
thd
->
killed
)
{
thd_wait_begin
(
thd
,
THD_WAIT_SLEEP
);
error
=
interruptible_wait
(
thd
,
&
cond
,
&
LOCK_user_locks
,
timeout
);
thd_wait_end
(
thd
);
if
(
error
==
ETIMEDOUT
||
error
==
ETIME
)
break
;
error
=
0
;
...
...
sql/lock.cc
View file @
4dff0296
...
...
@@ -82,6 +82,8 @@
#include "sql_acl.h" // SUPER_ACL
#include <hash.h>
#include <assert.h>
#include <mysql/plugin.h>
#include <mysql/service_thd_wait.h>
/**
@defgroup Locking Locking
...
...
@@ -1019,7 +1021,11 @@ bool Global_read_lock::lock_global_read_lock(THD *thd)
waiting_for_read_lock
++
;
while
(
protect_against_global_read_lock
&&
!
thd
->
killed
)
{
thd_wait_begin
(
thd
,
THD_WAIT_GLOBAL_LOCK
);
mysql_cond_wait
(
&
COND_global_read_lock
,
&
LOCK_global_read_lock
);
thd_wait_end
(
thd
);
}
waiting_for_read_lock
--
;
if
(
thd
->
killed
)
{
...
...
@@ -1187,7 +1193,9 @@ wait_if_global_read_lock(THD *thd, bool abort_on_refresh,
thd
->
open_tables
->
s
->
version
==
refresh_version
))
{
DBUG_PRINT
(
"signal"
,
(
"Waiting for COND_global_read_lock"
));
thd_wait_begin
(
thd
,
THD_WAIT_GLOBAL_LOCK
);
mysql_cond_wait
(
&
COND_global_read_lock
,
&
LOCK_global_read_lock
);
thd_wait_end
(
thd
);
DBUG_PRINT
(
"signal"
,
(
"Got COND_global_read_lock"
));
}
if
(
thd
->
killed
)
...
...
@@ -1285,7 +1293,11 @@ bool Global_read_lock::make_global_read_lock_block_commit(THD *thd)
old_message
=
thd
->
enter_cond
(
&
COND_global_read_lock
,
&
LOCK_global_read_lock
,
"Waiting for all running commits to finish"
);
while
(
protect_against_global_read_lock
&&
!
thd
->
killed
)
{
thd_wait_begin
(
thd
,
THD_WAIT_GLOBAL_LOCK
);
mysql_cond_wait
(
&
COND_global_read_lock
,
&
LOCK_global_read_lock
);
thd_wait_end
(
thd
);
}
DBUG_EXECUTE_IF
(
"make_global_read_lock_block_commit_loop"
,
protect_against_global_read_lock
--
;);
if
((
error
=
test
(
thd
->
killed
)))
...
...
sql/mdl.cc
View file @
4dff0296
...
...
@@ -18,6 +18,8 @@
#include "debug_sync.h"
#include <hash.h>
#include <mysqld_error.h>
#include <mysql/plugin.h>
#include <mysql/service_thd_wait.h>
#ifdef HAVE_PSI_INTERFACE
static
PSI_mutex_key
key_MDL_map_mutex
;
...
...
@@ -991,8 +993,12 @@ MDL_wait::timed_wait(THD *thd, struct timespec *abs_timeout,
while
(
!
m_wait_status
&&
!
thd_killed
(
thd
)
&&
wait_result
!=
ETIMEDOUT
&&
wait_result
!=
ETIME
)
{
thd_wait_begin
(
thd
,
THD_WAIT_META_DATA_LOCK
);
wait_result
=
mysql_cond_timedwait
(
&
m_COND_wait_status
,
&
m_LOCK_wait_status
,
abs_timeout
);
thd_wait_end
(
thd
);
}
if
(
m_wait_status
==
EMPTY
)
{
...
...
sql/scheduler.cc
View file @
4dff0296
...
...
@@ -82,7 +82,7 @@ scheduler_functions *thread_scheduler= NULL;
/**@{*/
static
void
scheduler_wait_begin
(
void
)
{
MYSQL_CALLBACK
(
thread_scheduler
,
thd_wait_begin
,
(
current_thd
,
THD_WAIT_
ROW_
TABLE_LOCK
));
thd_wait_begin
,
(
current_thd
,
THD_WAIT_TABLE_LOCK
));
}
static
void
scheduler_wait_end
(
void
)
{
...
...
storage/innobase/srv/srv0srv.c
View file @
4dff0296
...
...
@@ -1234,7 +1234,7 @@ retry:
trx
->
op_info
=
"waiting in InnoDB queue"
;
thd_wait_begin
(
trx
->
mysql_thd
,
THD_WAIT_
ROW_TABLE
_LOCK
);
thd_wait_begin
(
trx
->
mysql_thd
,
THD_WAIT_
USER
_LOCK
);
os_event_wait
(
slot
->
event
);
thd_wait_end
(
trx
->
mysql_thd
);
...
...
@@ -1601,7 +1601,7 @@ srv_suspend_mysql_thread(
/* Suspend this thread and wait for the event. */
thd_wait_begin
(
trx
->
mysql_thd
,
THD_WAIT_ROW_
TABLE_
LOCK
);
thd_wait_begin
(
trx
->
mysql_thd
,
THD_WAIT_ROW_LOCK
);
os_event_wait
(
event
);
thd_wait_end
(
trx
->
mysql_thd
);
...
...
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