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
d274f91a
Commit
d274f91a
authored
May 05, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#224 fail tokudb init if jemalloc is not loaded
parent
2eb45b88
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
44 deletions
+50
-44
storage/tokudb/CMakeLists.txt
storage/tokudb/CMakeLists.txt
+4
-0
storage/tokudb/hatoku_hton.cc
storage/tokudb/hatoku_hton.cc
+41
-44
storage/tokudb/hatoku_hton.h
storage/tokudb/hatoku_hton.h
+5
-0
No files found.
storage/tokudb/CMakeLists.txt
View file @
d274f91a
...
...
@@ -27,6 +27,10 @@ IF(DEFINED TOKUDB_NOPATCH_CONFIG)
ADD_DEFINITIONS
(
"-DTOKUDB_NOPATCH_CONFIG=
${
TOKUDB_NOPATCH_CONFIG
}
"
)
ENDIF
()
IF
(
DEFINED TOKUDB_CHECK_JEMALLOC
)
ADD_DEFINITIONS
(
"-DTOKUDB_CHECK_JEMALLOC=
${
TOKUDB_CHECK_JEMALLOC
}
"
)
ENDIF
()
ADD_SUBDIRECTORY
(
ft-index
)
# TODO: clean up includes in ft-index
...
...
storage/tokudb/hatoku_hton.cc
View file @
d274f91a
...
...
@@ -301,50 +301,46 @@ static TOKU_ENGINE_STATUS_ROW_S* toku_global_status_rows = NULL;
static
void
handle_ydb_error
(
int
error
)
{
switch
(
error
)
{
case
TOKUDB_HUGE_PAGES_ENABLED
:
fprintf
(
stderr
,
"************************************************************
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
" @@@@@@@@@@@
\n
"
);
fprintf
(
stderr
,
" @@' '@@
\n
"
);
fprintf
(
stderr
,
" @@ _ _ @@
\n
"
);
fprintf
(
stderr
,
" | (.) (.) |
\n
"
);
fprintf
(
stderr
,
" | ` |
\n
"
);
fprintf
(
stderr
,
" | > ' |
\n
"
);
fprintf
(
stderr
,
" | .----. |
\n
"
);
fprintf
(
stderr
,
" .. |.----.| ..
\n
"
);
fprintf
(
stderr
,
" .. ' ' ..
\n
"
);
fprintf
(
stderr
,
" .._______,.
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
" %s will not run with transparent huge pages enabled.
\n
"
,
tokudb_hton_name
);
fprintf
(
stderr
,
" Please disable them to continue.
\n
"
);
fprintf
(
stderr
,
" (echo never > /sys/kernel/mm/transparent_hugepage/enabled)
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
"************************************************************
\n
"
);
fflush
(
stderr
);
sql_print_error
(
"************************************************************"
);
sql_print_error
(
" "
);
sql_print_error
(
" @@@@@@@@@@@ "
);
sql_print_error
(
" @@' '@@ "
);
sql_print_error
(
" @@ _ _ @@ "
);
sql_print_error
(
" | (.) (.) | "
);
sql_print_error
(
" | ` | "
);
sql_print_error
(
" | > ' | "
);
sql_print_error
(
" | .----. | "
);
sql_print_error
(
" .. |.----.| .. "
);
sql_print_error
(
" .. ' ' .. "
);
sql_print_error
(
" .._______,. "
);
sql_print_error
(
" "
);
sql_print_error
(
"%s will not run with transparent huge pages enabled. "
,
tokudb_hton_name
);
sql_print_error
(
"Please disable them to continue. "
);
sql_print_error
(
"(echo never > /sys/kernel/mm/transparent_hugepage/enabled) "
);
sql_print_error
(
" "
);
sql_print_error
(
"************************************************************"
);
break
;
}
}
static
int
tokudb_init_func
(
void
*
p
)
{
TOKUDB_DBUG_ENTER
(
""
);
TOKUDB_DBUG_ENTER
(
"%p"
,
p
);
int
r
;
#if defined(_WIN64)
r
=
toku_ydb_init
();
if
(
r
)
{
fprintf
(
stderr
,
"got error %d
\n
"
,
r
);
goto
error
;
}
#endif
// 3938: lock the handlerton's initialized status flag for writing
r
=
rw_wrlock
(
&
tokudb_hton_initialized_lock
);
assert
(
r
==
0
);
db_env
=
NULL
;
tokudb_hton
=
(
handlerton
*
)
p
;
#if TOKUDB_CHECK_JEMALLOC
if
(
tokudb_check_jemalloc
&&
dlsym
(
RTLD_DEFAULT
,
"mallctl"
)
==
NULL
)
{
sql_print_error
(
"%s not initialized because jemalloc is not loaded"
,
tokudb_hton_name
);
goto
error
;
}
#endif
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
);
...
...
@@ -442,19 +438,18 @@ static int tokudb_init_func(void *p) {
}
{
char
*
tmp_dir
=
tokudb_tmp_dir
;
char
*
data_dir
=
tokudb_data_dir
;
if
(
data_dir
==
0
)
{
data_dir
=
mysql_data_home
;
}
if
(
tmp_dir
==
0
)
{
tmp_dir
=
data_dir
;
}
DBUG_PRINT
(
"info"
,
(
"tokudb_data_dir: %s
\n
"
,
data_dir
));
db_env
->
set_data_dir
(
db_env
,
data_dir
);
DBUG_PRINT
(
"info"
,
(
"tokudb_tmp_dir: %s
\n
"
,
tmp_dir
));
db_env
->
set_tmp_dir
(
db_env
,
tmp_dir
);
char
*
tmp_dir
=
tokudb_tmp_dir
;
char
*
data_dir
=
tokudb_data_dir
;
if
(
data_dir
==
0
)
{
data_dir
=
mysql_data_home
;
}
if
(
tmp_dir
==
0
)
{
tmp_dir
=
data_dir
;
}
DBUG_PRINT
(
"info"
,
(
"tokudb_data_dir: %s
\n
"
,
data_dir
));
db_env
->
set_data_dir
(
db_env
,
data_dir
);
DBUG_PRINT
(
"info"
,
(
"tokudb_tmp_dir: %s
\n
"
,
tmp_dir
));
db_env
->
set_tmp_dir
(
db_env
,
tmp_dir
);
}
if
(
tokudb_log_dir
)
{
...
...
@@ -1339,7 +1334,6 @@ static void tokudb_fsync_log_period_update(THD *thd, struct st_mysql_sys_var *sy
static
MYSQL_SYSVAR_UINT
(
fsync_log_period
,
tokudb_fsync_log_period
,
0
,
"TokuDB fsync log period"
,
NULL
,
tokudb_fsync_log_period_update
,
0
,
0
,
~
0U
,
0
);
static
struct
st_mysql_sys_var
*
tokudb_system_variables
[]
=
{
MYSQL_SYSVAR
(
cache_size
),
MYSQL_SYSVAR
(
max_lock_memory
),
...
...
@@ -1388,6 +1382,9 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = {
MYSQL_SYSVAR
(
hide_default_row_format
),
MYSQL_SYSVAR
(
killed_time
),
MYSQL_SYSVAR
(
empty_scan
),
#if TOKUDB_CHECK_JEMALLOC
MYSQL_SYSVAR
(
check_jemalloc
),
#endif
NULL
};
...
...
storage/tokudb/hatoku_hton.h
View file @
d274f91a
...
...
@@ -510,6 +510,11 @@ static MYSQL_THDVAR_ENUM(empty_scan,
NULL
,
NULL
,
TOKUDB_EMPTY_SCAN_RL
,
&
tokudb_empty_scan_typelib
);
#if TOKUDB_CHECK_JEMALLOC
static
uint
tokudb_check_jemalloc
;
static
MYSQL_SYSVAR_UINT
(
check_jemalloc
,
tokudb_check_jemalloc
,
0
,
"Check if jemalloc is linked"
,
NULL
,
NULL
,
1
,
0
,
1
,
0
);
#endif
extern
HASH
tokudb_open_tables
;
extern
pthread_mutex_t
tokudb_mutex
;
extern
uint32_t
tokudb_write_status_frequency
;
...
...
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