diff options
author | Eddie Louie <eddie.louie@mongodb.com> | 2017-05-18 11:22:09 -0400 |
---|---|---|
committer | Eddie Louie <eddie.louie@mongodb.com> | 2017-06-07 14:36:31 -0400 |
commit | 103972cebb1cdfccbc76c2afd82c824ed02fc11c (patch) | |
tree | 3cdde8685b2e69f689ac85a600a41a17782b9482 /jstests/hooks | |
parent | f263fb42124c7ab01a98c462eca63de85873aa7a (diff) | |
download | mongo-103972cebb1cdfccbc76c2afd82c824ed02fc11c.tar.gz |
SERVER-28590 Invoke validate command on collections before shutting down mongod in JS tests
Diffstat (limited to 'jstests/hooks')
-rw-r--r-- | jstests/hooks/validate_collections.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/jstests/hooks/validate_collections.js b/jstests/hooks/validate_collections.js index 3288f5ec5b6..bf2b7b06709 100644 --- a/jstests/hooks/validate_collections.js +++ b/jstests/hooks/validate_collections.js @@ -95,6 +95,16 @@ function validateCollections(db, obj) { var res = coll.validate(full); if (!res.ok || !res.valid) { + if (jsTest.options().skipValidationOnNamespaceNotFound && + res.errmsg === 'ns not found') { + // During a 'stopStart' backup/restore on the secondary node, the actual list of + // collections can be out of date if ops are still being applied from the oplog. In + // this case we skip the collection if the ns was not found at time of validation + // and continue to next. + print('Skipping collection validation for ' + coll.getFullName() + + ' since collection was not found'); + continue; + } print('Collection validation failed with response: ' + tojson(res)); dumpCollection(coll, 100); success = false; |