Commit f3f1b829 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4064], add prefetching to bulk fetch test, also add another test to BDB_DONTRUN

git-svn-id: file:///svn/toku/tokudb@37598 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2e6777cf
...@@ -167,6 +167,7 @@ BDB_DONTRUN_TESTS = \ ...@@ -167,6 +167,7 @@ BDB_DONTRUN_TESTS = \
preload-db-nested \ preload-db-nested \
progress \ progress \
put-multiple \ put-multiple \
queries_with_deletes \
recover-2483 \ recover-2483 \
recover-3113 \ recover-3113 \
recover-compare-db \ recover-compare-db \
......
...@@ -55,7 +55,7 @@ verify_bwd_slow(DBT const *a, DBT const *b, void *c) { ...@@ -55,7 +55,7 @@ verify_bwd_slow(DBT const *a, DBT const *b, void *c) {
static void static void
test_bulk_fetch (int n) { test_bulk_fetch (int n, BOOL prelock) {
if (verbose) printf("test_rand_insert:%d \n", n); if (verbose) printf("test_rand_insert:%d \n", n);
DB_TXN * const null_txn = 0; DB_TXN * const null_txn = 0;
...@@ -102,6 +102,14 @@ test_bulk_fetch (int n) { ...@@ -102,6 +102,14 @@ test_bulk_fetch (int n) {
// verify fast // verify fast
r = db->cursor(db, NULL, &cursor, 0); r = db->cursor(db, NULL, &cursor, 0);
CKERR(r); CKERR(r);
if (prelock) {
r = cursor->c_pre_acquire_range_lock(
cursor,
db->dbt_neg_infty(),
db->dbt_pos_infty()
);
CKERR(r);
}
int expected = 0; int expected = 0;
while (r != DB_NOTFOUND) { while (r != DB_NOTFOUND) {
r = cursor->c_getf_next(cursor, 0, verify_fwd_fast, &expected); r = cursor->c_getf_next(cursor, 0, verify_fwd_fast, &expected);
...@@ -112,6 +120,14 @@ test_bulk_fetch (int n) { ...@@ -112,6 +120,14 @@ test_bulk_fetch (int n) {
// verify slow // verify slow
r = db->cursor(db, NULL, &cursor, 0); r = db->cursor(db, NULL, &cursor, 0);
CKERR(r); CKERR(r);
if (prelock) {
r = cursor->c_pre_acquire_range_lock(
cursor,
db->dbt_neg_infty(),
db->dbt_pos_infty()
);
CKERR(r);
}
expected = 0; expected = 0;
while (r != DB_NOTFOUND) { while (r != DB_NOTFOUND) {
r = cursor->c_getf_next(cursor, 0, verify_fwd_slow, &expected); r = cursor->c_getf_next(cursor, 0, verify_fwd_slow, &expected);
...@@ -122,6 +138,14 @@ test_bulk_fetch (int n) { ...@@ -122,6 +138,14 @@ test_bulk_fetch (int n) {
// now do backwards // now do backwards
r = db->cursor(db, NULL, &cursor, 0); r = db->cursor(db, NULL, &cursor, 0);
CKERR(r); CKERR(r);
if (prelock) {
r = cursor->c_pre_acquire_range_lock(
cursor,
db->dbt_neg_infty(),
db->dbt_pos_infty()
);
CKERR(r);
}
expected = n-1; expected = n-1;
while (r != DB_NOTFOUND) { while (r != DB_NOTFOUND) {
r = cursor->c_getf_prev(cursor, 0, verify_bwd_fast, &expected); r = cursor->c_getf_prev(cursor, 0, verify_bwd_fast, &expected);
...@@ -132,6 +156,14 @@ test_bulk_fetch (int n) { ...@@ -132,6 +156,14 @@ test_bulk_fetch (int n) {
// verify slow // verify slow
r = db->cursor(db, NULL, &cursor, 0); r = db->cursor(db, NULL, &cursor, 0);
CKERR(r); CKERR(r);
if (prelock) {
r = cursor->c_pre_acquire_range_lock(
cursor,
db->dbt_neg_infty(),
db->dbt_pos_infty()
);
CKERR(r);
}
expected = n-1; expected = n-1;
while (r != DB_NOTFOUND) { while (r != DB_NOTFOUND) {
r = cursor->c_getf_prev(cursor, 0, verify_bwd_slow, &expected); r = cursor->c_getf_prev(cursor, 0, verify_bwd_slow, &expected);
...@@ -147,7 +179,7 @@ test_bulk_fetch (int n) { ...@@ -147,7 +179,7 @@ test_bulk_fetch (int n) {
int int
test_main(int argc, char *const argv[]) { test_main(int argc, char *const argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
test_bulk_fetch(10000); test_bulk_fetch(10000, FALSE);
test_bulk_fetch(10000, TRUE);
return 0; return 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