Commit 92ea918d authored by John Esmet's avatar John Esmet Committed by Yoni Fogel

refs #5702 fix a case where we might query nothing because there are no put threads


git-svn-id: file:///svn/toku/tokudb@52639 c7de825b-a66e-492c-adef-691d508d4ae1
parent 386c8afe
...@@ -313,8 +313,12 @@ static int iibench_rangequery_op(DB_TXN *txn, ARG arg, void *operation_extra, vo ...@@ -313,8 +313,12 @@ static int iibench_rangequery_op(DB_TXN *txn, ARG arg, void *operation_extra, vo
struct iibench_put_op_extra *CAST_FROM_VOIDP(info, operation_extra); struct iibench_put_op_extra *CAST_FROM_VOIDP(info, operation_extra);
DB *db = arg->dbp[0]; DB *db = arg->dbp[0];
// Do a sync fetch and add of 0 to silence race detection tools // Assume the max PK is the table size. If it isn't specified, do a
uint64_t max_pk = toku_sync_fetch_and_add(&info->autoincrement, 0); // safe read of the current autoincrement key from the put thread.
uint64_t max_pk = arg->cli->num_elements;
if (max_pk == 0) {
max_pk = toku_sync_fetch_and_add(&info->autoincrement, 0);
}
iibench_rangequery_db(db, txn, arg, max_pk); iibench_rangequery_db(db, txn, arg, max_pk);
increment_counter(stats_extra, PTQUERIES, 1); increment_counter(stats_extra, PTQUERIES, 1);
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