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
ef0b2387
Commit
ef0b2387
authored
Oct 10, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#128 change tokudb_lock_timeout to session variable
parent
daf90b1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
storage/tokudb/hatoku_hton.cc
storage/tokudb/hatoku_hton.cc
+1
-16
storage/tokudb/hatoku_hton.h
storage/tokudb/hatoku_hton.h
+19
-0
No files found.
storage/tokudb/hatoku_hton.cc
View file @
ef0b2387
...
...
@@ -178,7 +178,6 @@ void toku_hton_update_primary_key_bytes_inserted(uint64_t row_size) {
increment_partitioned_counter
(
tokudb_primary_key_bytes_inserted
,
row_size
);
}
static
ulonglong
tokudb_lock_timeout
;
static
void
tokudb_lock_timeout_callback
(
DB
*
db
,
uint64_t
requesting_txnid
,
const
DBT
*
left_key
,
const
DBT
*
right_key
,
uint64_t
blocking_txnid
);
static
ulong
tokudb_cleaner_period
;
static
ulong
tokudb_cleaner_iterations
;
...
...
@@ -476,7 +475,7 @@ static int tokudb_init_func(void *p) {
r
=
db_env
->
cleaner_set_iterations
(
db_env
,
tokudb_cleaner_iterations
);
assert
(
r
==
0
);
r
=
db_env
->
set_lock_timeout
(
db_env
,
tokudb_lock_timeout
);
r
=
db_env
->
set_lock_timeout
(
db_env
,
DEFAULT_TOKUDB_LOCK_TIMEOUT
,
tokudb_get_lock_wait_time_callback
);
assert
(
r
==
0
);
r
=
db_env
->
get_engine_status_num_rows
(
db_env
,
&
toku_global_status_max_rows
);
...
...
@@ -1156,20 +1155,6 @@ static void tokudb_cleanup_log_files(void) {
// system variables
static
void
tokudb_lock_timeout_update
(
THD
*
thd
,
struct
st_mysql_sys_var
*
sys_var
,
void
*
var
,
const
void
*
save
)
{
ulonglong
*
timeout
=
(
ulonglong
*
)
var
;
*
timeout
=
*
(
const
ulonglong
*
)
save
;
db_env
->
set_lock_timeout
(
db_env
,
*
timeout
);
}
#define DEFAULT_LOCK_TIMEOUT_MSEC 4000
static
MYSQL_SYSVAR_ULONGLONG
(
lock_timeout
,
tokudb_lock_timeout
,
0
,
"TokuDB lock timeout"
,
NULL
,
tokudb_lock_timeout_update
,
DEFAULT_LOCK_TIMEOUT_MSEC
,
0
,
~
0ULL
,
0
);
static
void
tokudb_cleaner_period_update
(
THD
*
thd
,
struct
st_mysql_sys_var
*
sys_var
,
void
*
var
,
const
void
*
save
)
{
ulong
*
cleaner_period
=
(
ulong
*
)
var
;
*
cleaner_period
=
*
(
const
ulonglong
*
)
save
;
...
...
storage/tokudb/hatoku_hton.h
View file @
ef0b2387
...
...
@@ -341,6 +341,25 @@ static MYSQL_THDVAR_STR(last_lock_timeout, PLUGIN_VAR_MEMALLOC, "last TokuDB loc
static
MYSQL_THDVAR_BOOL
(
hide_default_row_format
,
0
,
"hide the default row format"
,
NULL
/*check*/
,
NULL
/*update*/
,
false
);
#define DEFAULT_TOKUDB_LOCK_TIMEOUT 4000
/*milliseconds*/
static
MYSQL_THDVAR_ULONGLONG
(
lock_timeout
,
0
,
"lock timeout"
,
NULL
,
NULL
,
DEFAULT_TOKUDB_LOCK_TIMEOUT
,
/*default*/
0
,
/*min*/
~
0ULL
,
/*max*/
1
/*blocksize*/
);
static
uint64_t
tokudb_get_lock_wait_time_callback
(
uint64_t
default_wait_time
)
{
THD
*
thd
=
current_thd
;
uint64_t
wait_time
=
THDVAR
(
thd
,
lock_timeout
);
return
wait_time
;
}
extern
HASH
tokudb_open_tables
;
extern
pthread_mutex_t
tokudb_mutex
;
extern
pthread_mutex_t
tokudb_meta_mutex
;
...
...
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