diff --git a/utilities/persistent_cache/hash_table_evictable.h b/utilities/persistent_cache/hash_table_evictable.h index 44f76f774..da13c0e9d 100644 --- a/utilities/persistent_cache/hash_table_evictable.h +++ b/utilities/persistent_cache/hash_table_evictable.h @@ -76,7 +76,8 @@ class EvictableHashTable : private HashTable { // Evict one of the least recently used object // T* Evict(const std::function& fn = nullptr) { - const size_t start_idx = rand_.Next() % hash_table::nlocks_; + uint32_t random = Random::GetTLSInstance()->Next(); + const size_t start_idx = random % hash_table::nlocks_; T* t = nullptr; // iterate from start_idx .. 0 .. start_idx @@ -157,7 +158,6 @@ class EvictableHashTable : private HashTable { return hash_table::locks_[lock_idx]; } - Random64 rand_{static_cast(time(nullptr))}; std::unique_ptr lru_lists_; }; diff --git a/utilities/persistent_cache/persistent_cache_test.cc b/utilities/persistent_cache/persistent_cache_test.cc index e3bf667df..92978a845 100644 --- a/utilities/persistent_cache/persistent_cache_test.cc +++ b/utilities/persistent_cache/persistent_cache_test.cc @@ -26,7 +26,6 @@ TEST_F(PersistentCacheTierTest, VolatileCacheInsert) { } } -#ifndef ROCKSDB_TSAN_RUN TEST_F(PersistentCacheTierTest, VolatileCacheInsertWithEviction) { for (auto nthreads : {1, 5}) { for (auto max_keys : {1 * 1024 * 1024}) { @@ -36,7 +35,6 @@ TEST_F(PersistentCacheTierTest, VolatileCacheInsertWithEviction) { } } } -#endif // test table with volatile page cache TEST_F(PersistentCacheDBTest, VolatileCacheTest) {