[SERVER-16910] sorth.js makes invalid assumption about order of results Created: 16/Jan/15  Updated: 17/Nov/16  Resolved: 12/Jul/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.0.13, 3.2.9, 3.3.10

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Charlie Swanson
Resolution: Done Votes: 0
Labels: test-only
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: Query 16 (06/24/16), Query 17 (07/15/16)
Participants:
Linked BF Score: 0

 Description   

The assertion below is invalid and should be removed or restructured.

Original Description

sorth.js makes some sorted queries on an index and expects the documents to come in a certain order. It's not clear that the order of documents is guaranteed in some cases. On WiredTiger, the test can fail because a different document is returned first from the index.

In the following case, we did a query on a descending index with a descending sort. We expected to get { a:1, b:3 }, but instead we get { a:2, b:3 }. The index keys for the index used for the query do not include "a".

assert: [1] != [2] are not equal : undefined
Error: [1] != [2] are not equal : undefined
    at Error (<anonymous>)
    at doassert (src/mongo/shell/assert.js:11:14)
    at Function.assert.eq (src/mongo/shell/assert.js:38:5)
    at assertMatch (jstests/core/sorth.js:10:16)
    at assertMatches (jstests/core/sorth.js:20:9)
    at checkMatches (jstests/core/sorth.js:35:5)
    at checkReverseDirection (jstests/core/sorth.js:124:5)
    at jstests/core/sorth.js:140:1
    at <anonymous>:7:56
    at Function.Date.timeFunc (src/mongo/shell/types.js:27:17)
2015-01-16T19:03:23.114+0000 E QUERY    Error: [1] != [2] are not equal : undefined
    at Error (<anonymous>)
    at doassert (src/mongo/shell/assert.js:11:14)
    at Function.assert.eq (src/mongo/shell/assert.js:38:5)
    at assertMatch (jstests/core/sorth.js:10:16)
    at assertMatches (jstests/core/sorth.js:20:9)
    at checkMatches (jstests/core/sorth.js:35:5)
    at checkReverseDirection (jstests/core/sorth.js:124:5)
    at jstests/core/sorth.js:140:1
    at <anonymous>:7:56
    at Function.Date.timeFunc (src/mongo/shell/types.js:27:17) at src/mongo/shell/assert.js:13
********** Parallel Test FAILED: Error: error loading js file: jstests/core/sorth.js



 Comments   
Comment by Githook User [ 15/Jul/16 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-16910 Remove assumptions about order of results in sorth.js

(cherry picked from commit 762e93c179ca46d2dcb739f7674c572a82c55d08)
Branch: v3.0
https://github.com/mongodb/mongo/commit/52e8aa0c6cd453156de67cc1da7cff9bfaf57d9c

Comment by Githook User [ 15/Jul/16 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-16910 Remove assumptions about order of results in sorth.js

(cherry picked from commit 762e93c179ca46d2dcb739f7674c572a82c55d08)
Branch: v3.2
https://github.com/mongodb/mongo/commit/471bb309f27b51b37a4dbf453b46a8edd7537714

Comment by Githook User [ 12/Jul/16 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-16910 Remove assumptions about order of results in sorth.js
Branch: master
https://github.com/mongodb/mongo/commit/d846997c27c6e2297f59421fbeb3979a1423a9ff

Comment by Charlie Swanson [ 24/May/16 ]

This test failed again recently, see linked ticket.

This particular assertion is not valid, and should be removed or restructured so that it makes no assumptions on which values of "a" come first.

Comment by Ian Whalen (Inactive) [ 08/May/15 ]

error has not been seen since original failure, and don't believe original analysis about cause of the failure was correct.

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