[SERVER-38964] geo_distinct.js does not properly sort an array of documents before checking for an expected ordering Created: 11/Jan/19  Updated: 29/Oct/23  Resolved: 14/Jan/19

Status: Closed
Project: Core Server
Component/s: Querying, Replication
Affects Version/s: None
Fix Version/s: 4.1.7

Type: Bug Priority: Major - P3
Reporter: Samyukta Lanka Assignee: Samyukta Lanka
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2019-01-28
Participants:
Linked BF Score: 20

 Description   

If the primary steps down after inserts have been made in geo_distinct.js, then the new primary is not guaranteed to have inserted them in the same order. This manifested when all of these inserts were part of the same transaction (and therefore the same applyOps oplog entry). The test then fails a check of the returned documents because they are in the wrong order and the sort function used does not actually sort the documents.

Instead, we should properly sort the returned documents using bsonWoCompare.



 Comments   
Comment by Githook User [ 14/Jan/19 ]

Author:

{'username': 'lankas', 'email': 'samy.lanka@mongodb.com', 'name': 'Samy Lanka'}

Message: SERVER-38964 geo_distinct.js should use bsonWoCompare to sort an array of documents
Branch: master
https://github.com/mongodb/mongo/commit/c943345cc0d617db1db707555c7ee34dc2516410

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