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
d6260a79
Commit
d6260a79
authored
Jul 03, 2013
by
rich prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#27 rename the low priority multi operation checkpoint lock
parent
e94961e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
+23
-23
ft/checkpoint.cc
ft/checkpoint.cc
+9
-9
ft/checkpoint.h
ft/checkpoint.h
+2
-2
src/ydb_txn.cc
src/ydb_txn.cc
+12
-12
No files found.
ft/checkpoint.cc
View file @
d6260a79
...
@@ -183,7 +183,7 @@ static LSN last_completed_checkpoint_lsn;
...
@@ -183,7 +183,7 @@ static LSN last_completed_checkpoint_lsn;
static
toku_pthread_rwlock_t
checkpoint_safe_lock
;
static
toku_pthread_rwlock_t
checkpoint_safe_lock
;
static
toku_pthread_rwlock_t
multi_operation_lock
;
static
toku_pthread_rwlock_t
multi_operation_lock
;
static
toku_pthread_rwlock_t
big
_multi_operation_lock
;
static
toku_pthread_rwlock_t
low_priority
_multi_operation_lock
;
static
bool
initialized
=
false
;
// sanity check
static
bool
initialized
=
false
;
// sanity check
static
volatile
bool
locked_mo
=
false
;
// true when the multi_operation write lock is held (by checkpoint)
static
volatile
bool
locked_mo
=
false
;
// true when the multi_operation write lock is held (by checkpoint)
...
@@ -205,7 +205,7 @@ multi_operation_lock_init(void) {
...
@@ -205,7 +205,7 @@ multi_operation_lock_init(void) {
// happen on osx
// happen on osx
#endif
#endif
toku_pthread_rwlock_init
(
&
multi_operation_lock
,
&
attr
);
toku_pthread_rwlock_init
(
&
multi_operation_lock
,
&
attr
);
toku_pthread_rwlock_init
(
&
big
_multi_operation_lock
,
&
attr
);
toku_pthread_rwlock_init
(
&
low_priority
_multi_operation_lock
,
&
attr
);
pthread_rwlockattr_destroy
(
&
attr
);
pthread_rwlockattr_destroy
(
&
attr
);
locked_mo
=
false
;
locked_mo
=
false
;
}
}
...
@@ -213,12 +213,12 @@ multi_operation_lock_init(void) {
...
@@ -213,12 +213,12 @@ multi_operation_lock_init(void) {
static
void
static
void
multi_operation_lock_destroy
(
void
)
{
multi_operation_lock_destroy
(
void
)
{
toku_pthread_rwlock_destroy
(
&
multi_operation_lock
);
toku_pthread_rwlock_destroy
(
&
multi_operation_lock
);
toku_pthread_rwlock_destroy
(
&
big
_multi_operation_lock
);
toku_pthread_rwlock_destroy
(
&
low_priority
_multi_operation_lock
);
}
}
static
void
static
void
multi_operation_checkpoint_lock
(
void
)
{
multi_operation_checkpoint_lock
(
void
)
{
toku_pthread_rwlock_wrlock
(
&
big
_multi_operation_lock
);
toku_pthread_rwlock_wrlock
(
&
low_priority
_multi_operation_lock
);
toku_pthread_rwlock_wrlock
(
&
multi_operation_lock
);
toku_pthread_rwlock_wrlock
(
&
multi_operation_lock
);
locked_mo
=
true
;
locked_mo
=
true
;
}
}
...
@@ -227,7 +227,7 @@ static void
...
@@ -227,7 +227,7 @@ static void
multi_operation_checkpoint_unlock
(
void
)
{
multi_operation_checkpoint_unlock
(
void
)
{
locked_mo
=
false
;
locked_mo
=
false
;
toku_pthread_rwlock_wrunlock
(
&
multi_operation_lock
);
toku_pthread_rwlock_wrunlock
(
&
multi_operation_lock
);
toku_pthread_rwlock_wrunlock
(
&
big
_multi_operation_lock
);
toku_pthread_rwlock_wrunlock
(
&
low_priority
_multi_operation_lock
);
}
}
static
void
static
void
...
@@ -269,12 +269,12 @@ toku_multi_operation_client_unlock(void) {
...
@@ -269,12 +269,12 @@ toku_multi_operation_client_unlock(void) {
toku_pthread_rwlock_rdunlock
(
&
multi_operation_lock
);
toku_pthread_rwlock_rdunlock
(
&
multi_operation_lock
);
}
}
void
toku_
big
_multi_operation_client_lock
(
void
)
{
void
toku_
low_priority
_multi_operation_client_lock
(
void
)
{
toku_pthread_rwlock_rdlock
(
&
big
_multi_operation_lock
);
toku_pthread_rwlock_rdlock
(
&
low_priority
_multi_operation_lock
);
}
}
void
toku_
big
_multi_operation_client_unlock
(
void
)
{
void
toku_
low_priority
_multi_operation_client_unlock
(
void
)
{
toku_pthread_rwlock_rdunlock
(
&
big
_multi_operation_lock
);
toku_pthread_rwlock_rdunlock
(
&
low_priority
_multi_operation_lock
);
}
}
void
void
...
...
ft/checkpoint.h
View file @
d6260a79
...
@@ -135,10 +135,10 @@ void toku_checkpoint_safe_client_unlock(void);
...
@@ -135,10 +135,10 @@ void toku_checkpoint_safe_client_unlock(void);
*****/
*****/
void
toku_multi_operation_client_lock
(
void
);
void
toku_multi_operation_client_lock
(
void
);
void
toku_
big
_multi_operation_client_lock
(
void
);
void
toku_
low_priority
_multi_operation_client_lock
(
void
);
void
toku_multi_operation_client_unlock
(
void
);
void
toku_multi_operation_client_unlock
(
void
);
void
toku_
big
_multi_operation_client_unlock
(
void
);
void
toku_
low_priority
_multi_operation_client_unlock
(
void
);
// Initialize the checkpoint mechanism, must be called before any client operations.
// Initialize the checkpoint mechanism, must be called before any client operations.
...
...
src/ydb_txn.cc
View file @
d6260a79
...
@@ -136,7 +136,7 @@ toku_txn_destroy(DB_TXN *txn) {
...
@@ -136,7 +136,7 @@ toku_txn_destroy(DB_TXN *txn) {
static
int
static
int
toku_txn_commit
(
DB_TXN
*
txn
,
uint32_t
flags
,
toku_txn_commit
(
DB_TXN
*
txn
,
uint32_t
flags
,
TXN_PROGRESS_POLL_FUNCTION
poll
,
void
*
poll_extra
,
TXN_PROGRESS_POLL_FUNCTION
poll
,
void
*
poll_extra
,
bool
release_mo_lock
,
bool
big_txn
)
{
bool
release_mo_lock
,
bool
low_priority
)
{
HANDLE_PANICKED_ENV
(
txn
->
mgrp
);
HANDLE_PANICKED_ENV
(
txn
->
mgrp
);
//Recursively kill off children
//Recursively kill off children
if
(
db_txn_struct_i
(
txn
)
->
child
)
{
if
(
db_txn_struct_i
(
txn
)
->
child
)
{
...
@@ -192,8 +192,8 @@ toku_txn_commit(DB_TXN * txn, uint32_t flags,
...
@@ -192,8 +192,8 @@ toku_txn_commit(DB_TXN * txn, uint32_t flags,
// begin checkpoint logs these associations, so we must be protect
// begin checkpoint logs these associations, so we must be protect
// the changing of these associations with checkpointing
// the changing of these associations with checkpointing
if
(
release_mo_lock
)
{
if
(
release_mo_lock
)
{
if
(
big_txn
)
{
if
(
low_priority
)
{
toku_
big
_multi_operation_client_unlock
();
toku_
low_priority
_multi_operation_client_unlock
();
}
else
{
}
else
{
toku_multi_operation_client_unlock
();
toku_multi_operation_client_unlock
();
}
}
...
@@ -328,14 +328,14 @@ static int
...
@@ -328,14 +328,14 @@ static int
locked_txn_commit_with_progress
(
DB_TXN
*
txn
,
uint32_t
flags
,
locked_txn_commit_with_progress
(
DB_TXN
*
txn
,
uint32_t
flags
,
TXN_PROGRESS_POLL_FUNCTION
poll
,
void
*
poll_extra
)
{
TXN_PROGRESS_POLL_FUNCTION
poll
,
void
*
poll_extra
)
{
bool
holds_mo_lock
=
false
;
bool
holds_mo_lock
=
false
;
bool
big_txn
=
false
;
bool
low_priority
=
false
;
TOKUTXN
tokutxn
=
db_txn_struct_i
(
txn
)
->
tokutxn
;
TOKUTXN
tokutxn
=
db_txn_struct_i
(
txn
)
->
tokutxn
;
if
(
!
toku_txn_is_read_only
(
tokutxn
))
{
if
(
!
toku_txn_is_read_only
(
tokutxn
))
{
// A readonly transaction does no logging, and therefore does not need the MO lock.
// A readonly transaction does no logging, and therefore does not need the MO lock.
holds_mo_lock
=
true
;
holds_mo_lock
=
true
;
if
(
toku_txn_has_spilled_rollback
(
tokutxn
))
{
if
(
toku_txn_has_spilled_rollback
(
tokutxn
))
{
big_txn
=
true
;
low_priority
=
true
;
toku_
big
_multi_operation_client_lock
();
toku_
low_priority
_multi_operation_client_lock
();
}
else
{
}
else
{
toku_multi_operation_client_lock
();
toku_multi_operation_client_lock
();
}
}
...
@@ -345,7 +345,7 @@ locked_txn_commit_with_progress(DB_TXN *txn, uint32_t flags,
...
@@ -345,7 +345,7 @@ locked_txn_commit_with_progress(DB_TXN *txn, uint32_t flags,
// see a non-readonly txn in the recursive commit.
// see a non-readonly txn in the recursive commit.
// But released in the first-level toku_txn_commit (if taken),
// But released in the first-level toku_txn_commit (if taken),
// this way, we don't hold it while we fsync the log.
// this way, we don't hold it while we fsync the log.
int
r
=
toku_txn_commit
(
txn
,
flags
,
poll
,
poll_extra
,
holds_mo_lock
,
big_txn
);
int
r
=
toku_txn_commit
(
txn
,
flags
,
poll
,
poll_extra
,
holds_mo_lock
,
low_priority
);
return
r
;
return
r
;
}
}
...
@@ -357,22 +357,22 @@ locked_txn_abort_with_progress(DB_TXN *txn,
...
@@ -357,22 +357,22 @@ locked_txn_abort_with_progress(DB_TXN *txn,
// see a non-readonly txn in the abort (or recursive commit).
// see a non-readonly txn in the abort (or recursive commit).
// But released here so we don't have to hold additional state.
// But released here so we don't have to hold additional state.
bool
holds_mo_lock
=
false
;
bool
holds_mo_lock
=
false
;
bool
big_txn
=
false
;
bool
low_priority
=
false
;
TOKUTXN
tokutxn
=
db_txn_struct_i
(
txn
)
->
tokutxn
;
TOKUTXN
tokutxn
=
db_txn_struct_i
(
txn
)
->
tokutxn
;
if
(
!
toku_txn_is_read_only
(
tokutxn
))
{
if
(
!
toku_txn_is_read_only
(
tokutxn
))
{
// A readonly transaction does no logging, and therefore does not need the MO lock.
// A readonly transaction does no logging, and therefore does not need the MO lock.
holds_mo_lock
=
true
;
holds_mo_lock
=
true
;
if
(
toku_txn_has_spilled_rollback
(
tokutxn
))
{
if
(
toku_txn_has_spilled_rollback
(
tokutxn
))
{
big_txn
=
true
;
low_priority
=
true
;
toku_
big
_multi_operation_client_lock
();
toku_
low_priority
_multi_operation_client_lock
();
}
else
{
}
else
{
toku_multi_operation_client_lock
();
toku_multi_operation_client_lock
();
}
}
}
}
int
r
=
toku_txn_abort
(
txn
,
poll
,
poll_extra
);
int
r
=
toku_txn_abort
(
txn
,
poll
,
poll_extra
);
if
(
holds_mo_lock
)
{
if
(
holds_mo_lock
)
{
if
(
big_txn
)
{
if
(
low_priority
)
{
toku_
big
_multi_operation_client_unlock
();
toku_
low_priority
_multi_operation_client_unlock
();
}
else
{
}
else
{
toku_multi_operation_client_unlock
();
toku_multi_operation_client_unlock
();
}
}
...
...
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