]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Fix fragile CacheTest::ApplyToAllEntriesDuringResize (#10145)
authorPeter Dillinger <peterd@fb.com>
Fri, 10 Jun 2022 02:43:19 +0000 (19:43 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 10 Jun 2022 02:43:19 +0000 (19:43 -0700)
commit5fa6ef7f1897b73732190c69f3ca4d3dc1795b25
tree8554ac1b46dc9ddb50936889e623bcd688454ffa
parent1a3e23a25179c4d7b5921c14e8e4c6eca4df0c76
Fix fragile CacheTest::ApplyToAllEntriesDuringResize (#10145)

Summary:
As seen in https://github.com/facebook/rocksdb/issues/10137, simply churning the cache key hashes (e.g.
by changing the raw cache keys) could trigger failure in this test, due
to possibility of some cache shard exceeding its portion of capacity
and evicting entries. Updated the test to be less fragile by using
greater margins, and added a pre-check for evictions, which doesn't
manifest as a race condition, before the main check that can race.

Also added stack trace handler to cache_test for debugging.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10145

Test Plan:
test thousands of iterations with gtest-parallel, including
with changes in https://github.com/facebook/rocksdb/issues/10137 that were surfacing the problem. Pre-check
without the fix would always fail with https://github.com/facebook/rocksdb/issues/10137

Reviewed By: guidotag

Differential Revision: D37058771

Pulled By: pdillinger

fbshipit-source-id: a7cf137967aef49c07ae9602d8523c63e7388fab
cache/cache_test.cc