summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
authorMarcos José Grillo Ramirez <marcos.grillo@mongodb.com>2021-08-10 12:41:56 +0200
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-08-10 11:27:53 +0000
commit18f6ad80da5dd6225224d11914905fb1851b4833 (patch)
tree33c605ade7353808ba460d40bbff987e80525401 /src/mongo/s
parentb90a2a93631d94fd710338ac688e035e634cfe6a (diff)
downloadmongo-18f6ad80da5dd6225224d11914905fb1851b4833.tar.gz
SERVER-51881 Remove dropped field from CollectionType
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/catalog/sharding_catalog_client_impl.cpp11
-rw-r--r--src/mongo/s/catalog/type_collection.cpp4
-rw-r--r--src/mongo/s/catalog/type_collection.h5
-rw-r--r--src/mongo/s/catalog/type_collection.idl9
-rw-r--r--src/mongo/s/catalog/type_collection_test.cpp3
5 files changed, 2 insertions, 30 deletions
diff --git a/src/mongo/s/catalog/sharding_catalog_client_impl.cpp b/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
index 67a4e1b2a93..0b7f8cd37bf 100644
--- a/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
+++ b/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
@@ -430,9 +430,6 @@ CollectionType ShardingCatalogClientImpl::getCollection(OperationContext* opCtx,
!collDoc.empty());
CollectionType coll(collDoc[0]);
- uassert(ErrorCodes::NamespaceNotFound,
- stream() << "collection " << nss.ns() << " was dropped",
- !coll.getDropped());
return coll;
}
@@ -467,10 +464,6 @@ std::vector<NamespaceString> ShardingCatalogClientImpl::getAllShardedCollections
std::vector<NamespaceString> collectionsToReturn;
collectionsToReturn.reserve(collectionsOnConfig.size());
for (const auto& coll : collectionsOnConfig) {
- if (coll.getDropped()) {
- continue;
- }
-
collectionsToReturn.push_back(coll.getNss());
}
@@ -678,10 +671,6 @@ std::pair<CollectionType, std::vector<ChunkType>> ShardingCatalogClientImpl::get
}
}
uassert(5520101, "'collections' document not found in aggregation response", coll);
-
- uassert(ErrorCodes::NamespaceNotFound,
- str::stream() << "Collection " << nss.ns() << " is dropped.",
- !coll->getDropped());
}
// 2nd: Traverse all the elements and build the chunks.
diff --git a/src/mongo/s/catalog/type_collection.cpp b/src/mongo/s/catalog/type_collection.cpp
index 60bb0e0b836..b6e549aa626 100644
--- a/src/mongo/s/catalog/type_collection.cpp
+++ b/src/mongo/s/catalog/type_collection.cpp
@@ -68,9 +68,7 @@ CollectionType::CollectionType(const BSONObj& obj) {
if (!getPre22CompatibleEpoch()) {
setPre22CompatibleEpoch(OID());
}
- uassert(ErrorCodes::NoSuchKey,
- "Shard key is missing",
- getPre50CompatibleKeyPattern() || getDropped());
+ uassert(ErrorCodes::NoSuchKey, "Shard key is missing", getPre50CompatibleKeyPattern());
}
std::string CollectionType::toString() const {
diff --git a/src/mongo/s/catalog/type_collection.h b/src/mongo/s/catalog/type_collection.h
index b133295afda..1e1adbd8ae8 100644
--- a/src/mongo/s/catalog/type_collection.h
+++ b/src/mongo/s/catalog/type_collection.h
@@ -45,7 +45,6 @@ using ReshardingFields = TypeCollectionReshardingFields;
* "_id" : "foo.bar",
* "lastmodEpoch" : ObjectId("58b6fd76132358839e409e47"),
* "lastmod" : ISODate("1970-02-19T17:02:47.296Z"),
- * "dropped" : false,
* "key" : {
* "_id" : 1
* },
@@ -137,10 +136,6 @@ public:
}
void setUuid(UUID uuid);
- bool getDropped() const {
- return getPre50CompatibleDropped().get_value_or(false);
- }
-
const KeyPattern& getKeyPattern() const {
return *getPre50CompatibleKeyPattern();
}
diff --git a/src/mongo/s/catalog/type_collection.idl b/src/mongo/s/catalog/type_collection.idl
index 76c8e088041..1d258b4811f 100644
--- a/src/mongo/s/catalog/type_collection.idl
+++ b/src/mongo/s/catalog/type_collection.idl
@@ -60,8 +60,7 @@ structs:
lastmod:
cpp_name: updatedAt
type: date
- description: "Contains the time of when the collection was either created, or if
- dropped = true, when it was dropped."
+ description: "Contains the time of when the collection was either created."
optional: false
timestamp:
type: timestamp
@@ -87,12 +86,6 @@ structs:
is set to true, because dropped collections' entries were being
written as dropped with certain fields missing instead of deleted."
optional: true
- dropped: # TODO (SERVER-51881): Remove this field after 5.0 is released
- cpp_name: pre50CompatibleDropped
- type: bool
- description: "Legacy (pre 5.0 only) field, which indicates that the collection is
- dropped"
- optional: true
key:
cpp_name: pre50CompatibleKeyPattern
type: KeyPattern
diff --git a/src/mongo/s/catalog/type_collection_test.cpp b/src/mongo/s/catalog/type_collection_test.cpp
index e56ee3d5df4..a96da4c40b5 100644
--- a/src/mongo/s/catalog/type_collection_test.cpp
+++ b/src/mongo/s/catalog/type_collection_test.cpp
@@ -63,7 +63,6 @@ TEST(CollectionType, Basic) {
<< "fr_CA"));
ASSERT_EQUALS(coll.getUnique(), true);
ASSERT_EQUALS(coll.getAllowBalance(), true);
- ASSERT_EQUALS(coll.getDropped(), false);
}
TEST(CollectionType, AllFieldsPresent) {
@@ -96,7 +95,6 @@ TEST(CollectionType, AllFieldsPresent) {
<< "fr_CA"));
ASSERT_EQUALS(coll.getUnique(), true);
ASSERT_EQUALS(coll.getAllowBalance(), true);
- ASSERT_EQUALS(coll.getDropped(), false);
ASSERT_EQUALS(coll.getUuid(), uuid);
ASSERT(coll.getReshardingFields()->getState() == CoordinatorStateEnum::kUnused);
ASSERT(coll.getReshardingFields()->getReshardingUUID() == reshardingUuid);
@@ -142,7 +140,6 @@ TEST(CollectionType, Pre22Format) {
ASSERT_BSONOBJ_EQ(coll.getKeyPattern().toBSON(), BSON("a" << 1));
ASSERT_EQUALS(coll.getUnique(), false);
ASSERT_EQUALS(coll.getAllowBalance(), true);
- ASSERT_EQUALS(coll.getDropped(), false);
}
TEST(CollectionType, InvalidNamespace) {