From 68cc429be27a124a3704ae16bd53a773d47a161b Mon Sep 17 00:00:00 2001 From: Yu Zhang Date: Mon, 22 May 2023 15:47:28 -0700 Subject: [PATCH] Fix stress test failure caused by #11424 (#11470) Summary: The `ryw_expected_values` check only applies to when transaction is used. Pull Request resolved: https://github.com/facebook/rocksdb/pull/11470 Reviewed By: hx235 Differential Revision: D46085614 Pulled By: jowlyzhang fbshipit-source-id: 4757896c3a62975641adcf97db077a04a0f33030 --- db_stress_tool/no_batched_ops_stress.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/db_stress_tool/no_batched_ops_stress.cc b/db_stress_tool/no_batched_ops_stress.cc index 2b2e62489..de03e9795 100644 --- a/db_stress_tool/no_batched_ops_stress.cc +++ b/db_stress_tool/no_batched_ops_stress.cc @@ -847,10 +847,17 @@ class NonBatchedOpsStressTest : public StressTest { size_t num_of_keys = keys.size(); assert(values.size() == num_of_keys); assert(statuses.size() == num_of_keys); - assert(ryw_expected_values.size() == num_of_keys); for (size_t i = 0; i < num_of_keys; ++i) { - if (!check_multiget(keys[i], values[i], statuses[i], - ryw_expected_values[i])) { + bool check_result = true; + if (use_txn) { + assert(ryw_expected_values.size() == num_of_keys); + check_result = check_multiget(keys[i], values[i], statuses[i], + ryw_expected_values[i]); + } else { + check_result = check_multiget(keys[i], values[i], statuses[i], + std::nullopt /* ryw_expected_value */); + } + if (!check_result) { break; } }