From eb04bb86c6e713230ab07ee7ab919feeb9f891e0 Mon Sep 17 00:00:00 2001 From: anand76 Date: Wed, 20 May 2020 14:45:03 -0700 Subject: [PATCH] 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 --- db_stress_tool/no_batched_ops_stress.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/db_stress_tool/no_batched_ops_stress.cc b/db_stress_tool/no_batched_ops_stress.cc index 9176747f13..940177fa28 100644 --- a/db_stress_tool/no_batched_ops_stress.cc +++ b/db_stress_tool/no_batched_ops_stress.cc @@ -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;