0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-29320 make sharding_multiple_collections.js allow stale shard version errors on the explainFind

This commit is contained in:
Esha Maharishi 2017-05-22 17:21:01 -04:00
parent 1ab42a7942
commit b3d704a117

View File

@ -26,7 +26,16 @@
s.printShardingStatus();
function mytest(coll, i, loopNumber) {
var x = coll.find({_id: i}).explain();
try {
var x = coll.find({_id: i}).explain();
} catch (e) {
// Ignore stale shard version exceptions, since there are many migrations happening, and
// mongos may not be able to complete the find within the stale version retries limit.
if (e.message.contains("stale config")) {
return;
}
throw e;
}
if (x)
return;
throw Error("can't find " + i + " in " + coll.getName() + " on loopNumber: " + loopNumber +