[DOCS-16516] Investigate changes in SERVER-79514: Make value comparison consistent in MatchExpression Created: 28/Nov/23  Updated: 08/Jan/24  Resolved: 07/Dec/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 7.3.0-rc0, Server_Docs_[20240108]

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Jason Price
Resolution: Done Votes: 0
Labels: feature
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-79514 Make value comparison consistent in M... Closed
Participants:
Days since reply: 9 weeks ago
Story Points: 3

 Description   
Original Downstream Change Summary

TLDR: partial indexes with the same index keys and the same partial expressions compared using their collation are not allowed any more.

Partial filter expression used not to be validated using provided collation as a result, it was possible to create two equivalent indexes:

db.coll.createIndex({a: 1}, {name: "index0", { locale: "en_US", strength: 1 }, partialFilterExpression: {b: "case"}};
db.coll.createIndex({a: 1}, {name: "index1",{ locale: "en_US", strength: 1 }, partialFilterExpression: {b: "CASE"}};

However, only the first index index0 will be used to answer queries like

db.coll.find({a: 1, b: "case"}).collation({ locale: "en_US", strength: 1 });
db.coll.find({a: 1, b: "CASE"}).collation({ locale: "en_US", strength: 1 });
db.coll.find({a: 1, b: "Case"}).collation({ locale: "en_US", strength: 1 });

index1 would be never used.

After the change the second index1 will be prevented from creating with the following error:

MongoServerError: Index already exists with a different name: index0

Nothing changed for databases with existing duplicating partial indexes, the indexes will be kept and only the first created index will be used to serve the queries as it was before.

Description of Linked Ticket

equivalent() function should compare BSONElements consistently in comparison and $in operators.



 Comments   
Comment by Sarah Olson [ 06/Dec/23 ]

Many thanks jason.price@mongodb.com!

Comment by Jason Price [ 06/Dec/23 ]

sarah.olson@mongodb.com Added story points.

Comment by Sarah Olson [ 06/Dec/23 ]

jason.price@mongodb.com, can you please add story points to this ticket? 

Comment by Jason Price [ 06/Dec/23 ]

https://github.com/10gen/docs-mongodb-internal/pull/5485

Generated at Thu Feb 08 08:15:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.