[SERVER-23833] DocumentSourceLookup::getOutputSorts() does not correctly compute sort. Created: 20/Apr/16  Updated: 06/Jun/16  Resolved: 18/May/16

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

Type: Bug Priority: Major - P3
Reporter: Benjamin Murphy 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
Operating System: ALL
Sprint: Query 15 (06/03/16)
Participants:

 Description   

In DocumentSourceLookup::getOutputSorts(), we truncate an input sort if a sort key matches our 'as' field exactly, as seen here. However, this is not correct – we should truncate each sort at either the 'as' key, or at any path prefix of the 'as' key. expression::isPathPrefixOf can be used to determine whether this is true.

In addition, document_source_test.cpp should be updated to include tests for this behavior. As part of this work, the two namespaces for DocumentSourceLookup in document_source_test.cpp should be combined into one.



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

Author:

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

Message: SERVER-23833 DocumentSourceLookup::getOutputSorts correctly truncates input sort set.

This commit is identical to 44abb8db32a6fad705854793e397961dfc72d09e.
Branch: master
https://github.com/mongodb/mongo/commit/6866a2fc819986252ba031c76ca87f618b91d781

Comment by David Storch [ 18/May/16 ]

These failures are due to https://github.com/mongodb/mongo/commit/51ee6f1952addc650b1c719cce51fcf460e6e9e8 (thanks to max.hirschhorn and waley.chen for verifying). I am going to re-commit Ben's original pull request.

Comment by Dianna Hohensee (Inactive) [ 18/May/16 ]

Failing unittests on Enterprise Windows

https://evergreen.mongodb.com/task/mongodb_mongo_master_enterprise_windows_64_unittests_af9ad7ec9599f6c2da22a27fead7cd9bf97bda50_16_05_17_21_28_23

Comment by Githook User [ 18/May/16 ]

Author:

{u'username': u'DiannaHohensee', u'name': u'Dianna Hohensee', u'email': u'dianna.hohensee@10gen.com'}

Message: Revert "SERVER-23833 DocumentSourceLookup::getOutputSorts correctly truncates input sort set."

This reverts commit 44abb8db32a6fad705854793e397961dfc72d09e.

Unit tests QueuedDataStageTest and SortStageTest are failing.
Branch: master
https://github.com/mongodb/mongo/commit/1290f33574da2e129bd3f5471dd06f2e761c74ee

Comment by Githook User [ 17/May/16 ]

Author:

{u'username': u'benjaminmurphy', u'name': u'Benjamin Murphy', u'email': u'benjamin_murphy@me.com'}

Message: SERVER-23833 DocumentSourceLookup::getOutputSorts correctly truncates input sort set.

Closes #1080

Signed-off-by: David Storch <david.storch@10gen.com>
Branch: master
https://github.com/mongodb/mongo/commit/44abb8db32a6fad705854793e397961dfc72d09e

Comment by Benjamin Murphy [ 12/May/16 ]

Pull request here: https://github.com/mongodb/mongo/pull/1080

Comment by Benjamin Murphy [ 29/Apr/16 ]

DocumentSource::truncateSortSet() should be used when DocumentSourceLookup::getOutputSorts() is updated.

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