-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Storage Execution
We should provide a way to check whether all the entries in a unique index are in the correct format. If they are, update the data format version to the new one introduced in SERVER-63577.
There are a couple ways we could do this:
1. Overload the "unique: true" option to collMod. If we call "unique: true" on an index that is already unique, we will attempt to upgrade the data format version if all the entries are in the correct format. This may be confusing semantically since unique: true is associated with the two-phase collMod approach
2. Introduce a new option to collMod that would do the same thing.
Either way, it is not our responsibility to re-write entries that are in the wrong format. We will just have to scan the entries and fail if we find any in the old format. This indicates to the user that they may need to rebuild their indexes.