|
I have confirmed that both issues described here are now fixed. Running an explain with maxTimeMS against mongos using the shell helpers shows that the explain fails due to maxTimeMS expiration:
MongoDB Enterprise mongos> db.c.find({$where: "sleep(100)"}).maxTimeMS(1).explain("executionStats");
|
uncaught exception: Error: explain failed: {
|
"ok" : 0,
|
"errmsg" : "Explain command on shard __unknown_name__-rs0 failed :: caused by :: operation exceeded time limit",
|
"code" : 50,
|
"codeName" : "MaxTimeMSExpired",
|
"$clusterTime" : {
|
"clusterTime" : Timestamp(1609975325, 1),
|
"signature" : {
|
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
|
"keyId" : NumberLong(0)
|
}
|
},
|
"operationTime" : Timestamp(1609975325, 1)
|
} :
|
_getErrorWithCode@src/mongo/shell/utils.js:25:13
|
throwOrReturn@src/mongo/shell/explainable.js:25:19
|
constructor/this.finish@src/mongo/shell/explain_query.js:176:24
|
DBQuery.prototype.explain@src/mongo/shell/query.js:534:12
|
@(shell):1:1
|
Similarly, running the explain command directly against mongos fails as expected:
MongoDB Enterprise mongos> db.runCommand({
|
... explain: {find: "c", filter: {$where: "sleep(100)"}},
|
... verbosity: "executionStats",
|
... maxTimeMS: 1
|
... });
|
{
|
"ok" : 0,
|
"errmsg" : "Explain command on shard __unknown_name__-rs0 failed :: caused by :: operation exceeded time limit",
|
"code" : 50,
|
"codeName" : "MaxTimeMSExpired",
|
"$clusterTime" : {
|
"clusterTime" : Timestamp(1609975375, 3),
|
"signature" : {
|
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
|
"keyId" : NumberLong(0)
|
}
|
},
|
"operationTime" : Timestamp(1609975307, 12)
|
}
|
The first issue was fixed by SERVER-46686 as discussed above. I'm not sure exactly which commit(s) fixed the second issue, so I am resolving this ticket as "Gone Away".
|