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
fe347bbb
Commit
fe347bbb
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
08bdd470
9a961662
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 @
fe347bbb
...
@@ -115,8 +115,11 @@ Prints warnings of long semaphore waits to stderr.
...
@@ -115,8 +115,11 @@ Prints warnings of long semaphore waits to stderr.
@return TRUE if fatal semaphore wait threshold was exceeded */
@return TRUE if fatal semaphore wait threshold was exceeded */
UNIV_INTERN
UNIV_INTERN
ibool
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
Validates the integrity of the wait array. Checks
that the number of reserved cells equals the count variable. */
that the number of reserved cells equals the count variable. */
...
...
storage/innobase/srv/srv0srv.c
View file @
fe347bbb
...
@@ -2367,6 +2367,12 @@ srv_error_monitor_thread(
...
@@ -2367,6 +2367,12 @@ srv_error_monitor_thread(
ib_uint64_t
old_lsn
;
ib_uint64_t
old_lsn
;
ib_uint64_t
new_lsn
;
ib_uint64_t
new_lsn
;
ib_int64_t
sig_count
;
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
;
old_lsn
=
srv_start_lsn
;
...
@@ -2420,7 +2426,8 @@ srv_error_monitor_thread(
...
@@ -2420,7 +2426,8 @@ srv_error_monitor_thread(
sync_arr_wake_threads_if_sema_free
();
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
++
;
fatal_cnt
++
;
if
(
fatal_cnt
>
10
)
{
if
(
fatal_cnt
>
10
)
{
...
@@ -2435,6 +2442,8 @@ srv_error_monitor_thread(
...
@@ -2435,6 +2442,8 @@ srv_error_monitor_thread(
}
}
}
else
{
}
else
{
fatal_cnt
=
0
;
fatal_cnt
=
0
;
old_waiter
=
waiter
;
old_sema
=
sema
;
}
}
/* Flush stderr so that a database user gets the output
/* Flush stderr so that a database user gets the output
...
...
storage/innobase/sync/sync0arr.c
View file @
fe347bbb
...
@@ -915,8 +915,10 @@ Prints warnings of long semaphore waits to stderr.
...
@@ -915,8 +915,10 @@ Prints warnings of long semaphore waits to stderr.
@return TRUE if fatal semaphore wait threshold was exceeded */
@return TRUE if fatal semaphore wait threshold was exceeded */
UNIV_INTERN
UNIV_INTERN
ibool
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
;
sync_cell_t
*
cell
;
ibool
old_val
;
ibool
old_val
;
...
@@ -924,6 +926,7 @@ sync_array_print_long_waits(void)
...
@@ -924,6 +926,7 @@ sync_array_print_long_waits(void)
ulint
i
;
ulint
i
;
ulint
fatal_timeout
=
srv_fatal_semaphore_wait_threshold
;
ulint
fatal_timeout
=
srv_fatal_semaphore_wait_threshold
;
ibool
fatal
=
FALSE
;
ibool
fatal
=
FALSE
;
double
longest_diff
=
0
;
#ifdef UNIV_DEBUG_VALGRIND
#ifdef UNIV_DEBUG_VALGRIND
/* Increase the timeouts if running under valgrind because it executes
/* Increase the timeouts if running under valgrind because it executes
...
@@ -939,22 +942,36 @@ sync_array_print_long_waits(void)
...
@@ -939,22 +942,36 @@ sync_array_print_long_waits(void)
for
(
i
=
0
;
i
<
sync_primary_wait_array
->
n_cells
;
i
++
)
{
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
);
cell
=
sync_array_get_nth_cell
(
sync_primary_wait_array
,
i
);
if
(
cell
->
wait_object
!=
NULL
&&
cell
->
waiting
wait_object
=
cell
->
wait_object
;
&&
difftime
(
time
(
NULL
),
cell
->
reservation_time
)
>
SYNC_ARRAY_TIMEOUT
)
{
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
"
,
fputs
(
"InnoDB: Warning: a long semaphore wait:
\n
"
,
stderr
);
stderr
);
sync_array_cell_print
(
stderr
,
cell
);
sync_array_cell_print
(
stderr
,
cell
);
noticed
=
TRUE
;
noticed
=
TRUE
;
}
}
if
(
cell
->
wait_object
!=
NULL
&&
cell
->
waiting
if
(
diff
>
fatal_timeout
)
{
&&
difftime
(
time
(
NULL
),
cell
->
reservation_time
)
>
fatal_timeout
)
{
fatal
=
TRUE
;
fatal
=
TRUE
;
}
}
if
(
diff
>
longest_diff
)
{
longest_diff
=
diff
;
*
sema
=
wait_object
;
*
waiter
=
cell
->
thread
;
}
}
}
if
(
noticed
)
{
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