diff --git a/cachelib/cachebench/cache/Cache-inl.h b/cachelib/cachebench/cache/Cache-inl.h index d27a0d5e77..ce1bba0034 100644 --- a/cachelib/cachebench/cache/Cache-inl.h +++ b/cachelib/cachebench/cache/Cache-inl.h @@ -460,14 +460,17 @@ typename Cache::ItemHandle Cache::find(Key key, // find from cache and wait for the result to be ready. auto it = cache_->find(key, mode); it.wait(); + + if (valueValidatingEnabled()) { + XDCHECK(!consistencyCheckEnabled()); + validateValue(it); + } + return it; }; if (!consistencyCheckEnabled()) { auto it = findFn(); - if (valueValidatingEnabled()) { - validateValue(it); - } return it; }