rocksdb/tools
Natalie Hildebrandt 7edb92b843 Phase 2 of iterator stress test
Summary: Using an iterator instead of the Get method, each thread goes through a portion of the database and verifies values by comparing to the shared state.

Test Plan:
./db_stress --db=/tmp/tmppp --max_key=10000 --ops_per_thread=10000

To test some basic cases, the following lines can be added (each set in turn) to the verifyDb method with the following expected results:

    // Should abort with "Unexpected value found"
    shared.Delete(start);

    // Should abort with "Value not found"
    WriteOptions write_opts;
    db_->Delete(write_opts, Key(start));

    // Should succeed
    WriteOptions write_opts;
    shared.Delete(start);
     db_->Delete(write_opts, Key(start));

    // Should abort with "Value not found"
    WriteOptions write_opts;
    db_->Delete(write_opts, Key(start + (end-start)/2));

    // Should abort with "Value not found"
    db_->Delete(write_opts, Key(end-1));

    // Should abort with "Unexpected value"
    shared.Delete(end-1);

    // Should abort with "Unexpected value"
    shared.Delete(start + (end-start)/2);

    // Should abort with "Value not found"
    db_->Delete(write_opts, Key(start));
    shared.Delete(start);
    db_->Delete(write_opts, Key(end-1));
    db_->Delete(write_opts, Key(end-2));

To test the out of range abort, change the key in the for loop to Key(i+1), so that the key defined by the index i is now outside of the supposed range of the database.

Reviewers: emayanke

Reviewed By: emayanke

CC: dhruba, xjin

Differential Revision: https://reviews.facebook.net/D13071
2013-09-30 16:48:00 -07:00
..
shell Titile: a command line shell to read/write data from a leveldb thrift server 2012-08-23 09:41:05 -07:00
db_crashtest2.py Fixing crashing tests to include iterpercent param 2013-09-20 16:27:22 -07:00
db_crashtest.py Fixing crashing tests to include iterpercent param 2013-09-20 16:27:22 -07:00
db_repl_stress.cc Replace include/leveldb with include/rocksdb. 2013-08-23 10:51:00 -07:00
db_stress.cc Phase 2 of iterator stress test 2013-09-30 16:48:00 -07:00
ldb_test.py Enhance the ldb tool to support ttl databases 2013-05-15 12:10:00 -07:00
ldb.cc Replace include/leveldb with include/rocksdb. 2013-08-23 10:51:00 -07:00
reduce_levels_test.cc Replace include/leveldb with include/rocksdb. 2013-08-23 10:51:00 -07:00
sst_dump.cc Replace include/leveldb with include/rocksdb. 2013-08-23 10:51:00 -07:00