Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-92967

Refactor index spec collations to be a proper type

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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-92900 where 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-76855 where 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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: