summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog
diff options
context:
space:
mode:
authorAllison Easton <allison.easton@mongodb.com>2023-02-13 08:20:10 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-13 09:29:21 +0000
commit2246d9fd8db9eede8edfe6e5ce0fd95591839a44 (patch)
tree03915694368dfa13e802ab1a7a6ea931f8bc489d /src/mongo/s/catalog
parent2d8b897ec7e8753e6be42cd90e00a19b09c5aca7 (diff)
downloadmongo-2246d9fd8db9eede8edfe6e5ce0fd95591839a44.tar.gz
SERVER-70005 SetIndexVersion in CollectionType should not be able to change collection uuid
Diffstat (limited to 'src/mongo/s/catalog')
-rw-r--r--src/mongo/s/catalog/type_collection.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/s/catalog/type_collection.h b/src/mongo/s/catalog/type_collection.h
index c9a164c9da3..d22a8828c20 100644
--- a/src/mongo/s/catalog/type_collection.h
+++ b/src/mongo/s/catalog/type_collection.h
@@ -114,7 +114,6 @@ public:
using CollectionTypeBase::getUuid;
using CollectionTypeBase::setDefragmentationPhase;
using CollectionTypeBase::setDefragmentCollection;
- using CollectionTypeBase::setIndexVersion;
using CollectionTypeBase::setKeyPattern;
using CollectionTypeBase::setNss;
using CollectionTypeBase::setReshardingFields;
@@ -183,6 +182,10 @@ public:
}
void setIndexVersion(CollectionIndexes indexVersion) {
+ tassert(7000500,
+ str::stream() << "Cannot set collection indexes to " << indexVersion
+ << " since collection uuid is " << getUuid(),
+ indexVersion.uuid() == getUuid());
CollectionTypeBase::setIndexVersion(indexVersion.indexVersion());
}