Add some asserts in ~CacheWithSecondaryAdapter (#12082)

Summary:
Add some asserts in the `CacheWithSecondaryAdapter` destructor to help debug a crash test failure.

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

Reviewed By: cbi42

Differential Revision: D51486041

Pulled By: anand1976

fbshipit-source-id: 76537beed31ba27ab9ac8b4ce6deb775629e3be5
This commit is contained in:
anand76 2023-11-20 17:48:17 -08:00 committed by Facebook GitHub Bot
parent fb5c8c7ea3
commit 336a74db60
1 changed files with 2 additions and 0 deletions

View File

@ -119,6 +119,8 @@ CacheWithSecondaryAdapter::~CacheWithSecondaryAdapter() {
size_t sec_capacity = 0;
Status s = secondary_cache_->GetCapacity(sec_capacity);
assert(s.ok());
assert(placeholder_usage_ == 0);
assert(reserved_usage_ == 0);
assert(pri_cache_res_->GetTotalMemoryUsed() == sec_capacity);
}
#endif // NDEBUG