summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/sharding_catalog_client_aggregations_test.cpp
diff options
context:
space:
mode:
authorPaolo Polato <paolo.polato@mongodb.com>2022-10-04 10:17:41 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-10-04 10:53:59 +0000
commit7405963f881131033c6eb519adc382e4135c9d6b (patch)
treedec8d02668990f4f33986fc4215600e6d2e05744 /src/mongo/db/s/sharding_catalog_client_aggregations_test.cpp
parent2269f512a48251749ff669cf42ef428cb5920d61 (diff)
downloadmongo-7405963f881131033c6eb519adc382e4135c9d6b.tar.gz
SERVER-70099 Extend the schema of config.placementData to also store the UUID field when nss refers to a collection
Diffstat (limited to 'src/mongo/db/s/sharding_catalog_client_aggregations_test.cpp')
-rw-r--r--src/mongo/db/s/sharding_catalog_client_aggregations_test.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mongo/db/s/sharding_catalog_client_aggregations_test.cpp b/src/mongo/db/s/sharding_catalog_client_aggregations_test.cpp
index 4220987da6d..d455672d8b8 100644
--- a/src/mongo/db/s/sharding_catalog_client_aggregations_test.cpp
+++ b/src/mongo/db/s/sharding_catalog_client_aggregations_test.cpp
@@ -66,6 +66,8 @@ std::vector<BSONObj> generateConfigShardSampleData(int nShards) {
std::vector<BSONObj> getPlacementDataSample() {
std::vector<BSONObj> placementDataSample = {};
+ const auto coll1Uuid = UUID::gen();
+ const auto coll2Uuid = UUID::gen();
// create database mock
placementDataSample.push_back(BSON("_id' " << 1 << "nss"
<< "mock"
@@ -74,21 +76,24 @@ std::vector<BSONObj> getPlacementDataSample() {
// shard collection mock.collection1
placementDataSample.push_back(BSON("_id' " << 2 << "nss"
<< "mock.collection1"
- << "timestamp" << Timestamp(2, 0) << "shards"
+ << "uuid" << coll1Uuid << "timestamp"
+ << Timestamp(2, 0) << "shards"
<< BSON_ARRAY("shard1"
<< "shard2"
<< "shard3")));
// shard collection mock.collection2
placementDataSample.push_back(BSON("_id' " << 3 << "nss"
<< "mock.collection2"
- << "timestamp" << Timestamp(3, 0) << "shards"
+ << "uuid" << coll2Uuid << "timestamp"
+ << Timestamp(3, 0) << "shards"
<< BSON_ARRAY("shard1"
<< "shard2"
<< "shard3")));
// drop collection2
placementDataSample.push_back(BSON("_id' " << 4 << "nss"
<< "mock.collection2"
- << "timestamp" << Timestamp(4, 0) << "shards"
+ << "uuid" << coll2Uuid << "timestamp"
+ << Timestamp(4, 0) << "shards"
<< BSONArrayBuilder().arr()));
// move primary from shard1 to shard2
placementDataSample.push_back(BSON("_id' " << 5 << "nss"
@@ -98,7 +103,8 @@ std::vector<BSONObj> getPlacementDataSample() {
// move last chunk of collection 1 located in shard1 to shard4
placementDataSample.push_back(BSON("_id' " << 6 << "nss"
<< "mock.collection1"
- << "timestamp" << Timestamp(6, 0) << "shards"
+ << "uuid" << coll1Uuid << "timestamp"
+ << Timestamp(6, 0) << "shards"
<< BSON_ARRAY("shard2"
<< "shard3"
<< "shard4")));