[SERVER-12750] mongos shouldn't accept initial query with "exhaust" flag set Created: 15/Feb/14  Updated: 11/Jul/16  Resolved: 09/Jul/14

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 2.6.4, 2.7.4

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Greg Studer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-2627 Mongos should support QueryOption_Exh... Closed
is related to SERVER-15318 copydb should not use exhaust flag wh... Closed
Tested
Operating System: ALL
Backport Completed:
Participants:

 Description   
Issue Status as of Aug 6, 2014

ISSUE SUMMARY
A connection to a mongos with the "exhaust" flag set is ignored, and mongos returns a regular cursor instead.

USER IMPACT
The connection deadlocks after the first batch if the driver iterates over the cursor: mongos is waiting for a getMore operation, while the driver is waiting for an OP_REPLY.

WORKAROUNDS
Remove the exhaust flag from queries through mongos.

AFFECTED VERSIONS
MongoDB 2.6 production releases up to 2.6.3 are affected by this issue.

FIX VERSION
The fix is included in the 2.6.4 production release.

RESOLUTION DETAILS
Disallow exhaust query option through mongos.

Original description

Mongos doesn't implement exhaust cursors. If a client creates a cursor by sending OP_QUERY to mongos with the "exhaust" flag set, mongos ignores it and returns a regular cursor. When the driver iterates the cursor, it deadlocks after the first batch: mongos is waiting for a getMore, and the driver is waiting for an OP_REPLY.

Those official drivers that implement exhaust cursors are written to prevent this case. But it'd be even better if mongos checked the exhaust flag and failed immediately. (Until such time as mongos implements exhaust cursors.)



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

Author:

{u'username': u'gregstuder', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: SERVER-12750 disallow exhaust query option through mongos
(cherry picked from commit 98fb05b9cc74318984574478cc7eadc1167a97e8)
Branch: v2.6
https://github.com/mongodb/mongo/commit/5f2e923d4a6561fb012dc9fd635ac2d59abe8db3

Comment by Githook User [ 09/Jul/14 ]

Author:

{u'username': u'gregstuder', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: SERVER-12750 disallow exhaust query option through mongos
Branch: master
https://github.com/mongodb/mongo/commit/98fb05b9cc74318984574478cc7eadc1167a97e8

Comment by Andy Schwerin [ 18/Feb/14 ]

Until it supports exhaust, why shouldn't it reject exhaust queries?

Comment by Daniel Pasette (Inactive) [ 18/Feb/14 ]

or should support exhaust: SERVER-2627

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