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
7d843822
Commit
7d843822
authored
Dec 05, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#141 redo table open and close locking to avoid table opening pileup
parent
e56f12d4
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
166 additions
and
94 deletions
+166
-94
storage/tokudb/ha_tokudb.cc
storage/tokudb/ha_tokudb.cc
+113
-86
storage/tokudb/ha_tokudb.h
storage/tokudb/ha_tokudb.h
+11
-6
storage/tokudb/hatoku_defines.h
storage/tokudb/hatoku_defines.h
+40
-0
storage/tokudb/hatoku_hton.cc
storage/tokudb/hatoku_hton.cc
+2
-2
No files found.
storage/tokudb/ha_tokudb.cc
View file @
7d843822
This diff is collapsed.
Click to expand it.
storage/tokudb/ha_tokudb.h
View file @
7d843822
...
@@ -126,6 +126,10 @@ typedef struct hot_optimize_context {
...
@@ -126,6 +126,10 @@ typedef struct hot_optimize_context {
// and auto increment information.
// and auto increment information.
//
//
class
TOKUDB_SHARE
{
class
TOKUDB_SHARE
{
public:
void
init
(
void
);
void
destroy
(
void
);
public:
public:
char
*
table_name
;
char
*
table_name
;
uint
table_name_length
,
use_count
;
uint
table_name_length
,
use_count
;
...
@@ -184,6 +188,10 @@ public:
...
@@ -184,6 +188,10 @@ public:
bool
replace_into_fast
;
bool
replace_into_fast
;
rw_lock_t
num_DBs_lock
;
rw_lock_t
num_DBs_lock
;
uint32_t
num_DBs
;
uint32_t
num_DBs
;
pthread_cond_t
m_openclose_cond
;
enum
{
CLOSED
,
OPENING
,
OPENED
,
CLOSING
,
ERROR
}
m_state
;
int
m_error
;
};
};
typedef
struct
st_filter_key_part_info
{
typedef
struct
st_filter_key_part_info
{
...
@@ -443,10 +451,7 @@ private:
...
@@ -443,10 +451,7 @@ private:
int
write_auto_inc_create
(
DB
*
db
,
ulonglong
val
,
DB_TXN
*
txn
);
int
write_auto_inc_create
(
DB
*
db
,
ulonglong
val
,
DB_TXN
*
txn
);
void
init_auto_increment
();
void
init_auto_increment
();
bool
can_replace_into_be_fast
(
TABLE_SHARE
*
table_share
,
KEY_AND_COL_INFO
*
kc_info
,
uint
pk
);
bool
can_replace_into_be_fast
(
TABLE_SHARE
*
table_share
,
KEY_AND_COL_INFO
*
kc_info
,
uint
pk
);
int
initialize_share
(
int
initialize_share
(
const
char
*
name
,
int
mode
);
const
char
*
name
,
int
mode
);
void
set_query_columns
(
uint
keynr
);
void
set_query_columns
(
uint
keynr
);
int
prelock_range
(
const
key_range
*
start_key
,
const
key_range
*
end_key
);
int
prelock_range
(
const
key_range
*
start_key
,
const
key_range
*
end_key
);
...
@@ -599,10 +604,10 @@ public:
...
@@ -599,10 +604,10 @@ public:
int
get_status
(
DB_TXN
*
trans
);
int
get_status
(
DB_TXN
*
trans
);
void
init_hidden_prim_key_info
();
void
init_hidden_prim_key_info
();
inline
void
get_auto_primary_key
(
uchar
*
to
)
{
inline
void
get_auto_primary_key
(
uchar
*
to
)
{
pthread_mutex_lock
(
&
share
->
mutex
);
tokudb_
pthread_mutex_lock
(
&
share
->
mutex
);
share
->
auto_ident
++
;
share
->
auto_ident
++
;
hpk_num_to_char
(
to
,
share
->
auto_ident
);
hpk_num_to_char
(
to
,
share
->
auto_ident
);
pthread_mutex_unlock
(
&
share
->
mutex
);
tokudb_
pthread_mutex_unlock
(
&
share
->
mutex
);
}
}
virtual
void
get_auto_increment
(
ulonglong
offset
,
ulonglong
increment
,
ulonglong
nb_desired_values
,
ulonglong
*
first_value
,
ulonglong
*
nb_reserved_values
);
virtual
void
get_auto_increment
(
ulonglong
offset
,
ulonglong
increment
,
ulonglong
nb_desired_values
,
ulonglong
*
first_value
,
ulonglong
*
nb_reserved_values
);
bool
is_optimize_blocking
();
bool
is_optimize_blocking
();
...
...
storage/tokudb/hatoku_defines.h
View file @
7d843822
...
@@ -443,4 +443,44 @@ static inline void* tokudb_my_multi_malloc(myf myFlags, ...) {
...
@@ -443,4 +443,44 @@ static inline void* tokudb_my_multi_malloc(myf myFlags, ...) {
return
start
;
return
start
;
}
}
static
inline
void
tokudb_pthread_mutex_init
(
pthread_mutex_t
*
mutex
,
const
pthread_mutexattr_t
*
attr
)
{
int
r
=
pthread_mutex_init
(
mutex
,
attr
);
assert
(
r
==
0
);
}
static
inline
void
tokudb_pthread_mutex_destroy
(
pthread_mutex_t
*
mutex
)
{
int
r
=
pthread_mutex_destroy
(
mutex
);
assert
(
r
==
0
);
}
static
inline
void
tokudb_pthread_mutex_lock
(
pthread_mutex_t
*
mutex
)
{
int
r
=
pthread_mutex_lock
(
mutex
);
assert
(
r
==
0
);
}
static
inline
void
tokudb_pthread_mutex_unlock
(
pthread_mutex_t
*
mutex
)
{
int
r
=
pthread_mutex_unlock
(
mutex
);
assert
(
r
==
0
);
}
static
inline
void
tokudb_pthread_cond_init
(
pthread_cond_t
*
cond
,
const
pthread_condattr_t
*
attr
)
{
int
r
=
pthread_cond_init
(
cond
,
attr
);
assert
(
r
==
0
);
}
static
inline
void
tokudb_pthread_cond_destroy
(
pthread_cond_t
*
cond
)
{
int
r
=
pthread_cond_destroy
(
cond
);
assert
(
r
==
0
);
}
static
inline
void
tokudb_pthread_cond_wait
(
pthread_cond_t
*
cond
,
pthread_mutex_t
*
mutex
)
{
int
r
=
pthread_cond_wait
(
cond
,
mutex
);
assert
(
r
==
0
);
}
static
inline
void
tokudb_pthread_cond_broadcast
(
pthread_cond_t
*
cond
)
{
int
r
=
pthread_cond_broadcast
(
cond
);
assert
(
r
==
0
);
}
#endif
#endif
storage/tokudb/hatoku_hton.cc
View file @
7d843822
...
@@ -311,7 +311,7 @@ static int tokudb_init_func(void *p) {
...
@@ -311,7 +311,7 @@ static int tokudb_init_func(void *p) {
tokudb_hton
=
(
handlerton
*
)
p
;
tokudb_hton
=
(
handlerton
*
)
p
;
pthread_mutex_init
(
&
tokudb_mutex
,
MY_MUTEX_INIT_FAST
);
tokudb_
pthread_mutex_init
(
&
tokudb_mutex
,
MY_MUTEX_INIT_FAST
);
(
void
)
my_hash_init
(
&
tokudb_open_tables
,
table_alias_charset
,
32
,
0
,
0
,
(
my_hash_get_key
)
tokudb_get_key
,
0
,
0
);
(
void
)
my_hash_init
(
&
tokudb_open_tables
,
table_alias_charset
,
32
,
0
,
0
,
(
my_hash_get_key
)
tokudb_get_key
,
0
,
0
);
tokudb_hton
->
state
=
SHOW_OPTION_YES
;
tokudb_hton
->
state
=
SHOW_OPTION_YES
;
...
@@ -529,7 +529,7 @@ static int tokudb_done_func(void *p) {
...
@@ -529,7 +529,7 @@ static int tokudb_done_func(void *p) {
tokudb_my_free
(
toku_global_status_rows
);
tokudb_my_free
(
toku_global_status_rows
);
toku_global_status_rows
=
NULL
;
toku_global_status_rows
=
NULL
;
my_hash_free
(
&
tokudb_open_tables
);
my_hash_free
(
&
tokudb_open_tables
);
pthread_mutex_destroy
(
&
tokudb_mutex
);
tokudb_
pthread_mutex_destroy
(
&
tokudb_mutex
);
#if defined(_WIN64)
#if defined(_WIN64)
toku_ydb_destroy
();
toku_ydb_destroy
();
#endif
#endif
...
...
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