[SERVER-30384] Query tests should not expect a particular sort order without requesting one explicitly Created: 27/Jul/17  Updated: 30/Oct/23  Resolved: 28/Nov/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.6.0-rc7, 3.7.1

Type: Task Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Kyle Suarez
Resolution: Fixed Votes: 0
Labels: neweng, todo_in_code
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-44215 Complete TODO listed in SERVER-30384 Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Backport Requested:
v3.6
Sprint: Query 2017-12-04
Participants:

 Description   

Some tests are non deterministic when used with readPreference secondary with causally_consistent_jscore_passthrough suite.
Order: the tests below assume that values are ordered
jstest/core/distinct1.js
jstest/core/group1.js
jstest/core/find1.js
jstest/core/find4.js
jstest/core/find5.js
jstest/core/fts1.js
jstest/core/geo_distinct.js
jstest/core/geo_s2ordering.js
jstest/core/sort3.js
jstest/core/sort4.js
jstest/core/nan.js
jstest/core/not2.js
jstest/core/elemMatchProjection.js
jstest/core/find_dedup.js
jstest/core/snapshot_queries.js
jstest/core/snapshot_queries.js
jstest/core/maxscan.js
jstest/core/group2.js

DDL
jstest/core/sorta.js - assumes that ensudeIndex is available on secondary
jstest/core/fts_spanish.js - assumes that ensudeIndex is available on secondary
jstest/core/ord.js - assumes that dropIndex will invalidate cursor that is running on secondary



 Comments   
Comment by Githook User [ 29/Nov/17 ]

Author:

{'name': 'Kyle Suarez', 'username': 'ksuarz', 'email': 'kyle.suarez@mongodb.com'}

Message: SERVER-30384 unblacklist tests from causally consistent jscore passthroughs

Refactors more tests that should be allowed to run in the causally
consistent passthroughs.

(cherry picked from commit 92d366961e353f2552069091a3ae686db4e6c8eb)
Branch: v3.6
https://github.com/mongodb/mongo/commit/03f043b5ce4d29f498afffaa19e17fedb59fc20f

Comment by Githook User [ 29/Nov/17 ]

Author:

{'name': 'Kyle Suarez', 'username': 'ksuarz', 'email': 'kyle.suarez@mongodb.com'}

Message: SERVER-30384 tests should specify a sort when expecting an ordering for a query

This refactors several tests in core to not rely on an implicit sort
order, which allows them to be unblacklisted from the causally
consistent jscore passthroughs.

(cherry picked from commit 969ddd3d921cd8e6c5ab3068fdb77cb2dc271ed5)
Branch: v3.6
https://github.com/mongodb/mongo/commit/fc8bff9cb031088e96cf8691b798e8d0a1be0207

Comment by Githook User [ 28/Nov/17 ]

Author:

{'name': 'Kyle Suarez', 'username': 'ksuarz', 'email': 'kyle.suarez@mongodb.com'}

Message: SERVER-30384 unblacklist tests from causally consistent jscore passthroughs

Refactors more tests that should be allowed to run in the causally
consistent passthroughs.
Branch: master
https://github.com/mongodb/mongo/commit/92d366961e353f2552069091a3ae686db4e6c8eb

Comment by Githook User [ 22/Nov/17 ]

Author:

{'name': 'Kyle Suarez', 'username': 'ksuarz', 'email': 'kyle.suarez@mongodb.com'}

Message: SERVER-30384 tests should specify a sort when expecting an ordering for a query

This refactors several tests in core to not rely on an implicit sort
order, which allows them to be unblacklisted from the causally
consistent jscore passthroughs.
Branch: master
https://github.com/mongodb/mongo/commit/969ddd3d921cd8e6c5ab3068fdb77cb2dc271ed5

Comment by Kyle Suarez [ 16/Nov/17 ]

find1.js and snapshot_queries.js both use the deprecated cursor $snapshot option, which is incompatible with a sort order. I propose we simply keep these tests around and continue to blacklist them from the causally_consistent_jscore_passthrough suite. I assume that they'll be deleted when $snapshot is removed completely.

misha.tyulenev, does that approach sound okay?

Comment by David Storch [ 12/Sep/17 ]

There are a number of tests which expect query results to be ordered. These tests happen to work when the reads are issued against the primary, because the storage engine happens to return documents in the order in which they were inserted. They fail, however, in our causally consistent passthrough configurations. This is because the implementation details of how the data is synced to the secondary can cause the results to be returned in a different order when the read targets the secondary. This is a perfect example of why applications and tests should never expect a particular ordering of query results without asking for one explicitly.

Comment by Ian Whalen (Inactive) [ 12/Sep/17 ]

Dave to talk with Misha about this along with a few of the other tickets representing fallout from causal consistency.

Comment by Misha Tyulenev [ 22/Aug/17 ]

Once/if tests are updated they can be unblocked in causally_consistent_jscore_passthrough, causally_consistent_jscore_passthrough_auth, and sharded_causally_consistent_jscore_passthrough.

Comment by Misha Tyulenev [ 22/Aug/17 ]

Passing to the query team as its mostly query related test cases.

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