Fix a bug in crash_test_with_txn (#6860)

Summary:
In NoBatchedOpsStress::TestMultiGet, call txn->Get() when transactions
are in use.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6860

Test Plan: make crash_test_with_txn

Reviewed By: pdillinger

Differential Revision: D21667249

Pulled By: anand1976

fbshipit-source-id: 194bd7b9630a8efc3ae29d85422a61214e9e200e
This commit is contained in:
anand76 2020-05-20 14:45:03 -07:00 committed by Facebook GitHub Bot
parent 545e14b53b
commit eb04bb86c6

View file

@ -363,7 +363,13 @@ class NonBatchedOpsStressTest : public StressTest {
Status tmp_s;
std::string value;
tmp_s = db_->Get(readoptionscopy, cfh, keys[i], &value);
if (use_txn) {
#ifndef ROCKSDB_LITE
tmp_s = txn->Get(readoptionscopy, cfh, keys[i], &value);
#endif // ROCKSDB_LITE
} else {
tmp_s = db_->Get(readoptionscopy, cfh, keys[i], &value);
}
if (!tmp_s.ok() && !tmp_s.IsNotFound()) {
fprintf(stderr, "Get error: %s\n", s.ToString().c_str());
is_consistent = false;