Skip to content

Attempt to deflake DBLogicalBlockSizeCacheTest.CreateColumnFamilies - #9516

Closed
hx235 wants to merge 4 commits into
meta:mainfrom
hx235:deflake-cf-creation-logical-block-size-cache-test
Closed

hx235 wants to merge 4 commits into
meta:mainfrom
hx235:deflake-cf-creation-logical-block-size-cache-test

Conversation

@hx235

@hx235 hx235 commented Feb 7, 2022 •

Copy link
Copy Markdown
Contributor

Context:
DBLogicalBlockSizeCacheTest.CreateColumnFamilies is flaky on a rare occurrence of assertion failure below

db/db_logical_block_size_cache_test.cc:210
Expected equality of these values:
  1
  cache_->GetRefCount(cf_path_0_)
    Which is: 2

Root-cause: ASSERT_OK(db->DestroyColumnFamilyHandle(cfs[0])); in the test may not successfully decrease the ref count of cf_path_0_ since the decreasing only happens in the clean-up of ColumnFamilyData when ColumnFamilyData has no referencing to it, which may not be true when db->DestroyColumnFamilyHandle(cfs[0]) is called since background work such as DumpStats() can hold reference to that ColumnFamilyData (suggested and repro-d by @ajkr ). Similar case ASSERT_OK(db->DestroyColumnFamilyHandle(cfs[1]));.

See following for a deterministic repro:

diff --git a/db/db_impl/db_impl.cc b/db/db_impl/db_impl.cc
index 196b428a3..4e7a834c4 100644
--- a/db/db_impl/db_impl.cc
+++ b/db/db_impl/db_impl.cc
@@ -956,10 +956,16 @@ void DBImpl::DumpStats() {
         // near-atomically.
         // Get a ref before unlocking
         cfd->Ref();
+        if (cfd->GetName() == "cf1" || cfd->GetName() == "cf2") {
+          TEST_SYNC_POINT("DBImpl::DumpStats:PostCFDRef");
+        }
         {
           InstrumentedMutexUnlock u(&mutex_);
           cfd->internal_stats()->CollectCacheEntryStats(/*foreground=*/false);
         }
+        if (cfd->GetName() == "cf1" || cfd->GetName() == "cf2") {
+          TEST_SYNC_POINT("DBImpl::DumpStats::PreCFDUnrefAndTryDelete");
+        }
         cfd->UnrefAndTryDelete();
       }
     }
diff --git a/db/db_logical_block_size_cache_test.cc b/db/db_logical_block_size_cache_test.cc
index 1057871c9..c3872c036 100644
--- a/db/db_logical_block_size_cache_test.cc
+++ b/db/db_logical_block_size_cache_test.cc
@@ -9,6 +9,7 @@
 #include "env/io_posix.h"
 #include "rocksdb/db.h"
 #include "rocksdb/env.h"
