[SERVER-31908] validate_collections_on_shutdown does not run validate on all databases, only the last one Created: 10/Nov/17  Updated: 30/Oct/23  Resolved: 10/Nov/17

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: 3.5.9
Fix Version/s: 3.6.0-rc4

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Max Hirschhorn
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-28590 Call validate before any mongod is sh... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: TIG 2017-12-04
Participants:

 Description   

for (let dbName of dbNames) {
    cmds.then("DEBUG: validating " + dbName, function(conn) {
        if (!validateCollections(conn.getDB(dbName), {full: true})) {
            return {shouldStop: true, reason: "collection validation failed"};
        }
    });
}

The function above ends up using the last dbName for each run of the loop, rather than rebinding dbName for each value.



 Comments   
Comment by Githook User [ 10/Nov/17 ]

Author:

{'name': 'Max Hirschhorn', 'username': 'visemet', 'email': 'max.hirschhorn@mongodb.com'}

Message: SERVER-31908 Fix capture of dbName variable during validate on shutdown.

validateCollections() would otherwise run for the last database in
dbNames multiple times.
Branch: master
https://github.com/mongodb/mongo/commit/308a52b1dc7be91f36984b3cda376b9a7e76ece3

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