[SERVER-28040] Fix maxTimeMS/readPref/readConcern for sharded view query Created: 17/Feb/17  Updated: 06/Dec/17  Resolved: 05/Apr/17

Status: Closed
Project: Core Server
Component/s: Querying, Sharding
Affects Version/s: 3.4.2
Fix Version/s: 3.5.6

Type: Bug Priority: Major - P3
Reporter: David Storch Assignee: James Wahlin
Resolution: Done Votes: 0
Labels: read-only-views
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Duplicate
is duplicated by SERVER-28043 mongos does not obey readPreference f... Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v3.4
Steps To Reproduce:

Start a one-shard cluster, then run the following against the mongos:

db.c.drop();
var padding = new Array(12000000).toString();
for (var j=0; j < 100; ++j) {
    db.c.insert({x: padding})
}
db.createView("view", "c", []);
 
// As expected, this errors with ExceededTimeLimit.
db.c.find().maxTimeMS(1).itcount();
 
// This operation is expected to time out, but instead it succeeds (and takes much longer than 1 millisecond).
db.view.find().maxTimeMS(1).itcount();

Sprint: Query 2017-03-27, Query 2017-04-17
Participants:

 Description   

When a sharded query on a view with maxTimeMS is rewritten on mongos to a query over the view's backing collection, the maxTimeMS is discarded. The consequence is that the maxTimeMS is not enforced for a sharded queries over views. This is true for both views on sharded and unsharded collections. MaxTimeMS does work, however, for queries against a view delivered directly to mongod.



 Comments   
Comment by Githook User [ 05/Apr/17 ]

Author:

{u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}

Message: SERVER-28040 Fix maxTimeMS/readPref/readConcern for sharded view query
Branch: master
https://github.com/mongodb/mongo/commit/c3341d179db1c36722284676d99cb1c664fb1821

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