-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Storage Execution
SERVER-61260 added support for collations to clustered collections. Sharding requires an index with collation = simple on the shard key, if we want to shard on _id we'd need to create an explicit index on _id with the simple collation, but currently that's not possible:
- Indexes on _id must have the collection default collation: https://github.com/mongodb/mongo/blob/62dcce62e7be38f9637cdd967070713ebfa6aaa5/src/mongo/db/catalog/index_catalog_impl.cpp#L857-L862
- It's not possible to create an index that matches the cluster key: https://github.com/mongodb/mongo/blob/62dcce62e7be38f9637cdd967070713ebfa6aaa5/src/mongo/db/catalog/index_catalog_impl.cpp#L829-L833
Some of these restrictions were introduced by SERVER-26724 to protect _id index creation when using autoIndexId: false, which is no longer supported. I think it should be OK to relax some of these restrictions, at the very least for clustered collections.
- related to
-
SERVER-62688 Verify clustered collections with collation and sharding
- Closed