This involves adding a schemaVersion read-only global parameter (see FeatureCompatibility in server_options.h ).
In setFeatureCompatiblityCommand, for the upgrade case, first upgrade the schemaVersion and then iterate over all collections in the catalog, and perform an empty collMod command on each. In turn collMod should call a new CollectionCatalogEntry::updateUUID() method, which assigns a new UUID if there is none and the schema is 3.6, or removes it if there is one and the schema is 3.4. In both cases persist the new UUID, and on commit update the copy in the catalog using a new Collection::updateUUID() method.
In userCreateNSImpl, the schemaVersion should be used (in addition to the temporary enableCollectionUUIDs parameter) to determine whether to assign UUIDs or not.
- is depended on by
-
SERVER-29569 Store the featureCompatibilityVersion server parameter before writing the document on downgrade
- Closed
- is duplicated by
-
SERVER-27993 Implement schema upgrade/downgrade for collection UUIDs
- Closed
-
SERVER-27994 Implement full upgrade/downgrade FCV handling for collection UUIDs
- Closed