From 1da1f04231fbe3678178f6dbf5bcfbd7c6a00910 Mon Sep 17 00:00:00 2001 From: sdong Date: Thu, 7 Nov 2019 11:13:36 -0800 Subject: [PATCH] Stress test to relax the iterator verification case for lower bound (#5869) Summary: In stress test, all iterator verification is turned off is lower bound is enabled. This might be stricter than needed. This PR relaxes the condition and include the case where lower bound is lower than both of seek key and upper bound. It seems to work mostly fine when I run crash test locally. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5869 Test Plan: Run crash_test Differential Revision: D18363578 fbshipit-source-id: 23d57e11ea507949b8100f4190ddfbe8db052d5a --- tools/db_stress_tool.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/db_stress_tool.cc b/tools/db_stress_tool.cc index 1444b1460..1dcd64ea1 100644 --- a/tools/db_stress_tool.cc +++ b/tools/db_stress_tool.cc @@ -2531,9 +2531,13 @@ class StressTest { return; } - if (ro.iterate_lower_bound != nullptr) { - // Lower bound would create a lot of discrepency for now so disabling - // the verification for now. + if (ro.iterate_lower_bound != nullptr && + (options_.comparator->Compare(*ro.iterate_lower_bound, seek_key) >= 0 || + (ro.iterate_upper_bound != nullptr && + options_.comparator->Compare(*ro.iterate_lower_bound, + *ro.iterate_upper_bound) >= 0))) { + // Lower bound behavior is not well defined if it is larger than + // seek key or upper bound. Disable the check for now. *diverged = true; return; }