[SERVER-23322] Add unit tests checking the value of CollatorInterfaceICU::getComparisonKey() Created: 23/Mar/16  Updated: 06/Jun/16  Resolved: 17/May/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.3.8

Type: Task Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 15 (06/03/16)
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 17/May/16 ]

Author:

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

Message: SERVER-23322 add basic unit test cases to ensure stability of ICU comparison keys
Branch: master
https://github.com/mongodb/mongo/commit/ecd286af8ec44593b54f21610c048f552a6b023d

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