Commit 45d038fa authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4427], merge changes to main

git-svn-id: file:///svn/toku/tokudb@39258 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2f43b601
...@@ -63,21 +63,23 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -63,21 +63,23 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
} }
// make the guy that updates the db // make the guy that updates the db
struct update_op_args uoe = get_update_op_args(cli_args, NULL);
myargs[0].operation_extra = &uoe;
myargs[0].operation = update_op; myargs[0].operation = update_op;
//myargs[0].update_pad_frequency = 0; //myargs[0].update_pad_frequency = 0;
db_env_set_flusher_thread_callback(ft_callback, env); db_env_set_flusher_thread_callback(ft_callback, env);
run_workers(myargs, num_threads, cli_args->time_of_test, true); run_workers(myargs, num_threads, cli_args->time_of_test, true, cli_args);
} }
static int static int
run_recover_ft_test(int argc, char *const argv[]) { run_recover_ft_test(int argc, char *const argv[]) {
struct cli_args args = DEFAULT_ARGS; struct cli_args args = get_default_args();
// make test time arbitrarily high because we expect a crash // make test time arbitrarily high because we expect a crash
args.time_of_test = 1000000000; args.time_of_test = 1000000000;
args.num_elements = 2000; args.num_elements = 2000;
// we want to induce a checkpoint // we want to induce a checkpoint
args.checkpointing_period = 0; args.env_args.checkpointing_period = 0;
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
if (args.do_test_and_crash) { if (args.do_test_and_crash) {
stress_test_main(&args); stress_test_main(&args);
......
...@@ -55,29 +55,40 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -55,29 +55,40 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], n, dbp, env, cli_args);
} }
struct scan_op_extra soe[4];
// make the forward fast scanner // make the forward fast scanner
myargs[0].fast = TRUE; soe[0].fast = TRUE;
myargs[0].fwd = TRUE; soe[0].fwd = TRUE;
soe[0].prefetch = FALSE;
myargs[0].operation_extra = &soe[0];
myargs[0].operation = scan_op; myargs[0].operation = scan_op;
// make the forward slow scanner // make the forward slow scanner
myargs[1].fast = FALSE; soe[1].fast = FALSE;
myargs[1].fwd = TRUE; soe[1].fwd = TRUE;
soe[1].prefetch = FALSE;
myargs[1].operation_extra = &soe[1];
myargs[1].operation = scan_op; myargs[1].operation = scan_op;
// make the backward fast scanner // make the backward fast scanner
myargs[2].fast = TRUE; soe[2].fast = TRUE;
myargs[2].fwd = FALSE; soe[2].fwd = FALSE;
soe[2].prefetch = FALSE;
myargs[2].operation_extra = &soe[2];
myargs[2].operation = scan_op; myargs[2].operation = scan_op;
// make the backward slow scanner // make the backward slow scanner
myargs[3].fast = FALSE; soe[3].fast = FALSE;
myargs[3].fwd = FALSE; soe[3].fwd = FALSE;
soe[3].prefetch = FALSE;
myargs[3].operation_extra = &soe[3];
myargs[3].operation = scan_op; myargs[3].operation = scan_op;
struct update_op_args uoe = get_update_op_args(cli_args, NULL);
// make the guy that updates the db // make the guy that updates the db
for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) { for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) {
myargs[i].operation_extra = &uoe;
myargs[i].operation = update_op; myargs[i].operation = update_op;
} }
...@@ -87,13 +98,13 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -87,13 +98,13 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
} }
int num_seconds = random() % cli_args->time_of_test; int num_seconds = random() % cli_args->time_of_test;
run_workers(myargs, num_threads, num_seconds, true); run_workers(myargs, num_threads, num_seconds, true, cli_args);
} }
int int
test_main(int argc, char *const argv[]) { test_main(int argc, char *const argv[]) {
struct cli_args args = DEFAULT_ARGS; struct cli_args args = get_default_args();
args.checkpointing_period = 1; args.env_args.checkpointing_period = 1;
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
if (args.do_test_and_crash) { if (args.do_test_and_crash) {
stress_test_main(&args); stress_test_main(&args);
......
...@@ -22,21 +22,23 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -22,21 +22,23 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
if (verbose) printf("starting creation of pthreads\n"); if (verbose) printf("starting creation of pthreads\n");
const int num_threads = cli_args->num_update_threads; const int num_threads = cli_args->num_update_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { struct update_op_args uoe = get_update_op_args(cli_args, NULL);
// make the guy that updates the db
for (int i = 0; i < 0 + cli_args->num_update_threads; ++i) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], n, dbp, env, cli_args);
// make the guy that updates the db myargs[i].operation_extra = &uoe;
myargs[i].operation = update_op; myargs[i].operation = update_op;
} }
int num_seconds = random() % cli_args->time_of_test; int num_seconds = random() % cli_args->time_of_test;
run_workers(myargs, num_threads, num_seconds, true); run_workers(myargs, num_threads, num_seconds, true, cli_args);
} }
int int
test_main(int argc, char *const argv[]) { test_main(int argc, char *const argv[]) {
struct cli_args args = DEFAULT_ARGS; struct cli_args args = get_default_args();
args.checkpointing_period = 1; args.env_args.checkpointing_period = 1;
args.num_elements = 2000; args.num_elements = 2000;
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
if (args.do_test_and_crash) { if (args.do_test_and_crash) {
......
...@@ -55,29 +55,40 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -55,29 +55,40 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], n, dbp, env, cli_args);
} }
struct scan_op_extra soe[4];
// make the forward fast scanner // make the forward fast scanner
myargs[0].fast = TRUE; soe[0].fast = TRUE;
myargs[0].fwd = TRUE; soe[0].fwd = TRUE;
soe[0].prefetch = FALSE;
myargs[0].operation_extra = &soe[0];
myargs[0].operation = scan_op; myargs[0].operation = scan_op;
// make the forward slow scanner // make the forward slow scanner
myargs[1].fast = FALSE; soe[1].fast = FALSE;
myargs[1].fwd = TRUE; soe[1].fwd = TRUE;
soe[1].prefetch = FALSE;
myargs[1].operation_extra = &soe[1];
myargs[1].operation = scan_op; myargs[1].operation = scan_op;
// make the backward fast scanner // make the backward fast scanner
myargs[2].fast = TRUE; soe[2].fast = TRUE;
myargs[2].fwd = FALSE; soe[2].fwd = FALSE;
soe[2].prefetch = FALSE;
myargs[2].operation_extra = &soe[2];
myargs[2].operation = scan_op; myargs[2].operation = scan_op;
// make the backward slow scanner // make the backward slow scanner
myargs[3].fast = FALSE; soe[3].fast = FALSE;
myargs[3].fwd = FALSE; soe[3].fwd = FALSE;
soe[3].prefetch = FALSE;
myargs[3].operation_extra = &soe[3];
myargs[3].operation = scan_op; myargs[3].operation = scan_op;
struct update_op_args uoe = get_update_op_args(cli_args, NULL);
// make the guy that updates the db // make the guy that updates the db
for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) { for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) {
myargs[i].operation_extra = &uoe;
myargs[i].operation = update_op; myargs[i].operation = update_op;
} }
...@@ -86,12 +97,12 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -86,12 +97,12 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
myargs[i].operation = ptquery_op; myargs[i].operation = ptquery_op;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
} }
int int
test_main(int argc, char *const argv[]) { test_main(int argc, char *const argv[]) {
struct cli_args args = DEFAULT_ARGS; struct cli_args args = get_default_args();
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
stress_test_main(&args); stress_test_main(&args);
return 0; return 0;
......
...@@ -49,45 +49,56 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -49,45 +49,56 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], n, dbp, env, cli_args);
} }
struct scan_op_extra soe[4];
// make the forward fast scanner // make the forward fast scanner
myargs[0].fast = TRUE; soe[0].fast = TRUE;
myargs[0].fwd = TRUE; soe[0].fwd = TRUE;
soe[0].prefetch = FALSE;
myargs[0].operation_extra = &soe[0];
myargs[0].operation = scan_op; myargs[0].operation = scan_op;
// make the forward slow scanner // make the forward slow scanner
myargs[1].fast = FALSE; soe[1].fast = FALSE;
myargs[1].fwd = TRUE; soe[1].fwd = TRUE;
soe[1].prefetch = FALSE;
myargs[1].operation_extra = &soe[1];
myargs[1].operation = scan_op; myargs[1].operation = scan_op;
// make the backward fast scanner // make the backward fast scanner
myargs[2].fast = TRUE; soe[2].fast = TRUE;
myargs[2].fwd = FALSE; soe[2].fwd = FALSE;
soe[2].prefetch = FALSE;
myargs[2].operation_extra = &soe[2];
myargs[2].operation = scan_op; myargs[2].operation = scan_op;
// make the backward slow scanner // make the backward slow scanner
myargs[3].fast = FALSE; soe[3].fast = FALSE;
myargs[3].fwd = FALSE; soe[3].fwd = FALSE;
soe[3].prefetch = FALSE;
myargs[3].operation_extra = &soe[3];
myargs[3].operation = scan_op; myargs[3].operation = scan_op;
struct update_op_args uoe = get_update_op_args(cli_args, NULL);
// make the guy that updates the db // make the guy that updates the db
for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) { for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) {
myargs[i].bounded_update_range = false; myargs[i].operation_extra = &uoe;
myargs[i].bounded_element_range = false;
myargs[i].operation = update_op; myargs[i].operation = update_op;
} }
// make the guy that does point queries // make the guy that does point queries
for (int i = 4 + cli_args->num_update_threads; i < num_threads; i++) { for (int i = 4 + cli_args->num_update_threads; i < num_threads; i++) {
myargs[i].bounded_update_range = false; myargs[i].bounded_element_range = false;
myargs[i].operation = ptquery_op_no_check; myargs[i].operation = ptquery_op_no_check;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
} }
int int
test_main(int argc, char *const argv[]) { test_main(int argc, char *const argv[]) {
struct cli_args args = DEFAULT_ARGS; struct cli_args args = get_default_args();
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
stress_test_main(&args); stress_test_main(&args);
return 0; return 0;
......
...@@ -48,28 +48,40 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -48,28 +48,40 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], n, dbp, env, cli_args);
} }
struct scan_op_extra soe[4];
// make the forward fast scanner // make the forward fast scanner
myargs[0].fast = TRUE; soe[0].fast = TRUE;
myargs[0].fwd = TRUE; soe[0].fwd = TRUE;
soe[0].prefetch = FALSE;
myargs[0].operation_extra = &soe[0];
myargs[0].operation = scan_op; myargs[0].operation = scan_op;
// make the forward slow scanner // make the forward slow scanner
myargs[1].fast = FALSE; soe[1].fast = FALSE;
myargs[1].fwd = TRUE; soe[1].fwd = TRUE;
soe[1].prefetch = FALSE;
myargs[1].operation_extra = &soe[1];
myargs[1].operation = scan_op; myargs[1].operation = scan_op;
// make the backward fast scanner // make the backward fast scanner
myargs[2].fast = TRUE; soe[2].fast = TRUE;
myargs[2].fwd = FALSE; soe[2].fwd = FALSE;
soe[2].prefetch = FALSE;
myargs[2].operation_extra = &soe[2];
myargs[2].operation = scan_op; myargs[2].operation = scan_op;
// make the backward slow scanner // make the backward slow scanner
myargs[3].fast = FALSE; soe[3].fast = FALSE;
myargs[3].fwd = FALSE; soe[3].fwd = FALSE;
soe[3].prefetch = FALSE;
myargs[3].operation_extra = &soe[3];
myargs[3].operation = scan_op; myargs[3].operation = scan_op;
struct update_op_args uoe = get_update_op_args(cli_args, NULL);
// make the guy that updates the db // make the guy that updates the db
for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) { for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) {
myargs[i].operation_extra = &uoe;
myargs[i].lock_type = STRESS_LOCK_SHARED; myargs[i].lock_type = STRESS_LOCK_SHARED;
myargs[i].operation = update_op; myargs[i].operation = update_op;
} }
...@@ -84,12 +96,12 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -84,12 +96,12 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
myargs[i].operation = ptquery_op; myargs[i].operation = ptquery_op;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
} }
int int
test_main(int argc, char *const argv[]) { test_main(int argc, char *const argv[]) {
struct cli_args args = DEFAULT_ARGS; struct cli_args args = get_default_args();
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
stress_test_main(&args); stress_test_main(&args);
return 0; return 0;
......
...@@ -48,30 +48,42 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -48,30 +48,42 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], n, dbp, env, cli_args);
} }
struct scan_op_extra soe[4];
// make the forward fast scanner // make the forward fast scanner
myargs[0].fast = TRUE; soe[0].fast = TRUE;
myargs[0].fwd = TRUE; soe[0].fwd = TRUE;
soe[0].prefetch = FALSE;
myargs[0].operation_extra = &soe[0];
myargs[0].operation = scan_op_no_check; myargs[0].operation = scan_op_no_check;
// make the forward slow scanner // make the forward slow scanner
myargs[1].fast = FALSE; soe[1].fast = FALSE;
myargs[1].fwd = TRUE; soe[1].fwd = TRUE;
soe[1].prefetch = FALSE;
myargs[1].operation_extra = &soe[1];
myargs[1].operation = scan_op_no_check; myargs[1].operation = scan_op_no_check;
// make the backward fast scanner // make the backward fast scanner
myargs[2].fast = TRUE; soe[2].fast = TRUE;
myargs[2].fwd = FALSE; soe[2].fwd = FALSE;
soe[2].prefetch = FALSE;
myargs[2].operation_extra = &soe[2];
myargs[2].operation = scan_op_no_check; myargs[2].operation = scan_op_no_check;
// make the backward slow scanner // make the backward slow scanner
myargs[3].fast = FALSE; soe[3].fast = FALSE;
myargs[3].fwd = FALSE; soe[3].fwd = FALSE;
soe[3].prefetch = FALSE;
myargs[3].operation_extra = &soe[3];
myargs[3].operation = scan_op_no_check; myargs[3].operation = scan_op_no_check;
struct update_op_args uoe[cli_args->num_update_threads];
// make the guy that updates the db // make the guy that updates the db
for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) { for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) {
myargs[i].update_history_buffer = toku_xmalloc(n * (sizeof myargs[i].update_history_buffer[0])); int* update_history_buffer = toku_xmalloc(n * (sizeof uoe[i-4].update_history_buffer[0]));
memset(myargs[i].update_history_buffer, 0, n * (sizeof myargs[i].update_history_buffer[0])); uoe[i-4] = get_update_op_args(cli_args,update_history_buffer);
memset(uoe[i-4].update_history_buffer, 0, n * (sizeof uoe[i-4].update_history_buffer[0]));
myargs[i].operation = update_with_history_op; myargs[i].operation = update_with_history_op;
} }
...@@ -80,16 +92,16 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -80,16 +92,16 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
myargs[i].operation = ptquery_op; myargs[i].operation = ptquery_op;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) { for (int i = 0; i < cli_args->num_update_threads; ++i) {
toku_free(myargs[i].update_history_buffer); toku_free(uoe[i].update_history_buffer);
} }
} }
int int
test_main(int argc, char *const argv[]) { test_main(int argc, char *const argv[]) {
struct cli_args args = DEFAULT_ARGS; struct cli_args args = get_default_args();
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
stress_test_main(&args); stress_test_main(&args);
return 0; return 0;
......
...@@ -29,21 +29,30 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -29,21 +29,30 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], n, dbp, env, cli_args);
} }
struct scan_op_extra soe[2];
// make the forward fast scanner // make the forward fast scanner
myargs[0].fast = TRUE; soe[0].fast = TRUE;
myargs[0].fwd = TRUE; soe[0].fwd = TRUE;
soe[0].prefetch = FALSE;
myargs[0].operation_extra = &soe[0];
myargs[0].operation = scan_op; myargs[0].operation = scan_op;
// make the backward slow scanner // make the forward slow scanner
myargs[1].fast = FALSE; soe[1].fast = FALSE;
myargs[1].fwd = FALSE; soe[1].fwd = TRUE;
soe[1].prefetch = FALSE;
myargs[1].operation_extra = &soe[1];
myargs[1].operation = scan_op; myargs[1].operation = scan_op;
// make the guy that updates the db // make the guy that updates the db
myargs[2].operation = loader_op; myargs[2].operation = loader_op;
myargs[3].operation = keyrange_op; myargs[3].operation = keyrange_op;
struct update_op_args uoe = get_update_op_args(cli_args, NULL);
// make the guy that updates the db
for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) { for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) {
myargs[i].operation_extra = &uoe;
myargs[i].operation = update_op; myargs[i].operation = update_op;
} }
...@@ -51,14 +60,14 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -51,14 +60,14 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
for (int i = 4 + cli_args->num_update_threads; i < num_threads; i++) { for (int i = 4 + cli_args->num_update_threads; i < num_threads; i++) {
myargs[i].operation = ptquery_op; myargs[i].operation = ptquery_op;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
} }
int int
test_main(int argc, char *const argv[]) { test_main(int argc, char *const argv[]) {
struct cli_args args = DEFAULT_ARGS; struct cli_args args = get_default_args();
// let's make default checkpointing period really slow // let's make default checkpointing period really slow
args.checkpointing_period = 1; args.env_args.checkpointing_period = 1;
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
stress_test_main(&args); stress_test_main(&args);
return 0; return 0;
......
...@@ -50,28 +50,38 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -50,28 +50,38 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], n, dbp, env, cli_args);
} }
struct scan_op_extra soe[4];
// make the forward fast scanner // make the forward fast scanner
myargs[0].fast = TRUE; soe[0].fast = TRUE;
myargs[0].fwd = TRUE; soe[0].fwd = TRUE;
soe[0].prefetch = FALSE;
myargs[0].lock_type = STRESS_LOCK_SHARED; myargs[0].lock_type = STRESS_LOCK_SHARED;
myargs[0].operation_extra = &soe[0];
myargs[0].operation = scan_op; myargs[0].operation = scan_op;
// make the forward slow scanner // make the forward slow scanner
myargs[1].fast = FALSE; soe[1].fast = FALSE;
myargs[1].fwd = TRUE; soe[1].fwd = TRUE;
soe[1].prefetch = FALSE;
myargs[1].lock_type = STRESS_LOCK_SHARED; myargs[1].lock_type = STRESS_LOCK_SHARED;
myargs[1].operation_extra = &soe[1];
myargs[1].operation = scan_op; myargs[1].operation = scan_op;
// make the backward fast scanner // make the backward fast scanner
myargs[2].fast = TRUE; soe[2].fast = TRUE;
myargs[2].fwd = FALSE; soe[2].fwd = FALSE;
soe[2].prefetch = FALSE;
myargs[2].lock_type = STRESS_LOCK_SHARED; myargs[2].lock_type = STRESS_LOCK_SHARED;
myargs[2].operation_extra = &soe[2];
myargs[2].operation = scan_op; myargs[2].operation = scan_op;
// make the backward slow scanner // make the backward slow scanner
myargs[3].fast = FALSE; soe[3].fast = FALSE;
myargs[3].fwd = FALSE; soe[3].fwd = FALSE;
soe[3].prefetch = FALSE;
myargs[3].lock_type = STRESS_LOCK_SHARED; myargs[3].lock_type = STRESS_LOCK_SHARED;
myargs[3].operation_extra = &soe[3];
myargs[3].operation = scan_op; myargs[3].operation = scan_op;
// make the guy that removes and recreates the db // make the guy that removes and recreates the db
...@@ -84,25 +94,27 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -84,25 +94,27 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
myargs[5].operation = truncate_me; myargs[5].operation = truncate_me;
// make the guy that updates the db // make the guy that updates the db
struct update_op_args uoe = get_update_op_args(cli_args, NULL);
for (int i = 6; i < 6 + cli_args->num_update_threads; ++i) { for (int i = 6; i < 6 + cli_args->num_update_threads; ++i) {
myargs[i].bounded_update_range = false; myargs[i].bounded_element_range = false;
myargs[i].lock_type = STRESS_LOCK_SHARED; myargs[i].lock_type = STRESS_LOCK_SHARED;
myargs[i].operation_extra = &uoe;
myargs[i].operation = update_op; myargs[i].operation = update_op;
} }
// make the guy that does point queries // make the guy that does point queries
for (int i = 6 + cli_args->num_update_threads; i < num_threads; i++) { for (int i = 6 + cli_args->num_update_threads; i < num_threads; i++) {
myargs[i].lock_type = STRESS_LOCK_SHARED; myargs[i].lock_type = STRESS_LOCK_SHARED;
myargs[i].bounded_update_range = false; myargs[i].bounded_element_range = false;
myargs[i].operation = ptquery_op_no_check; myargs[i].operation = ptquery_op_no_check;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
} }
int int
test_main(int argc, char *const argv[]) { test_main(int argc, char *const argv[]) {
struct cli_args args = DEFAULT_ARGS; struct cli_args args = get_default_args();
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
stress_test_main(&args); stress_test_main(&args);
return 0; return 0;
......
...@@ -29,21 +29,30 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -29,21 +29,30 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], n, dbp, env, cli_args);
} }
struct scan_op_extra soe[2];
// make the forward fast scanner // make the forward fast scanner
myargs[0].fast = TRUE; soe[0].fast = TRUE;
myargs[0].fwd = TRUE; soe[0].fwd = TRUE;
soe[0].prefetch = FALSE;
myargs[0].operation_extra = &soe[0];
myargs[0].operation = scan_op; myargs[0].operation = scan_op;
// make the backward slow scanner // make the forward slow scanner
myargs[1].fast = FALSE; soe[1].fast = FALSE;
myargs[1].fwd = FALSE; soe[1].fwd = TRUE;
soe[1].prefetch = FALSE;
myargs[1].operation_extra = &soe[1];
myargs[1].operation = scan_op; myargs[1].operation = scan_op;
// make the guy that runs HOT in the background // make the guy that runs HOT in the background
myargs[2].operation = hot_op; myargs[2].operation = hot_op;
myargs[3].operation = keyrange_op; myargs[3].operation = keyrange_op;
struct update_op_args uoe = get_update_op_args(cli_args, NULL);
// make the guy that updates the db
for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) { for (int i = 4; i < 4 + cli_args->num_update_threads; ++i) {
myargs[i].operation_extra = &uoe;
myargs[i].operation = update_op; myargs[i].operation = update_op;
} }
...@@ -51,14 +60,14 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -51,14 +60,14 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
for (int i = 4 + cli_args->num_update_threads; i < num_threads; i++) { for (int i = 4 + cli_args->num_update_threads; i < num_threads; i++) {
myargs[i].operation = ptquery_op; myargs[i].operation = ptquery_op;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
} }
int int
test_main(int argc, char *const argv[]) { test_main(int argc, char *const argv[]) {
struct cli_args args = DEFAULT_ARGS; struct cli_args args = get_default_args();
// let's make default checkpointing period really slow // let's make default checkpointing period really slow
args.checkpointing_period = 1; args.env_args.checkpointing_period = 1;
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
stress_test_main(&args); stress_test_main(&args);
return 0; return 0;
......
...@@ -36,8 +36,11 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -36,8 +36,11 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], n, dbp, env, cli_args);
} }
// make the forward fast scanner // make the forward fast scanner
myargs[0].fast = TRUE; struct scan_op_extra soe;
myargs[0].fwd = TRUE; soe.fast = TRUE;
soe.fwd = TRUE;
soe.prefetch = FALSE;
myargs[0].operation_extra = &soe;
myargs[0].lock_type = STRESS_LOCK_SHARED; myargs[0].lock_type = STRESS_LOCK_SHARED;
myargs[0].operation = scan_op; myargs[0].operation = scan_op;
...@@ -52,18 +55,20 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -52,18 +55,20 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
} }
// make the guy that does point queries // make the guy that does point queries
struct update_op_args uoe = get_update_op_args(cli_args, NULL);
for (int i = 2 + cli_args->num_update_threads; i < num_threads; i++) { for (int i = 2 + cli_args->num_update_threads; i < num_threads; i++) {
myargs[i].lock_type = STRESS_LOCK_SHARED; myargs[i].lock_type = STRESS_LOCK_SHARED;
myargs[i].operation_extra = &uoe;
myargs[i].operation = ptquery_op; myargs[i].operation = ptquery_op;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
} }
int int
test_main(int argc, char *const argv[]) { test_main(int argc, char *const argv[]) {
struct cli_args args = DEFAULT_ARGS; struct cli_args args = get_default_args();
// let's make default checkpointing period really slow // let's make default checkpointing period really slow
args.checkpointing_period = 1; args.env_args.checkpointing_period = 1;
args.num_elements= 2000; // make default of small num elements to args.num_elements= 2000; // make default of small num elements to
args.num_ptquery_threads = 0; args.num_ptquery_threads = 0;
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
......
This diff is collapsed.
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