-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Storage Execution
Today collations in index specifications are treated as a raw BSONObj and manually processed. The processing we do is intrinsically coupled with the serialisation format. This has multiple consequences:
- An empty collation BSON or lack of thereof is implicitly assumed to be a "simple" collation definition.
- However, the presence of a collation BSON containing
{locale: "simple"}
explicitly also means it's a simple collation.
This means that there are still numerous places in the code that have to check both conditions. This is prone to human error and has led to multiple issues like:
SERVER-92900where we were processing more than once the normalization of the collation since we weren't aware it was happening above the stack.- SERVER-85572 and
SERVER-76855where only one comparison of the necessary two was happening.
Having an actual type would prevent such errors from happening as they would decouple the serialisation format we use from runtime processing.
- is related to
-
SERVER-85572 Follow up on audit in mongos for improper usage of collation and incorrectly assuming simple collation rather than collection default
- Open
-
SERVER-76855 Audit mongos for improper usage of collation and incorrectly assuming simple collation rather than collection default
- Closed
-
SERVER-92900 Cannot build index with simple collation on a collection with a non-default collator if an index already exists with the collection's collator
- Closed