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
f92f1312
Commit
f92f1312
authored
Aug 25, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/M50/mysql-5.0
parents
f1ecbe62
8ff1361d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
BitKeeper/etc/config
BitKeeper/etc/config
+1
-0
innobase/lock/lock0lock.c
innobase/lock/lock0lock.c
+17
-6
No files found.
BitKeeper/etc/config
View file @
f92f1312
...
@@ -72,5 +72,6 @@ hours:
...
@@ -72,5 +72,6 @@ hours:
[kostja:]checkout:get
[kostja:]checkout:get
[nick:]checkout:get
[nick:]checkout:get
[jonas:]checkout:get
[jonas:]checkout:get
[tomas:]checkout:get
checkout:edit
checkout:edit
eoln:unix
eoln:unix
innobase/lock/lock0lock.c
View file @
f92f1312
...
@@ -47,6 +47,10 @@ innobase_mysql_end_print_arbitrary_thd(void);
...
@@ -47,6 +47,10 @@ innobase_mysql_end_print_arbitrary_thd(void);
graph of transactions */
graph of transactions */
#define LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK 1000000
#define LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK 1000000
/* Restricts the recursion depth of the search we will do in the waits-for
graph of transactions */
#define LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK 200
/* When releasing transaction locks, this specifies how often we release
/* When releasing transaction locks, this specifies how often we release
the kernel mutex for a moment to give also others access to it */
the kernel mutex for a moment to give also others access to it */
...
@@ -389,9 +393,12 @@ lock_deadlock_recursive(
...
@@ -389,9 +393,12 @@ lock_deadlock_recursive(
trx_t
*
start
,
/* in: recursion starting point */
trx_t
*
start
,
/* in: recursion starting point */
trx_t
*
trx
,
/* in: a transaction waiting for a lock */
trx_t
*
trx
,
/* in: a transaction waiting for a lock */
lock_t
*
wait_lock
,
/* in: the lock trx is waiting to be granted */
lock_t
*
wait_lock
,
/* in: the lock trx is waiting to be granted */
ulint
*
cost
);
/* in/out: number of calculation steps thus
ulint
*
cost
,
/* in/out: number of calculation steps thus
far: if this exceeds LOCK_MAX_N_STEPS_...
far: if this exceeds LOCK_MAX_N_STEPS_...
we return TRUE */
we return LOCK_VICTIM_IS_START */
uint
depth
);
/* in: recursion depth: if this exceeds
LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK, we
return LOCK_VICTIM_IS_START */
/*************************************************************************
/*************************************************************************
Gets the type of a lock. */
Gets the type of a lock. */
...
@@ -3180,7 +3187,7 @@ retry:
...
@@ -3180,7 +3187,7 @@ retry:
mark_trx
=
UT_LIST_GET_NEXT
(
trx_list
,
mark_trx
);
mark_trx
=
UT_LIST_GET_NEXT
(
trx_list
,
mark_trx
);
}
}
ret
=
lock_deadlock_recursive
(
trx
,
trx
,
lock
,
&
cost
);
ret
=
lock_deadlock_recursive
(
trx
,
trx
,
lock
,
&
cost
,
0
);
if
(
ret
==
LOCK_VICTIM_IS_OTHER
)
{
if
(
ret
==
LOCK_VICTIM_IS_OTHER
)
{
/* We chose some other trx as a victim: retry if there still
/* We chose some other trx as a victim: retry if there still
...
@@ -3226,9 +3233,12 @@ lock_deadlock_recursive(
...
@@ -3226,9 +3233,12 @@ lock_deadlock_recursive(
trx_t
*
start
,
/* in: recursion starting point */
trx_t
*
start
,
/* in: recursion starting point */
trx_t
*
trx
,
/* in: a transaction waiting for a lock */
trx_t
*
trx
,
/* in: a transaction waiting for a lock */
lock_t
*
wait_lock
,
/* in: the lock trx is waiting to be granted */
lock_t
*
wait_lock
,
/* in: the lock trx is waiting to be granted */
ulint
*
cost
)
/* in/out: number of calculation steps thus
ulint
*
cost
,
/* in/out: number of calculation steps thus
far: if this exceeds LOCK_MAX_N_STEPS_...
far: if this exceeds LOCK_MAX_N_STEPS_...
we return LOCK_VICTIM_IS_START */
we return LOCK_VICTIM_IS_START */
uint
depth
)
/* in: recursion depth: if this exceeds
LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK, we
return LOCK_VICTIM_IS_START */
{
{
lock_t
*
lock
;
lock_t
*
lock
;
ulint
bit_no
=
ULINT_UNDEFINED
;
ulint
bit_no
=
ULINT_UNDEFINED
;
...
@@ -3249,7 +3259,8 @@ lock_deadlock_recursive(
...
@@ -3249,7 +3259,8 @@ lock_deadlock_recursive(
*
cost
=
*
cost
+
1
;
*
cost
=
*
cost
+
1
;
if
(
*
cost
>
LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK
)
{
if
((
depth
>
LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK
)
||
(
*
cost
>
LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK
))
{
return
(
LOCK_VICTIM_IS_START
);
return
(
LOCK_VICTIM_IS_START
);
}
}
...
@@ -3375,7 +3386,7 @@ lock_deadlock_recursive(
...
@@ -3375,7 +3386,7 @@ lock_deadlock_recursive(
a lock */
a lock */
ret
=
lock_deadlock_recursive
(
start
,
lock_trx
,
ret
=
lock_deadlock_recursive
(
start
,
lock_trx
,
lock_trx
->
wait_lock
,
cost
);
lock_trx
->
wait_lock
,
cost
,
depth
+
1
);
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
return
(
ret
);
return
(
ret
);
...
...
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