+#include "test_util/sync_point.h"
 
 namespace ROCKSDB_NAMESPACE {
 class EnvWithCustomLogicalBlockSizeCache : public EnvWrapper {
@@ -183,6 +184,15 @@ TEST_F(DBLogicalBlockSizeCacheTest, CreateColumnFamilies) {
   ASSERT_EQ(1, cache_->GetRefCount(dbname_));
 
   std::vector<ColumnFamilyHandle*> cfs;
+  ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->EnableProcessing();
+  ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->LoadDependency(
+      {{"DBLogicalBlockSizeCacheTest::CreateColumnFamilies::PostSetupTwoCFH",
+        "DBImpl::DumpStats:StartRunning"},
+       {"DBImpl::DumpStats:PostCFDRef",
+        "DBLogicalBlockSizeCacheTest::CreateColumnFamilies::PreDeleteTwoCFH"},
+       {"DBLogicalBlockSizeCacheTest::CreateColumnFamilies::"
+        "PostFinishCheckingRef",
+        "DBImpl::DumpStats::PreCFDUnrefAndTryDelete"}});
   ASSERT_OK(db->CreateColumnFamilies(cf_options, {"cf1", "cf2"}, &cfs));
   ASSERT_EQ(2, cache_->Size());
   ASSERT_TRUE(cache_->Contains(dbname_));
@@ -190,7 +200,7 @@ TEST_F(DBLogicalBlockSizeCacheTest, CreateColumnFamilies) {
   ASSERT_TRUE(cache_->Contains(cf_path_0_));
   ASSERT_EQ(2, cache_->GetRefCount(cf_path_0_));
   }
 
    // Delete one handle will not drop cache because another handle is still
   // referencing cf_path_0_.
+  TEST_SYNC_POINT(
+      "DBLogicalBlockSizeCacheTest::CreateColumnFamilies::PostSetupTwoCFH");
+  TEST_SYNC_POINT(
+      "DBLogicalBlockSizeCacheTest::CreateColumnFamilies::PreDeleteTwoCFH");
   ASSERT_OK(db->DestroyColumnFamilyHandle(cfs[0]));
   ASSERT_EQ(2, cache_->Size());
   ASSERT_TRUE(cache_->Contains(dbname_));
@@ -209,16 +221,20 @@ TEST_F(DBLogicalBlockSizeCacheTest, CreateColumnFamilies) {
   ASSERT_TRUE(cache_->Contains(cf_path_0_));
    // Will fail
   ASSERT_EQ(1, cache_->GetRefCount(cf_path_0_));
 
   // Delete the last handle will drop cache.
   ASSERT_OK(db->DestroyColumnFamilyHandle(cfs[1]));
   ASSERT_EQ(1, cache_->Size()); 
   ASSERT_TRUE(cache_->Contains(dbname_));
   // Will fail
   ASSERT_EQ(1, cache_->GetRefCount(dbname_));
 
+  TEST_SYNC_POINT(
+      "DBLogicalBlockSizeCacheTest::CreateColumnFamilies::"
+      "PostFinishCheckingRef");
   delete db;
   ASSERT_EQ(0, cache_->Size());
   ASSERT_OK(DestroyDB(dbname_, options,
       {{"cf1", cf_options}, {"cf2", cf_options}}));
+  ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing();
 }

Summary

  • Removed the flaky assertion
  • Clarified the comments for the test

Test

  • Run repro above with no assertion failure
  • CI
  • Monitor for future flakiness

@hx235
hx235 requested review from ajkr and jay-zhuang and removed request for ajkr and jay-zhuang February 7, 2022 22:09
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@hx235 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@hx235
hx235 requested a review from jay-zhuang February 7, 2022 23:04

@ajkr ajkr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this doesn't leave us with a more understandable/maintainable test compared to before. Why do we need to disable DumpStats() and loosen some refcount checks? The description sounds like we gave up on repro - did the hypothesis not lead to any progress?

@hx235

hx235 commented Feb 9, 2022 •

Copy link
Copy Markdown
Contributor Author

Sorry this doesn't leave us with a more understandable/maintainable test compared to before. Why do we need to disable DumpStats() and loosen some refcount checks? The description sounds like we gave up on repro - did the hypothesis not lead to any progress?

Replied in the internal

@hx235 hx235 changed the title Attempt to deflake DBLogicalBlockSizeCacheTest.CreateColumnFamilies [Draft] Attempt to deflake DBLogicalBlockSizeCacheTest.CreateColumnFamilies Feb 9, 2022
@hx235
hx235 removed the request for review from jay-zhuang February 9, 2022 01:15
@hx235
hx235 marked this pull request as draft February 9, 2022 01:30
@hx235

hx235 commented Feb 9, 2022

Copy link
Copy Markdown
Contributor Author

Discussed offline that we are going to either loosen the assertion without disabling the dump stat or verifying it's actually the dump stat reference and remove the dump stat. Not both the same time in this PR for clarity in testing.

@hx235
hx235 force-pushed the deflake-cf-creation-logical-block-size-cache-test branch from beb9dbb to cdc5995 Compare February 10, 2022 04:54
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@hx235 has updated the pull request. You must reimport the pull request before landing.

@hx235

hx235 commented Feb 10, 2022 •

Copy link
Copy Markdown
Contributor Author

Update:

  • Reverted changes related to DumpStat()
  • Clarified comment of indeterministic CF ref count
  • Replied internally on keeping the exact refcount assertion on db ref
  • Ready for review after signals are clear

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@hx235 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@hx235 hx235 changed the title [Draft] Attempt to deflake DBLogicalBlockSizeCacheTest.CreateColumnFamilies Attempt to deflake DBLogicalBlockSizeCacheTest.CreateColumnFamilies Feb 10, 2022
@hx235
hx235 force-pushed the deflake-cf-creation-logical-block-size-cache-test branch from cdc5995 to 29b8fd3 Compare February 10, 2022 05:03
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@hx235 has updated the pull request. You must reimport the pull request before landing.

@hx235
hx235 marked this pull request as ready for review February 10, 2022 05:03
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@hx235 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@hx235
hx235 requested a review from ajkr February 10, 2022 05:17
Comment thread db/db_logical_block_size_cache_test.cc Outdated
Comment on lines 191 to 195

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned offline I think these ASSERT_GE(2, ...s can be reverted. Extra references to ColumnFamilyData (e.g., from DumpStats()) do not increase the number of calls to RegisterDbPaths()

@hx235 hx235 Feb 10, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarification, I was trying to assert there are at least two ref, one for each cf handle
Just to make sure I understand, are you suggesting to (a) revert this particular ASSERT_GE(2,..) to exact assertion, OR (b) all the ASSERT_GE(2, ...) to exact assertion OR (c) completely removing ASSERT_GE(2, ...) from all places?

@hx235 hx235 Feb 10, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For (a), are we sure there won't be any extra reference to the cf other than the 2 references from the handles?

  • I am not quite sure about this especially after we see some in the following places without reproducing it.

For (b), we will probably need to keep the ASSERT_GE(2, ...) at least for the place where we've seen the violation.

F(c - current PR), I think at least we need to assert the minimum of the column ref (even though that might be a false positive due to "extra reference" being a lot.

For "(d)", we just do ASSERT_GE(0, ...) for all places other than deletion. But that will prevent us from testing the case for "Delete one handle will not drop CF's entry from cache because another handle is still referencing cf_path_0_."

  • Well.. one could also say even when we try to test it like (c), there might still be false positive.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarification, I was trying to assert there are at least two ref, one for each cf handle

The calls to RegisterDbPaths() and UnregisterDbPaths() are in the ColumnFamilyData constructor/destructor, not ColumnFamilyHandle.

Just to make sure I understand, are you suggesting to (a) revert this particular ASSERT_GE(2,..) to exact assertion, OR (b) all the ASSERT_GE(2, ...) to exact assertion OR (c) completely removing ASSERT_GE(2, ...)?

(b)

@ajkr ajkr Feb 10, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarification, I was trying to assert there are at least two ref, one for each cf handle

The calls to RegisterDbPaths() and UnregisterDbPaths() are in the ColumnFamilyData constructor/destructor, not ColumnFamilyHandle.

To clarify further, I realize you did not say that ColumnFamilyHandle references/unreferences the cache entry. I just have no idea how there could ever be more than two references here or the other place that says ASSERT_GE(2, ....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(loosening assertions because there might be something we haven't thought of).

Well that's just my thought I'd like to share so that I can clearly get to where we disagree. I also wouldn't mind reverting those ASSERT_GE() to be honest. All I said above was just trying to make my point of view clear and again get to where we disagree, not necessarily asking for agreement :) Will update the PR.

I also welcome any efforts into reproducing it as this deserves more time than I have spent on it so far.

@ajkr ajkr Feb 11, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: I guess the underlying understanding I have from the test being flaky is that there can be extra refcount to cf_path_0 other than the ones from cf handles in the creation. I don't know what those ref count are/when they start to appear. Me not knowing it might be a result of not investigating the code enough (e.g, pinning down exactly where in the code places can ref cf_path_0)

The only code path I can find that references cf_path_0 is ColumnFamilyData constructor -> RegisterDbPaths() -> RefAndCacheLogicalBlockSize(). I believe only the two ColumnFamilyDatas (the one for "cf1" and the one for "cf2") register cf_path_0. So I do not see where more than two cf_path_0 references could ever come from, and IMO there needs to be a plausible explanation if we're going to embed that expectation in the test.

On the other hand, ColumnFamilyData could be referenced in more places, like for background work. Extra references to ColumnFamilyData extend its lifetime beyond when it is dropped and the user's CF handle is released. The effect is just it takes longer than the test expects to release a reference to cf_path_0 via ColumnFamilyData destructor -> UnregisterDbPaths() -> UnrefAndTryRemoveCachedLogicalBlockSize().

@ajkr ajkr Feb 11, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also welcome any efforts into reproducing it as this deserves more time than I have spent on it so far.

I think we should still reconsider who should be the PR author as it is taking more of my time to review than it deserves. We shouldn't be doing reviewer-driven development. It is quite inefficient and took many rounds of back and forth for me to even realize that the ASSERT_GE(2, ... changes were based on not investigating it yet.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's how to repro the timing conditions in any case:

diff --git a/db/db_impl/db_impl.cc b/db/db_impl/db_impl.cc
index fd4d8a0c9..2aea4d6e9 100644
--- a/db/db_impl/db_impl.cc
+++ b/db/db_impl/db_impl.cc
@@ -949,6 +949,7 @@ void DBImpl::DumpStats() {

   TEST_SYNC_POINT("DBImpl::DumpStats:StartRunning");
   {
+    usleep(100000);
     InstrumentedMutexLock l(&mutex_);
     for (auto cfd : *versions_->GetColumnFamilySet()) {
       if (cfd->initialized()) {
@@ -959,6 +960,9 @@ void DBImpl::DumpStats() {
         cfd->Ref();
         {
           InstrumentedMutexUnlock u(&mutex_);
+          if (cfd->GetName() == "cf1") {
+            sleep(3);
+          }
           cfd->internal_stats()->CollectCacheEntryStats(/*foreground=*/false);
         }
         cfd->UnrefAndTryDelete();
diff --git a/db/db_logical_block_size_cache_test.cc b/db/db_logical_block_size_cache_test.cc
index 1057871c9..728e14541 100644
--- a/db/db_logical_block_size_cache_test.cc
+++ b/db/db_logical_block_size_cache_test.cc
@@ -202,6 +202,7 @@ TEST_F(DBLogicalBlockSizeCacheTest, CreateColumnFamilies) {

   // Delete one handle will not drop cache because another handle is still
   // referencing cf_path_0_.
+  usleep(150000);
   ASSERT_OK(db->DestroyColumnFamilyHandle(cfs[0]));
   ASSERT_EQ(2, cache_->Size());
   ASSERT_TRUE(cache_->Contains(dbname_));

Failure I get is

$ ./db_logical_block_size_cache_test --gtest_filter=DBLogicalBlockSizeCacheTest.CreateColumnFamilies
Note: Google Test filter = DBLogicalBlockSizeCacheTest.CreateColumnFamilies
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from DBLogicalBlockSizeCacheTest
[ RUN      ] DBLogicalBlockSizeCacheTest.CreateColumnFamilies
db/db_logical_block_size_cache_test.cc:211: Failure
Expected equality of these values:
  1
  cache_->GetRefCount(cf_path_0_)
    Which is: 2
[  FAILED  ] DBLogicalBlockSizeCacheTest.CreateColumnFamilies (334 ms)
[----------] 1 test from DBLogicalBlockSizeCacheTest (334 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (334 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] DBLogicalBlockSizeCacheTest.CreateColumnFamilies

 1 FAILED TEST
Segmentation fault (core dumped)

@hx235 hx235 Feb 11, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the repro! For other comments you left, I will reply through internal chat but no pressure in checking it before you return :)

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@hx235 has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@hx235 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@hx235

hx235 commented Feb 10, 2022 •

Copy link
Copy Markdown
Contributor Author

Update:

  • Removed extra assertion loosening and fixed only the place based on the evidence of where the flakiness happened.
  • Ready for review after the signal is clear.

@meta meta deleted a comment from tangrames Feb 11, 2022
@hx235
hx235 force-pushed the deflake-cf-creation-logical-block-size-cache-test branch from 0aff572 to d5d8f30 Compare February 25, 2022 23:18
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@hx235 has updated the pull request. You must reimport the pull request before landing.

@hx235

hx235 commented Feb 25, 2022 •

Copy link
Copy Markdown
Contributor Author

Update:

  • Clarified the testing in comments and removed (instead of loosening) the flaky assertion for readability.
  • Updated PR summary

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@hx235 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@hx235
hx235 requested a review from ajkr February 25, 2022 23:19

@ajkr ajkr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Tim-Reed pushed a commit to Tim-Reed/rocksdb that referenced this pull request Oct 1, 2026
…eta#9516)

Summary:
**Context:**
`DBLogicalBlockSizeCacheTest.CreateColumnFamilies` is flaky on a rare occurrence of assertion failure below
```
db/db_logical_block_size_cache_test.cc:210
Expected equality of these values:
  1
  cache_->GetRefCount(cf_path_0_)
    Which is: 2
```

Root-cause: `ASSERT_OK(db->DestroyColumnFamilyHandle(cfs[0]));` in the test may not successfully decrease the ref count of `cf_path_0_` since the decreasing only happens in the clean-up of `ColumnFamilyData` when `ColumnFamilyData` has no referencing to it, which may not be true when `db->DestroyColumnFamilyHandle(cfs[0])` is called since background work such as `DumpStats()` can hold reference to that `ColumnFamilyData` (suggested and repro-d by ajkr ). Similar case `ASSERT_OK(db->DestroyColumnFamilyHandle(cfs[1]));`.

See following for a deterministic repro:
```
 diff --git a/db/db_impl/db_impl.cc b/db/db_impl/db_impl.cc
index 196b428..4e7a834c4 100644
 --- a/db/db_impl/db_impl.cc
+++ b/db/db_impl/db_impl.cc
@@ -956,10 +956,16 @@ void DBImpl::DumpStats() {
         // near-atomically.
         // Get a ref before unlocking
         cfd->Ref();
+        if (cfd->GetName() == "cf1" || cfd->GetName() == "cf2") {
+          TEST_SYNC_POINT("DBImpl::DumpStats:PostCFDRef");
+        }
         {
           InstrumentedMutexUnlock u(&mutex_);
           cfd->internal_stats()->CollectCacheEntryStats(/*foreground=*/false);
         }
+        if (cfd->GetName() == "cf1" || cfd->GetName() == "cf2") {
+          TEST_SYNC_POINT("DBImpl::DumpStats::PreCFDUnrefAndTryDelete");
+        }
         cfd->UnrefAndTryDelete();
       }
     }
 diff --git a/db/db_logical_block_size_cache_test.cc b/db/db_logical_block_size_cache_test.cc
index 1057871..c3872c036 100644
 --- a/db/db_logical_block_size_cache_test.cc
+++ b/db/db_logical_block_size_cache_test.cc
@@ -9,6 +9,7 @@
 #include "env/io_posix.h"
 #include "rocksdb/db.h"
 #include "rocksdb/env.h"
+#include "test_util/sync_point.h"

 namespace ROCKSDB_NAMESPACE {
 class EnvWithCustomLogicalBlockSizeCache : public EnvWrapper {
@@ -183,6 +184,15 @@ TEST_F(DBLogicalBlockSizeCacheTest, CreateColumnFamilies) {
   ASSERT_EQ(1, cache_->GetRefCount(dbname_));

   std::vector<ColumnFamilyHandle*> cfs;
+  ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->EnableProcessing();
+  ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->LoadDependency(
+      {{"DBLogicalBlockSizeCacheTest::CreateColumnFamilies::PostSetupTwoCFH",
+        "DBImpl::DumpStats:StartRunning"},
+       {"DBImpl::DumpStats:PostCFDRef",
+        "DBLogicalBlockSizeCacheTest::CreateColumnFamilies::PreDeleteTwoCFH"},
+       {"DBLogicalBlockSizeCacheTest::CreateColumnFamilies::"
+        "PostFinishCheckingRef",
+        "DBImpl::DumpStats::PreCFDUnrefAndTryDelete"}});
   ASSERT_OK(db->CreateColumnFamilies(cf_options, {"cf1", "cf2"}, &cfs));
   ASSERT_EQ(2, cache_->Size());
   ASSERT_TRUE(cache_->Contains(dbname_));
@@ -190,7 +200,7 @@ TEST_F(DBLogicalBlockSizeCacheTest, CreateColumnFamilies) {
   ASSERT_TRUE(cache_->Contains(cf_path_0_));
   ASSERT_EQ(2, cache_->GetRefCount(cf_path_0_));
   }

    // Delete one handle will not drop cache because another handle is still
   // referencing cf_path_0_.
+  TEST_SYNC_POINT(
+      "DBLogicalBlockSizeCacheTest::CreateColumnFamilies::PostSetupTwoCFH");
+  TEST_SYNC_POINT(
+      "DBLogicalBlockSizeCacheTest::CreateColumnFamilies::PreDeleteTwoCFH");
   ASSERT_OK(db->DestroyColumnFamilyHandle(cfs[0]));
   ASSERT_EQ(2, cache_->Size());
   ASSERT_TRUE(cache_->Contains(dbname_));
@@ -209,16 +221,20 @@ TEST_F(DBLogicalBlockSizeCacheTest, CreateColumnFamilies) {
   ASSERT_TRUE(cache_->Contains(cf_path_0_));
    // Will fail
   ASSERT_EQ(1, cache_->GetRefCount(cf_path_0_));

   // Delete the last handle will drop cache.
   ASSERT_OK(db->DestroyColumnFamilyHandle(cfs[1]));
   ASSERT_EQ(1, cache_->Size());
   ASSERT_TRUE(cache_->Contains(dbname_));
   // Will fail
   ASSERT_EQ(1, cache_->GetRefCount(dbname_));

+  TEST_SYNC_POINT(
+      "DBLogicalBlockSizeCacheTest::CreateColumnFamilies::"
+      "PostFinishCheckingRef");
   delete db;
   ASSERT_EQ(0, cache_->Size());
   ASSERT_OK(DestroyDB(dbname_, options,
       {{"cf1", cf_options}, {"cf2", cf_options}}));
+  ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing();
 }
```

**Summary**
- Removed the flaky assertion
- Clarified the comments for the test

Pull Request resolved: meta#9516

Test Plan:
- CI
- Monitor for future flakiness

Reviewed By: ajkr

Differential Revision: D34055232

Pulled By: hx235

fbshipit-source-id: 9bf83ae5fa88bf6fc829876494d4692082e4c357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants