]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Attempt to deflake ObsoleteFilesTest.DeleteObsoleteOptionsFile (#8624)
authorLevi Tamasi <ltamasi@fb.com>
Fri, 6 Aug 2021 01:35:02 +0000 (18:35 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 6 Aug 2021 01:36:16 +0000 (18:36 -0700)
Summary:
We've been seeing occasional crashes on CI while inserting into the
vectors in `ObsoleteFilesTest.DeleteObsoleteOptionsFile`. The crashes
don't reproduce locally (could be either a race or an object lifecycle
issue) but the good news is that the vectors in question are not really
used for anything meaningful by the test. (The assertion about the sizes
of the two vectors being equal is guaranteed to hold, since the two sync
points where they are populated are right after each other.) The patch
simply removes the vectors from the test, alongside the associated
callbacks and sync points.

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

Test Plan: `make check`

Reviewed By: akankshamahajan15

Differential Revision: D30118485

Pulled By: ltamasi

fbshipit-source-id: 0a4c3d06584e84cd2b1dcc212d274fa1b89cb647

db/db_impl/db_impl_files.cc
db/obsolete_files_test.cc

index 1792cefd530f21466ef7934bb8cdc835c267bb67..5b2c429cd80e6f74794c46365ccea08a7d4549be 100644 (file)
@@ -524,12 +524,6 @@ void DBImpl::PurgeObsoleteFiles(JobContext& state, bool schedule_only) {
         break;
       case kOptionsFile:
         keep = (number >= optsfile_num2);
-        TEST_SYNC_POINT_CALLBACK(
-            "DBImpl::PurgeObsoleteFiles:CheckOptionsFiles:1",
-            reinterpret_cast<void*>(&number));
-        TEST_SYNC_POINT_CALLBACK(
-            "DBImpl::PurgeObsoleteFiles:CheckOptionsFiles:2",
-            reinterpret_cast<void*>(&keep));
         break;
       case kCurrentFile:
       case kDBLockFile:
index 3d18196e6c7b0e3302d77189f6486c286f92ffaf..d4348283cbe7220290a8246de88ddc718d39e27c 100644 (file)
@@ -149,18 +149,6 @@ TEST_F(ObsoleteFilesTest, RaceForObsoleteFileDeletion) {
 
 TEST_F(ObsoleteFilesTest, DeleteObsoleteOptionsFile) {
   ReopenDB();
-  SyncPoint::GetInstance()->DisableProcessing();
-  std::vector<uint64_t> optsfiles_nums;
-  std::vector<bool> optsfiles_keep;
-  SyncPoint::GetInstance()->SetCallBack(
-      "DBImpl::PurgeObsoleteFiles:CheckOptionsFiles:1", [&](void* arg) {
-        optsfiles_nums.push_back(*reinterpret_cast<uint64_t*>(arg));
-      });
-  SyncPoint::GetInstance()->SetCallBack(
-      "DBImpl::PurgeObsoleteFiles:CheckOptionsFiles:2", [&](void* arg) {
-        optsfiles_keep.push_back(*reinterpret_cast<bool*>(arg));
-      });
-  SyncPoint::GetInstance()->EnableProcessing();
 
   createLevel0Files(2, 50000);
   CheckFileTypeCounts(wal_dir_, 1, 0, 0);
@@ -176,7 +164,6 @@ TEST_F(ObsoleteFilesTest, DeleteObsoleteOptionsFile) {
     }
   }
   ASSERT_OK(dbfull()->EnableFileDeletions(true /* force */));
-  ASSERT_EQ(optsfiles_nums.size(), optsfiles_keep.size());
 
   Close();