diff --git a/db_stress_tool/no_batched_ops_stress.cc b/db_stress_tool/no_batched_ops_stress.cc index b809902dc..79c868f16 100644 --- a/db_stress_tool/no_batched_ops_stress.cc +++ b/db_stress_tool/no_batched_ops_stress.cc @@ -1224,6 +1224,11 @@ class NonBatchedOpsStressTest : public StressTest { op_logs += "P"; } + if (thread->rand.OneIn(2)) { + // Refresh after forward/backward scan to allow higher chance of SV + // change. It is safe to refresh since the testing key range is locked. + iter->Refresh(); + } // start from middle of [lb, ub) otherwise it is easy to iterate out of // locked range int64_t mid = lb + static_cast(FLAGS_num_iterations / 2);