Commit 527997e1 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5653 set number of bucket mutexes in stress tests to help drd


git-svn-id: file:///svn/toku/tokudb@49499 c7de825b-a66e-492c-adef-691d508d4ae1
parent 79eb0c0f
...@@ -67,6 +67,7 @@ struct env_args { ...@@ -67,6 +67,7 @@ struct env_args {
int cleaner_iterations; int cleaner_iterations;
int64_t lk_max_memory; int64_t lk_max_memory;
uint64_t cachetable_size; uint64_t cachetable_size;
uint32_t num_bucket_mutexes;
const char *envdir; const char *envdir;
test_update_callback_f update_function; // update callback function test_update_callback_f update_function; // update callback function
test_generate_row_for_put_callback generate_put_callback; test_generate_row_for_put_callback generate_put_callback;
...@@ -1463,6 +1464,7 @@ static int create_tables(DB_ENV **env_res, DB **db_res, int num_DBs, ...@@ -1463,6 +1464,7 @@ static int create_tables(DB_ENV **env_res, DB **db_res, int num_DBs,
r = toku_os_mkdir(env_args.envdir, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0); r = toku_os_mkdir(env_args.envdir, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
DB_ENV *env; DB_ENV *env;
db_env_set_num_bucket_mutexes(env_args.num_bucket_mutexes);
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->set_redzone(env, 0); CKERR(r); r = env->set_redzone(env, 0); CKERR(r);
r = env->set_default_bt_compare(env, bt_compare); CKERR(r); r = env->set_default_bt_compare(env, bt_compare); CKERR(r);
...@@ -1596,6 +1598,7 @@ static int open_tables(DB_ENV **env_res, DB **db_res, int num_DBs, ...@@ -1596,6 +1598,7 @@ static int open_tables(DB_ENV **env_res, DB **db_res, int num_DBs,
/* create the dup database file */ /* create the dup database file */
DB_ENV *env; DB_ENV *env;
db_env_set_num_bucket_mutexes(env_args.num_bucket_mutexes);
r = db_env_create(&env, 0); assert(r == 0); r = db_env_create(&env, 0); assert(r == 0);
r = env->set_redzone(env, 0); CKERR(r); r = env->set_redzone(env, 0); CKERR(r);
r = env->set_default_bt_compare(env, bt_compare); CKERR(r); r = env->set_default_bt_compare(env, bt_compare); CKERR(r);
...@@ -1656,6 +1659,7 @@ static const struct env_args DEFAULT_ENV_ARGS = { ...@@ -1656,6 +1659,7 @@ static const struct env_args DEFAULT_ENV_ARGS = {
.cleaner_iterations = 1, .cleaner_iterations = 1,
.lk_max_memory = 1 * 1024 * 1024, .lk_max_memory = 1 * 1024 * 1024,
.cachetable_size = 300000, .cachetable_size = 300000,
.num_bucket_mutexes = 1024,
.envdir = ENVDIR, .envdir = ENVDIR,
.update_function = update_op_callback, .update_function = update_op_callback,
.generate_put_callback = NULL, .generate_put_callback = NULL,
...@@ -1670,6 +1674,7 @@ static const struct env_args DEFAULT_PERF_ENV_ARGS = { ...@@ -1670,6 +1674,7 @@ static const struct env_args DEFAULT_PERF_ENV_ARGS = {
.cleaner_iterations = 5, .cleaner_iterations = 5,
.lk_max_memory = 1L * 1024 * 1024 * 1024, .lk_max_memory = 1L * 1024 * 1024 * 1024,
.cachetable_size = 1<<30, .cachetable_size = 1<<30,
.num_bucket_mutexes = 1024 * 1024,
.envdir = ENVDIR, .envdir = ENVDIR,
.update_function = NULL, .update_function = NULL,
.generate_put_callback = NULL, .generate_put_callback = NULL,
...@@ -2065,6 +2070,7 @@ static inline void parse_stress_test_args (int argc, char *const argv[], struct ...@@ -2065,6 +2070,7 @@ static inline void parse_stress_test_args (int argc, char *const argv[], struct
INT32_ARG_R("--performance_period", performance_period, "s", 1, INT32_MAX), INT32_ARG_R("--performance_period", performance_period, "s", 1, INT32_MAX),
UINT64_ARG("--cachetable_size", env_args.cachetable_size, " bytes"), UINT64_ARG("--cachetable_size", env_args.cachetable_size, " bytes"),
UINT32_ARG("--num_bucket_mutexes", env_args.num_bucket_mutexes, " mutexes"),
DOUBLE_ARG_R("--compressibility", compressibility, "", 0.0, 1.0), DOUBLE_ARG_R("--compressibility", compressibility, "", 0.0, 1.0),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment