[SERVER-28414] sharding/cursor_timeout.js can timeout between find & getMore call when under load Created: 21/Mar/17  Updated: 06/Dec/17  Resolved: 29/Apr/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.5.7

Type: Bug Priority: Major - P3
Reporter: James Wahlin Assignee: James Wahlin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-26956 Remove moveChunk from sharding/cursor... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2017-05-08
Participants:
Linked BF Score: 0

 Description   

The sharding/cursor_timeout.js test can fail when under load due to cursor timeout between a find and subsequent getMore.

The highlighted line executes a find against mongos which then executes a find and getMore in order to satisfy the requested batch. This occurs because mongod returns a batch to mongos that is just under the default batch size limit. mongos then has to perform a getMore to retrieve another batch and then confirm that it can't fit any additional documents in the current batch. When under load, the time span between the 2 calls can exceed the test's 2 second cursor timeout period, leading to a timeout.

cursor_timeout.js

85
    var cursorWithTimeout = shardColl.find();
86
    var cursorWithNoTimeout = shardColl.find();
87
    cursorWithNoTimeout.addOption(DBQuery.Option.noTimeout);
88
 
89
    shardedCursorWithTimeout.next();
90
    shardedCursorWithNoTimeout.next();
91
 
92
    cursorWithTimeout.next();
93
    cursorWithNoTimeout.next();

Changing this test to ensure that the initial .next() call performs only a find() against mongod should fix. The sharded collection test setup should be reviewed as well to make sure it is correct. At a minimum we should fix the chunk migration so that it succeeds and so that we assert if it fails. We will likely want to manually split the test.user collection as well, as there is only one chunk as this test stands.



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

Author:

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

Message: SERVER-28414 Make sharding/cursor_timeout.js more tolerant to server load
Branch: master
https://github.com/mongodb/mongo/commit/b3b32ae51349a66670f2ef17dc88f43b3ab9b90f

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