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

Add unit tests checking the value of CollatorInterfaceICU::getComparisonKey()

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.8
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • Query 15 (06/03/16)
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Existing unit tests ensure that the keys returned from CollatorInterfaceICU::getComparisonKey() have the correct comparison order. However, nowhere do we directly make assertions about the values of the bytes that the comparison key contains. Doing so is important to ensure that we are robust against upgrades of the version of ICU that we link into the server.

      Specifically, imagine that a future version of ICU reformats the comparison keys in an order-preserving way. This may not be a breaking change from ICU's perspective, since comparison keys will still sort properly with respect to the collator. However, indices constructed using older versions of MongoDB will have materialized the old format of the comparison keys. The newly formatted sort keys may not compare correctly against the persistently stored index keys, essentially resulting in a corrupted index. New unit tests would be useful for building confidence that the collator sort keys are stable.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: