summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/metadata_manager_test.cpp
diff options
context:
space:
mode:
authorNathan Myers <nathan.myers@10gen.com>2017-06-01 17:52:56 -0400
committerNathan Myers <nathan.myers@10gen.com>2017-06-01 17:52:56 -0400
commit3c47c2f2992fb881622195ef5c045f08061e278b (patch)
treef3374723c26e8464f7697000baf4c1b2ae152426 /src/mongo/db/s/metadata_manager_test.cpp
parent6bf062db95d69f06b02da708b54f5e3efbb9dfa5 (diff)
downloadmongo-3c47c2f2992fb881622195ef5c045f08061e278b.tar.gz
Revert "SERVER-29342 CollectionShardState/RangeDeleter support for safe secondary reads"
This reverts commit 6bf062db95d69f06b02da708b54f5e3efbb9dfa5.
Diffstat (limited to 'src/mongo/db/s/metadata_manager_test.cpp')
-rw-r--r--src/mongo/db/s/metadata_manager_test.cpp33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/mongo/db/s/metadata_manager_test.cpp b/src/mongo/db/s/metadata_manager_test.cpp
index 5ba653ac731..a3375634d9f 100644
--- a/src/mongo/db/s/metadata_manager_test.cpp
+++ b/src/mongo/db/s/metadata_manager_test.cpp
@@ -222,36 +222,17 @@ TEST_F(MetadataManagerTest, NotificationBlocksUntilDeletion) {
ASSERT_EQ(manager->numberOfMetadataSnapshots(), 0UL);
ASSERT_EQ(manager->numberOfRangesToClean(), 0UL);
- auto scm1 = manager->getActiveMetadata(manager); // and increment refcount
- ASSERT_TRUE(bool(scm1));
- ASSERT_EQ(0ULL, scm1->getChunks().size());
-
- addChunk(manager); // push new metadata
- auto scm2 = manager->getActiveMetadata(manager); // and increment refcount
- ASSERT_EQ(1ULL, scm2->getChunks().size());
-
- // this is here solely to pacify an invariant in addChunk
- manager->refreshActiveMetadata(makeEmptyMetadata());
-
- addChunk(manager); // push new metadata
- auto scm3 = manager->getActiveMetadata(manager); // and increment refcount
- ASSERT_EQ(1ULL, scm3->getChunks().size());
-
- auto overlaps =
- manager->overlappingMetadata(manager, ChunkRange(BSON("key" << 0), BSON("key" << 10)));
- ASSERT_EQ(2ULL, overlaps.size());
- std::vector<ScopedCollectionMetadata> ref;
- ref.push_back(std::move(scm3));
- ref.push_back(std::move(scm2));
- ASSERT(ref == overlaps);
-
- ASSERT_EQ(manager->numberOfMetadataSnapshots(), 3UL);
+ auto scm = manager->getActiveMetadata(manager); // and increment scm's refcount
+ ASSERT(bool(scm));
+ addChunk(manager); // push new metadata
+
+ ASSERT_EQ(manager->numberOfMetadataSnapshots(), 1UL);
ASSERT_EQ(manager->numberOfRangesToClean(), 0UL); // not yet...
optNotif = manager->cleanUpRange(cr1);
- ASSERT_EQ(manager->numberOfMetadataSnapshots(), 3UL);
+ ASSERT_EQ(manager->numberOfMetadataSnapshots(), 1UL);
ASSERT_EQ(manager->numberOfRangesToClean(), 1UL);
- } // scm1,2,3 destroyed, refcount of each metadata goes to zero
+ } // scm destroyed, refcount of metadata goes to zero
ASSERT_EQ(manager->numberOfMetadataSnapshots(), 0UL);
ASSERT_EQ(manager->numberOfRangesToClean(), 1UL);
ASSERT_FALSE(optNotif->ready());