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
e2f14878
Commit
e2f14878
authored
Mar 30, 2011
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql-5.1-innodb to mysql-5.5-innodb.
parents
f2b0b245
ddec6ecd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
11 deletions
+40
-11
storage/innobase/include/sync0arr.h
storage/innobase/include/sync0arr.h
+5
-2
storage/innobase/srv/srv0srv.c
storage/innobase/srv/srv0srv.c
+10
-1
storage/innobase/sync/sync0arr.c
storage/innobase/sync/sync0arr.c
+25
-8
No files found.
storage/innobase/include/sync0arr.h
View file @
e2f14878
...
...
@@ -115,8 +115,11 @@ Prints warnings of long semaphore waits to stderr.
@return TRUE if fatal semaphore wait threshold was exceeded */
UNIV_INTERN
ibool
sync_array_print_long_waits
(
void
);
/*=============================*/
sync_array_print_long_waits
(
/*========================*/
os_thread_id_t
*
waiter
,
/*!< out: longest waiting thread */
const
void
**
sema
)
/*!< out: longest-waited-for semaphore */
__attribute__
((
nonnull
));
/********************************************************************//**
Validates the integrity of the wait array. Checks
that the number of reserved cells equals the count variable. */
...
...
storage/innobase/srv/srv0srv.c
View file @
e2f14878
...
...
@@ -2367,6 +2367,12 @@ srv_error_monitor_thread(
ib_uint64_t
old_lsn
;
ib_uint64_t
new_lsn
;
ib_int64_t
sig_count
;
/* longest waiting thread for a semaphore */
os_thread_id_t
waiter
=
os_thread_get_curr_id
();
os_thread_id_t
old_waiter
=
waiter
;
/* the semaphore that is being waited for */
const
void
*
sema
=
NULL
;
const
void
*
old_sema
=
NULL
;
old_lsn
=
srv_start_lsn
;
...
...
@@ -2420,7 +2426,8 @@ loop:
sync_arr_wake_threads_if_sema_free
();
if
(
sync_array_print_long_waits
())
{
if
(
sync_array_print_long_waits
(
&
waiter
,
&
sema
)
&&
sema
==
old_sema
&&
os_thread_eq
(
waiter
,
old_waiter
))
{
fatal_cnt
++
;
if
(
fatal_cnt
>
10
)
{
...
...
@@ -2435,6 +2442,8 @@ loop:
}
}
else
{
fatal_cnt
=
0
;
old_waiter
=
waiter
;
old_sema
=
sema
;
}
/* Flush stderr so that a database user gets the output
...
...
storage/innobase/sync/sync0arr.c
View file @
e2f14878
...
...
@@ -915,8 +915,10 @@ Prints warnings of long semaphore waits to stderr.
@return TRUE if fatal semaphore wait threshold was exceeded */
UNIV_INTERN
ibool
sync_array_print_long_waits
(
void
)
/*=============================*/
sync_array_print_long_waits
(
/*========================*/
os_thread_id_t
*
waiter
,
/*!< out: longest waiting thread */
const
void
**
sema
)
/*!< out: longest-waited-for semaphore */
{
sync_cell_t
*
cell
;
ibool
old_val
;
...
...
@@ -924,6 +926,7 @@ sync_array_print_long_waits(void)
ulint
i
;
ulint
fatal_timeout
=
srv_fatal_semaphore_wait_threshold
;
ibool
fatal
=
FALSE
;
double
longest_diff
=
0
;
#ifdef UNIV_DEBUG_VALGRIND
/* Increase the timeouts if running under valgrind because it executes
...
...
@@ -939,22 +942,36 @@ sync_array_print_long_waits(void)
for
(
i
=
0
;
i
<
sync_primary_wait_array
->
n_cells
;
i
++
)
{
double
diff
;
void
*
wait_object
;
cell
=
sync_array_get_nth_cell
(
sync_primary_wait_array
,
i
);
if
(
cell
->
wait_object
!=
NULL
&&
cell
->
waiting
&&
difftime
(
time
(
NULL
),
cell
->
reservation_time
)
>
SYNC_ARRAY_TIMEOUT
)
{
wait_object
=
cell
->
wait_object
;
if
(
wait_object
==
NULL
||
!
cell
->
waiting
)
{
continue
;
}
diff
=
difftime
(
time
(
NULL
),
cell
->
reservation_time
);
if
(
diff
>
SYNC_ARRAY_TIMEOUT
)
{
fputs
(
"InnoDB: Warning: a long semaphore wait:
\n
"
,
stderr
);
sync_array_cell_print
(
stderr
,
cell
);
noticed
=
TRUE
;
}
if
(
cell
->
wait_object
!=
NULL
&&
cell
->
waiting
&&
difftime
(
time
(
NULL
),
cell
->
reservation_time
)
>
fatal_timeout
)
{
if
(
diff
>
fatal_timeout
)
{
fatal
=
TRUE
;
}
if
(
diff
>
longest_diff
)
{
longest_diff
=
diff
;
*
sema
=
wait_object
;
*
waiter
=
cell
->
thread
;
}
}
if
(
noticed
)
{
...
...
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