SERVER-21835 Ignore errors due to CappedPositionLost in make_capped.js.

(cherry picked from commit 9736f7439e)
This commit is contained in:
Max Hirschhorn
2015-12-21 12:53:34 -05:00
parent dab123e614
commit 1dfd2cffcf

View File

@@ -35,6 +35,14 @@ function makeCapped($config, $super) {
// failures due to collection truncation
globalAssertLevel = AssertLevel.ALWAYS;
$super.states.find.apply(this, arguments);
} catch (e) {
if (e.message.indexOf('CappedPositionLost') >= 0) {
// Ignore errors when a cursor's position in the capped collection is deleted.
// Reads from the beginning of a capped collection are not guaranteed to succeed
// when there are concurrent inserts that cause a truncation.
return;
}
throw e;
} finally {
globalAssertLevel = oldAssertLevel;
}