Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-28414

sharding/cursor_timeout.js can timeout between find & getMore call when under load

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.7
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Query 2017-05-08
    • 0

      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
          var cursorWithTimeout = shardColl.find();
          var cursorWithNoTimeout = shardColl.find();
          cursorWithNoTimeout.addOption(DBQuery.Option.noTimeout);
      
          shardedCursorWithTimeout.next();
          shardedCursorWithNoTimeout.next();
      
          cursorWithTimeout.next();
          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.

            Assignee:
            james.wahlin@mongodb.com James Wahlin
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: