diff options
author | Allison Easton <allison.easton@mongodb.com> | 2023-02-13 08:20:10 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-13 09:29:21 +0000 |
commit | 2246d9fd8db9eede8edfe6e5ce0fd95591839a44 (patch) | |
tree | 03915694368dfa13e802ab1a7a6ea931f8bc489d /src/mongo/s/catalog | |
parent | 2d8b897ec7e8753e6be42cd90e00a19b09c5aca7 (diff) | |
download | mongo-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.h | 5 |
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()); } |