diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2020-10-30 11:48:09 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-11-03 16:39:42 +0000 |
commit | ab6d6baf541e762b272738da8d9c5b257caa3be4 (patch) | |
tree | 0f9a824c741fc4a5ced8fb792b82893bfc228f0e /src/mongo/db/s/config/sharding_catalog_manager_assign_key_range_to_zone_test.cpp | |
parent | cd587a2171ea96b86ac82508eef065a601e4f3df (diff) | |
download | mongo-ab6d6baf541e762b272738da8d9c5b257caa3be4.tar.gz |
SERVER-50027 Convert the CollectionType's UUID field to IDL
... and make it required
Diffstat (limited to 'src/mongo/db/s/config/sharding_catalog_manager_assign_key_range_to_zone_test.cpp')
-rw-r--r-- | src/mongo/db/s/config/sharding_catalog_manager_assign_key_range_to_zone_test.cpp | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/src/mongo/db/s/config/sharding_catalog_manager_assign_key_range_to_zone_test.cpp b/src/mongo/db/s/config/sharding_catalog_manager_assign_key_range_to_zone_test.cpp index 91ac94228e0..bcff7bf6d52 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_assign_key_range_to_zone_test.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_assign_key_range_to_zone_test.cpp @@ -60,10 +60,7 @@ public: setupShards({shard}); - CollectionType shardedCollection; - shardedCollection.setNss(shardedNS()); - shardedCollection.setEpoch(OID::gen()); - shardedCollection.setUpdatedAt(Date_t::now()); + CollectionType shardedCollection(shardedNS(), OID::gen(), Date_t::now(), UUID::gen()); shardedCollection.setKeyPattern(BSON("x" << 1)); ASSERT_OK(insertToConfigCollection( @@ -257,10 +254,7 @@ TEST_F(AssignKeyRangeToZoneTestFixture, RemoveZoneWithDollarPrefixedShardKeysSho TEST_F(AssignKeyRangeToZoneTestFixture, MinThatIsAShardKeyPrefixShouldConvertToFullShardKey) { NamespaceString ns("compound.shard"); - CollectionType shardedCollection; - shardedCollection.setNss(ns); - shardedCollection.setEpoch(OID::gen()); - shardedCollection.setUpdatedAt(Date_t::now()); + CollectionType shardedCollection(ns, OID::gen(), Date_t::now(), UUID::gen()); shardedCollection.setKeyPattern(BSON("x" << 1 << "y" << 1)); ASSERT_OK(insertToConfigCollection( @@ -277,10 +271,7 @@ TEST_F(AssignKeyRangeToZoneTestFixture, MinThatIsAShardKeyPrefixShouldConvertToF TEST_F(AssignKeyRangeToZoneTestFixture, MaxThatIsAShardKeyPrefixShouldConvertToFullShardKey) { NamespaceString ns("compound.shard"); - CollectionType shardedCollection; - shardedCollection.setNss(ns); - shardedCollection.setEpoch(OID::gen()); - shardedCollection.setUpdatedAt(Date_t::now()); + CollectionType shardedCollection(ns, OID::gen(), Date_t::now(), UUID::gen()); shardedCollection.setKeyPattern(BSON("x" << 1 << "y" << 1)); ASSERT_OK(insertToConfigCollection( @@ -332,10 +323,7 @@ TEST_F(AssignKeyRangeToZoneTestFixture, MinMaxThatIsNotAShardKeyPrefixShouldFail TEST_F(AssignKeyRangeToZoneTestFixture, MinMaxThatIsAShardKeyPrefixShouldSucceed) { NamespaceString ns("compound.shard"); - CollectionType shardedCollection; - shardedCollection.setNss(ns); - shardedCollection.setEpoch(OID::gen()); - shardedCollection.setUpdatedAt(Date_t::now()); + CollectionType shardedCollection(ns, OID::gen(), Date_t::now(), UUID::gen()); shardedCollection.setKeyPattern(BSON("x" << 1 << "y" << 1)); ASSERT_OK(insertToConfigCollection( @@ -472,10 +460,8 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, NewRangeOverlappingInsideExistingShoul * 0123456789 */ TEST_F(AssignKeyRangeWithOneRangeFixture, NewRangeOverlappingWithDifferentNSShouldSucceed) { - CollectionType shardedCollection; - shardedCollection.setNss(NamespaceString("other.coll")); - shardedCollection.setEpoch(OID::gen()); - shardedCollection.setUpdatedAt(Date_t::now()); + CollectionType shardedCollection( + NamespaceString("other.coll"), OID::gen(), Date_t::now(), UUID::gen()); shardedCollection.setKeyPattern(BSON("x" << 1)); ASSERT_OK(insertToConfigCollection( @@ -693,10 +679,7 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, RemoveWithInvalidMaxShardKeyShouldFail TEST_F(AssignKeyRangeWithOneRangeFixture, RemoveWithPartialMinPrefixShouldRemoveRange) { NamespaceString ns("compound.shard"); - CollectionType shardedCollection; - shardedCollection.setNss(ns); - shardedCollection.setEpoch(OID::gen()); - shardedCollection.setUpdatedAt(Date_t::now()); + CollectionType shardedCollection(ns, OID::gen(), Date_t::now(), UUID::gen()); shardedCollection.setKeyPattern(BSON("x" << 1 << "y" << 1)); ASSERT_OK(insertToConfigCollection( @@ -720,10 +703,7 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, RemoveWithPartialMinPrefixShouldRemove TEST_F(AssignKeyRangeWithOneRangeFixture, RemoveWithPartialMaxPrefixShouldRemoveRange) { NamespaceString ns("compound.shard"); - CollectionType shardedCollection; - shardedCollection.setNss(ns); - shardedCollection.setEpoch(OID::gen()); - shardedCollection.setUpdatedAt(Date_t::now()); + CollectionType shardedCollection(ns, OID::gen(), Date_t::now(), UUID::gen()); shardedCollection.setKeyPattern(BSON("x" << 1 << "y" << 1)); ASSERT_OK(insertToConfigCollection( |