[SERVER-34685] Mongos exits when non-existent resume token is supplied Created: 26/Apr/18  Updated: 27/Apr/18  Resolved: 27/Apr/18

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

Type: Bug Priority: Major - P3
Reporter: avi Assignee: Charlie Swanson
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-34399 $changeStream with invalid resume tok... Closed
Operating System: ALL
Sprint: Query 2018-05-07
Participants:

 Comments   
Comment by Charlie Swanson [ 27/Apr/18 ]

Hi aviziv,

After some investigation we were able to reproduce the issue with your example BinData. We believe this issue is a duplicate of SERVER-34399 which was just resolved in our master branch and will make it into the 4.0 release. At this time we also plan to backport the fix to the 3.6 branch. Please watch SERVER-34399 for updates.

If you are still able to reproduce the failure when running with version 4.0.0-rc0 (not yet released, stay tuned), please re-open this issue and we will investigate further.

Comment by Charlie Swanson [ 26/Apr/18 ]

Can you post the backtrace from the logs for the node that crashed?

Comment by avi [ 26/Apr/18 ]

Sorry, probably hit enter too early.

So, when a correct "resume after" token is supplied to collection watch through Mongos all is well and we receive change events. When a non-existent resume token (well formatted) is supplied then Mongos crashes.
Note that we're running both Mongo cluster and Mongos in Docker.

Example of what we observe with a non-existent token:

{{> db.ourCollection.watch( [], { resumeAfter :

{ "_data" : new BinData(0, "aaagf94AAADCRmRfaWQAZFrgY9/zjbt2ewaaiABaEASOM5i0AiZI2YBeXu99TFx2BA==") }

} );
2018-04-26T11:25:20.230+0300 E QUERY [thread1] Error: error doing query: failed: network error while attempting to run command 'aggregate' on host 'localhost:27004' :
DB.prototype.runCommand@src/mongo/shell/db.js:168:1
DB.prototype.runReadCommand@src/mongo/shell/db.js:139:16
DB.prototype._runAggregate/doAgg<@src/mongo/shell/db.js:239:60
DB.prototype._runAggregate@src/mongo/shell/db.js:242:21
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1212:12
DBCollection.prototype.watch@src/mongo/shell/collection.js:1660:12
@(shell):1:22}}

The bug occurs in latest version (3.6.4, 3.6, 3) and unstable (3.7.5, 3.7) latest version

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