diff options
author | Rich Prohaska <prohaska@tokutek.com> | 2013-09-30 13:18:07 -0400 |
---|---|---|
committer | Rich Prohaska <prohaska@tokutek.com> | 2013-09-30 13:18:07 -0400 |
commit | e9084aaaf2f38b311eaf6a090aacf4ccbbb1c3a2 (patch) | |
tree | b03ed1224f116cd56ec9cf596f92383a3cdbda9f | |
parent | c8fc4d662ba797a1433333aee4fae08dc2f9a30e (diff) | |
download | mariadb-git-e9084aaaf2f38b311eaf6a090aacf4ccbbb1c3a2.tar.gz |
tokutek/ft-engine#111 tokutek/ft-index#74 merge the tokumx error message for transparent huge pages into tokudb
-rw-r--r-- | storage/tokudb/hatoku_hton.cc | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index 050f0aa6a6b..6db66fd84ae 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -247,15 +247,12 @@ static int tokudb_hton_initialized; static rw_lock_t tokudb_hton_initialized_lock; static void create_tokudb_hton_intialized_lock(void) __attribute__((constructor)); -static void destroy_tokudb_hton_initialized_lock(void) __attribute__((destructor)); - -static void create_tokudb_hton_intialized_lock(void) -{ +static void create_tokudb_hton_intialized_lock(void) { my_rwlock_init(&tokudb_hton_initialized_lock, 0); } -static void destroy_tokudb_hton_initialized_lock(void) -{ +static void destroy_tokudb_hton_initialized_lock(void) __attribute__((destructor)); +static void destroy_tokudb_hton_initialized_lock(void) { rwlock_destroy(&tokudb_hton_initialized_lock); } @@ -263,14 +260,40 @@ static SHOW_VAR *toku_global_status_variables = NULL; static uint64_t toku_global_status_max_rows; 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); + break; + } +} static int tokudb_init_func(void *p) { TOKUDB_DBUG_ENTER("tokudb_init_func"); int r; + #if defined(_WIN64) r = toku_ydb_init(); if (r) { - printf("got error %d\n", r); + fprintf(stderr, "got error %d\n", r); goto error; } #endif @@ -334,6 +357,7 @@ static int tokudb_init_func(void *p) { if ((r = db_env_create(&db_env, 0))) { DBUG_PRINT("info", ("db_env_create %d\n", r)); + handle_ydb_error(r); goto error; } @@ -347,7 +371,7 @@ static int tokudb_init_func(void *p) { // config error handling db_env->set_errcall(db_env, tokudb_print_error); - db_env->set_errpfx(db_env, "TokuDB"); + db_env->set_errpfx(db_env, tokudb_hton_name); // // set default comparison functions |