Fix issues found by Clang Analyzer (#4976)

Summary:
Fix issues found by Clang Analyzer.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4976

Differential Revision: D14054211

Pulled By: sagar0

fbshipit-source-id: ec2053bae43af3b2ff3425306824c677e3ba70c2
main
Sagar Vemuri 6 years ago committed by Facebook Github Bot
parent c5a64cffd2
commit eafb09a380
  1. 6
      util/transaction_test_util.cc

@ -185,6 +185,7 @@ bool RandomTransactionInserter::DoInsert(DB* db, Transaction* txn,
}
bytes_inserted_ += key.size() + sum.size();
}
if (txn != nullptr) {
ROCKS_LOG_DEBUG(db->GetDBOptions().info_log,
"Insert (%s) %s snap: %" PRIu64 " key:%s value: %" PRIu64
"+%" PRIu64 "=%" PRIu64,
@ -192,6 +193,7 @@ bool RandomTransactionInserter::DoInsert(DB* db, Transaction* txn,
txn->GetSnapshot()->GetSequenceNumber(), full_key.c_str(),
int_value, incr, int_value + incr);
}
}
if (s.ok()) {
if (txn != nullptr) {
@ -252,10 +254,10 @@ bool RandomTransactionInserter::DoInsert(DB* db, Transaction* txn,
}
}
} else {
ROCKS_LOG_DEBUG(db->GetDBOptions().info_log, "Error %s for txn %s",
s.ToString().c_str(), txn->GetName().c_str());
if (txn != nullptr) {
assert(txn->Rollback().ok());
ROCKS_LOG_DEBUG(db->GetDBOptions().info_log, "Error %s for txn %s",
s.ToString().c_str(), txn->GetName().c_str());
}
}

Loading…
Cancel
Save