Commit 943a0af0 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5697 revert r50177 (we actually do want stress tests to quit hot indexes early)

git-svn-id: file:///svn/toku/tokudb@50533 c7de825b-a66e-492c-adef-691d508d4ae1
parent d1831347
...@@ -132,6 +132,10 @@ static int hi_inserts(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra), void ...@@ -132,6 +132,10 @@ static int hi_inserts(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra), void
return r; return r;
} }
static int indexer_maybe_quit_poll(void *UU(poll_extra), float UU(progress)) {
return run_test ? 0 : TOKUDB_CANCELED;
}
static int hi_create_index(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra), void* UU(stats_extra)) { static int hi_create_index(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra), void* UU(stats_extra)) {
int r; int r;
DB_TXN* hi_txn = NULL; DB_TXN* hi_txn = NULL;
...@@ -167,9 +171,12 @@ static int hi_create_index(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra), ...@@ -167,9 +171,12 @@ static int hi_create_index(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra),
); );
CKERR(r); CKERR(r);
toku_mutex_unlock(&hi_lock); toku_mutex_unlock(&hi_lock);
r = indexer->set_poll_function(indexer, indexer_maybe_quit_poll, nullptr);
CKERR(r);
r = indexer->build(indexer); r = indexer->build(indexer);
CKERR(r); CKERR2s(r, 0, TOKUDB_CANCELED);
toku_mutex_lock(&hi_lock); toku_mutex_lock(&hi_lock);
r = indexer->close(indexer); r = indexer->close(indexer);
...@@ -195,7 +202,12 @@ static int hi_create_index(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra), ...@@ -195,7 +202,12 @@ static int hi_create_index(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra),
memset(&val1, 0, sizeof val1); memset(&val1, 0, sizeof val1);
memset(&key2, 0, sizeof key2); memset(&key2, 0, sizeof key2);
memset(&val2, 0, sizeof val2); memset(&val2, 0, sizeof val2);
uint64_t count = 0;
while(r != DB_NOTFOUND) { while(r != DB_NOTFOUND) {
if (count++ % 256 == 0 && !run_test) {
r = TOKUDB_CANCELED;
break;
}
// get next from both cursors and assert they are equal // get next from both cursors and assert they are equal
int r1 = main_cursor->c_get( int r1 = main_cursor->c_get(
main_cursor, main_cursor,
...@@ -218,7 +230,7 @@ static int hi_create_index(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra), ...@@ -218,7 +230,7 @@ static int hi_create_index(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra),
assert(memcmp(val1.data, val2.data, val1.size) == 0); assert(memcmp(val1.data, val2.data, val1.size) == 0);
} }
} }
CKERR2(r, DB_NOTFOUND); CKERR2s(r, DB_NOTFOUND, TOKUDB_CANCELED);
r = main_cursor->c_close(main_cursor); r = main_cursor->c_close(main_cursor);
r = hi_cursor->c_close(hi_cursor); r = hi_cursor->c_close(hi_cursor);
CKERR(r); CKERR(r);
......
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