[SERVER-31836] Explicit maxTimeMS blocks tailable awaitData cursors on sharded cluster Created: 06/Nov/17  Updated: 30/Oct/23  Resolved: 18/Nov/17

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 3.6.0-rc5, 3.7.1

Type: Bug Priority: Major - P3
Reporter: Bernard Gorman Assignee: Bernard Gorman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-31394 Create passthroughs of existing chang... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6
Sprint: Query 2017-11-13, Query 2017-12-04
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 21/Nov/17 ]

Author:

{'name': 'Bernard Gorman', 'username': 'gormanb', 'email': 'bernard.gorman@gmail.com'}

Message: SERVER-31836 Always dispatch sorted tailable awaitdata getMores to the shards with timeouts of at most 1 second

(cherry picked from commit ed83e82fcd2731543724523e7fd2c8563ab717c9)
Branch: v3.6
https://github.com/mongodb/mongo/commit/aacb5b0d26ed1a660d0b4e736bb0095653b54429

Comment by Githook User [ 18/Nov/17 ]

Author:

{'name': 'Bernard Gorman', 'username': 'gormanb', 'email': 'bernard.gorman@gmail.com'}

Message: SERVER-31836 Always dispatch sorted tailable awaitdata getMores to the shards with timeouts of at most 1 second
Branch: master
https://github.com/mongodb/mongo/commit/ed83e82fcd2731543724523e7fd2c8563ab717c9

Comment by Charlie Swanson [ 06/Nov/17 ]

As discussed, I don't think this really warrants 3.6 Required at this point - so I put this in Needs Triage. It's definitely important though - so feel free to keep working on it in the meantime - just don't want to add to the release countdown clock for it.

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