[SERVER-33068] run_check_repl_dbhash.js hook exits without actually running dbhash on a replica set Created: 02/Feb/18  Updated: 29/Oct/23  Resolved: 03/Feb/18

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.4.15, 3.6.3, 3.7.2

Type: Bug Priority: Critical - P2
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Duplicate
is duplicated by SERVER-33498 ReplSetTest.checkReplicaSet fails whe... Closed
is duplicated by SERVER-24541 Add a test suite to test the JS hooks Closed
Problem/Incident
causes SERVER-34667 data_consistency_checks.js incorrectl... Closed
is caused by SERVER-21630 Expand resmoke's CheckReplDBHash supp... Closed
Related
related to SERVER-37197 Validation failure does not cause tes... Closed
related to SERVER-53854 checkReplicatedDataHashes() may retur... Closed
related to SERVER-34178 Address lingering issues around TestD... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6, v3.4
Sprint: TIG 2018-02-12
Participants:

 Description   

The changes from b9decc4 as part of SERVER-21630 introduced a bug that causes the dbhash check to always be skipped on a replica set no matter how many voting secondaries it has.

Inside the isMultiNodeReplSet() function, the handling for when the isMaster response indicates the server is part of replica set shadows the outer hosts variable with another let declaration, thereby causing the array of connection strings to always be empty.

function isMultiNodeReplSet(uri) {
    const mongo = new Mongo(uri);
    let hosts = [];
    const isMaster = mongo.adminCommand({isMaster: 1});
    if (isMaster.hasOwnProperty('setName')) {
        let hosts = isMaster.hosts;
        if (isMaster.hasOwnProperty('passives')) {
            hosts = hosts.concat(isMaster.passives);
        }
    }
    return hosts.length > 1;
}

Note: JavaScripts that call ReplSetTest#checkReplicatedDataHashes() (e.g. from the work in SERVER-25640) aren't affected by this issue.



 Comments   
Comment by Githook User [ 25/Mar/18 ]

Author:

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

Message: SERVER-33068 Fix run_check_repl_dbhash.js hook to actually run dbhash.

Consolidates the logic in the run_check_repl_dbhash.js and
run_validate_collections.js for discovering all of the mongod processes
in a MongoDB deployment into a new discover_topology.js library.

Also adds a test that relies on mongod logging to verify that the
run_check_repl_dbhash.js and run_validate_collections.js hooks execute
on all of the expected servers.

(cherry picked from commit 64bed8173387fbafcfcf39bfb9aa6cecadf25822)
Branch: v3.4
https://github.com/mongodb/mongo/commit/30e5511cd29b2d5f19b7746d6b6a9d1b32724002

Comment by Githook User [ 11/Feb/18 ]

Author:

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

Message: SERVER-33068 Fix run_check_repl_dbhash.js hook to actually run dbhash.

Consolidates the logic in the run_check_repl_dbhash.js and
run_validate_collections.js for discovering all of the mongod processes
in a MongoDB deployment into a new discover_topology.js library.

Also adds a test that relies on mongod logging to verify that the
run_check_repl_dbhash.js and run_validate_collections.js hooks execute
on all of the expected servers.

(cherry picked from commit 64bed8173387fbafcfcf39bfb9aa6cecadf25822)
Branch: v3.6
https://github.com/mongodb/mongo/commit/d6dcfd2710fbdb2d641026449348bab738a8974d

Comment by Githook User [ 03/Feb/18 ]

Author:

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

Message: SERVER-33068 Fix run_check_repl_dbhash.js hook to actually run dbhash.

Consolidates the logic in the run_check_repl_dbhash.js and
run_validate_collections.js for discovering all of the mongod processes
in a MongoDB deployment into a new discover_topology.js library.

Also adds a test that relies on mongod logging to verify that the
run_check_repl_dbhash.js and run_validate_collections.js hooks execute
on all of the expected servers.
Branch: master
https://github.com/mongodb/mongo/commit/64bed8173387fbafcfcf39bfb9aa6cecadf25822

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