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
04996939
Commit
04996939
authored
Jan 23, 2018
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-15059 - Misc small InnoDB scalability fixes
Moved lock_rec_lock_slow() inside lock_rec_lock().
parent
8389b45b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
61 deletions
+23
-61
storage/innobase/lock/lock0lock.cc
storage/innobase/lock/lock0lock.cc
+23
-61
No files found.
storage/innobase/lock/lock0lock.cc
View file @
04996939
...
@@ -2389,66 +2389,6 @@ lock_rec_add_to_queue(
...
@@ -2389,66 +2389,6 @@ lock_rec_add_to_queue(
rec_lock
.
create
(
trx
,
caller_owns_trx_mutex
,
true
);
rec_lock
.
create
(
trx
,
caller_owns_trx_mutex
,
true
);
}
}
/*********************************************************************//**
This is the general, and slower, routine for locking a record. This is a
low-level function which does NOT look at implicit locks! Checks lock
compatibility within explicit locks. This function sets a normal next-key
lock, or in the case of a page supremum record, a gap type lock.
@return DB_SUCCESS, DB_SUCCESS_LOCKED_REC, DB_LOCK_WAIT, DB_DEADLOCK,
or DB_QUE_THR_SUSPENDED */
static
dberr_t
lock_rec_lock_slow
(
/*===============*/
ibool
impl
,
/*!< in: if TRUE, no lock is set
if no wait is necessary: we
assume that the caller will
set an implicit lock */
ulint
mode
,
/*!< in: lock mode: LOCK_X or
LOCK_S possibly ORed to either
LOCK_GAP or LOCK_REC_NOT_GAP */
const
buf_block_t
*
block
,
/*!< in: buffer block containing
the record */
ulint
heap_no
,
/*!< in: heap number of record */
dict_index_t
*
index
,
/*!< in: index of record */
que_thr_t
*
thr
)
/*!< in: query thread */
{
ut_ad
(
lock_mutex_own
());
trx_t
*
trx
=
thr_get_trx
(
thr
);
ut_ad
(
trx_mutex_own
(
trx
));
/* Do nothing if the trx already has a strong enough lock on rec */
if
(
!
lock_rec_has_expl
(
mode
,
block
,
heap_no
,
trx
))
{
lock_t
*
wait_for
=
lock_rec_other_has_conflicting
(
mode
,
block
,
heap_no
,
trx
);
if
(
wait_for
!=
NULL
)
{
/* If another transaction has a non-gap conflicting
request in the queue, as this transaction does not
have a lock strong enough already granted on the
record, we may have to wait. */
RecLock
rec_lock
(
thr
,
index
,
block
,
heap_no
,
mode
);
return
rec_lock
.
add_to_waitq
(
wait_for
);
}
else
if
(
!
impl
)
{
/* Set the requested lock on the record, note that
we already own the transaction mutex. */
lock_rec_add_to_queue
(
LOCK_REC
|
mode
,
block
,
heap_no
,
index
,
trx
,
true
);
return
DB_SUCCESS_LOCKED_REC
;
}
}
return
DB_SUCCESS
;
}
/*********************************************************************//**
/*********************************************************************//**
Tries to lock the specified record in the mode requested. If not immediately
Tries to lock the specified record in the mode requested. If not immediately
possible, enqueues a waiting lock request. This is a low-level function
possible, enqueues a waiting lock request. This is a low-level function
...
@@ -2500,7 +2440,29 @@ lock_rec_lock(
...
@@ -2500,7 +2440,29 @@ lock_rec_lock(
lock
->
type_mode
!=
(
mode
|
LOCK_REC
)
||
lock
->
type_mode
!=
(
mode
|
LOCK_REC
)
||
lock_rec_get_n_bits
(
lock
)
<=
heap_no
)
lock_rec_get_n_bits
(
lock
)
<=
heap_no
)
{
{
err
=
lock_rec_lock_slow
(
impl
,
mode
,
block
,
heap_no
,
index
,
thr
);
/* Do nothing if the trx already has a strong enough lock on rec */
if
(
!
lock_rec_has_expl
(
mode
,
block
,
heap_no
,
trx
))
{
if
(
lock_t
*
wait_for
=
lock_rec_other_has_conflicting
(
mode
,
block
,
heap_no
,
trx
))
{
/*
If another transaction has a non-gap conflicting
request in the queue, as this transaction does not
have a lock strong enough already granted on the
record, we may have to wait.
*/
RecLock
rec_lock
(
thr
,
index
,
block
,
heap_no
,
mode
);
err
=
rec_lock
.
add_to_waitq
(
wait_for
);
}
else
if
(
!
impl
)
{
/* Set the requested lock on the record. */
lock_rec_add_to_queue
(
LOCK_REC
|
mode
,
block
,
heap_no
,
index
,
trx
,
true
);
err
=
DB_SUCCESS_LOCKED_REC
;
}
}
}
}
else
if
(
!
impl
)
else
if
(
!
impl
)
{
{
...
...
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