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

Explicit maxTimeMS blocks tailable awaitData cursors on sharded cluster

    • Fully Compatible
    • ALL
    • v3.6
    • Query 2017-11-13, Query 2017-12-04

      Currently, we forward the maxTimeMS for a sharded $changeStream from the mongoS to each of the shards, per SERVER-21218. However, this can cause adverse behaviour if one of the shards is cold, since that shard's latest optime will not be reported to mongoS until the shard getMore times out, and will therefore block the mongoS from returning results from the other shards. For instance, if we specify a one-minute maxTimeMS on a cluster with one active and one inactive shard, results will accumulate from the active shard but will only be returned to the client at one-minute intervals.

      We should not forward the maxTimeMS from mongoS to the shards. Instead, mongoS should honor the user-defined maxTimeMS but should do so by scheduling a stream of one-second maxTimeMS getMores to each of the shards.

            Assignee:
            bernard.gorman@mongodb.com Bernard Gorman
            Reporter:
            bernard.gorman@mongodb.com Bernard Gorman
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: