[SERVER-23761] Prevent users from downgrading 3.4=>3.2 if any collection has an index with a non-default collation Created: 15/Apr/16  Updated: 28/Dec/18  Resolved: 16/Jun/16

Status: Closed
Project: Core Server
Component/s: Querying, Storage
Affects Version/s: None
Fix Version/s: 3.2.8, 3.3.9

Type: Task Priority: Major - P3
Reporter: J Rassi Assignee: David Storch
Resolution: Done Votes: 0
Labels: code-and-test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-38793 nonrepairable feature tracker for col... Closed
related to DOCS-7503 Document the collation project (part 1) Closed
is related to SERVER-23116 Add versioning scheme to the KVCatalo... Closed
is related to SERVER-23760 Add std::unique_ptr<CollatorInterface... Closed
is related to SERVER-24095 Set a feature bit in the KVCatalog wh... Closed
is related to SERVER-24248 Run multiversion tests with different... Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Sprint: Query 16 (06/24/16)
Participants:

 Description   

On all supported storage engines, 3.4.x versions will set a bit in the data files when either an index or a collection is created with a non-simple collation. On downgrade, this bit will cause 3.2 and older versions of the server to shut down with a MustUpgrade error. After creating indexes or collections with a non-simple collation on a 3.4.x version, the following steps must be taken in order to downgrade to 3.2:

  • Drop all indexes or collections with a non-simple collation.
  • Downgrade to 3.2.8 or a newer 3.2 patch release.

3.2.8 contains a change which will cause the server to examine the catalog metadata if the collation feature bit is set. If no collation-related metadata associated with collections or indexes is found in the catalog, then the data files are clean for downgrade. In this case, the collation feature bit is cleared and startup will succeed.

It is not possible to downgrade to a version older than 3.2.8 after creating indexes or collections with a non-simple collation.



 Comments   
Comment by David Storch [ 16/Jun/16 ]

Thanks ramon.fernandez, yes, this will definitely need careful documentation. I made a note about this in DOCS-7503, the parent ticket for documenting the collation feature.

Comment by Ramon Fernandez Marina [ 16/Jun/16 ]

Setting "Documentation Changes" to needed because the 3.2.8 requirement for downgrade needs to be part of our release notes on collation.

Cc kay.kim

Comment by Githook User [ 16/Jun/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-23761 on MMAPv1, set data file version bit for collation

The bit gets set when an index or collection with a collation is
created. This prevents downgrade for users who have indices or
collections with associated collations. Analogous to 8ca23764d4fd,
but for the MMAPv1 storage engine.
Branch: master
https://github.com/mongodb/mongo/commit/5f812b5da34f52835909f96d5061e4dce3c58d1f

Comment by Githook User [ 16/Jun/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-23761 make MMAP engine clear collation feature bit when possible

This is analogous to b968ee2da9, but for the MMAPv1 storage engine.
Branch: v3.2
https://github.com/mongodb/mongo/commit/6c50da2919703033ccb29f23389dcfd8ca62ad08

Comment by Githook User [ 15/Jun/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-23761 set NR feature bit for collation

This will ensure downgrade fails after creating collections or indices
with a non-simple collation.
Branch: master
https://github.com/mongodb/mongo/commit/8ca23764d4fd28c3bcf553d67c62b1f75be27814

Comment by Githook User [ 14/Jun/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-23761 make KVCatalog engines clear the NR feature bit for collation when possible

On startup, if the collation feature bit is set, we traverse the
metadata stored in the KVCatalog. If no collation metadata exists on a
collection or index, then we clear the feature bit and start up
successfully.
Branch: v3.2
https://github.com/mongodb/mongo/commit/b968ee2da9478d13408c83f606194caec34ea169

Generated at Thu Feb 08 04:04:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.