jstests/replsets/set_cluster_parameter_replset.js
// as part of initial sync.
as part of initial sync.
as part of initial sync .
function checkClusterParameterInitialSync(rst) {
    let newIntParameter = {
        _id: "testIntClusterParameter",
        intData: 5,
    };
    let newStrParameter = {
        _id: "testStrClusterParameter",
        strData: "on",
    };
    runSetClusterParameter(rst.getPrimary(), newIntParameter);
    runSetClusterParameter(rst.getPrimary(), newStrParameter);
    runGetClusterParameterReplicaSet(rst,
                                     ["testIntClusterParameter", "testStrClusterParameter"],
                                     [newIntParameter, newStrParameter]);
    const newNode = rst.add({});
    rst.reInitiate();
    rst.waitForState(newNode, ReplSetTest.State.SECONDARY);
    rst.awaitReplication();
    runGetClusterParameterNode(newNode,
                               ["testIntClusterParameter", "testStrClusterParameter"],
                               [newIntParameter, newStrParameter]);
    newIntParameter.intData = 30;
    newStrParameter.strData = "sleep";
    runSetClusterParameter(rst.getPrimary(), newIntParameter);
    runSetClusterParameter(rst.getPrimary(), newStrParameter);
    runGetClusterParameterReplicaSet(rst,
                                     ["testIntClusterParameter", "testStrClusterParameter"],
                                     [newIntParameter, newStrParameter]);
}
function checkClusterParameterInitialSync ( rst ) { let newIntParameter = { _id : "testIntClusterParameter" , intData : 5 , } ; let newStrParameter = { _id : "testStrClusterParameter" , strData : "on" , } ; runSetClusterParameter ( rst . getPrimary ( ) , newIntParameter ) ; runSetClusterParameter ( rst . getPrimary ( ) , newStrParameter ) ; runGetClusterParameterReplicaSet ( rst , [ "testIntClusterParameter" , "testStrClusterParameter" ] , [ newIntParameter , newStrParameter ] ) ; const newNode = rst . add ( { } ) ; rst . reInitiate ( ) ; rst . waitForState ( newNode , ReplSetTest . State . SECONDARY ) ; rst . awaitReplication ( ) ; runGetClusterParameterNode ( newNode , [ "testIntClusterParameter" , "testStrClusterParameter" ] , [ newIntParameter , newStrParameter ] ) ; newIntParameter . intData = 30 ; newStrParameter . strData = "sleep" ; runSetClusterParameter ( rst . getPrimary ( ) , newIntParameter ) ; runSetClusterParameter ( rst . getPrimary ( ) , newStrParameter ) ; runGetClusterParameterReplicaSet ( rst , [ "testIntClusterParameter" , "testStrClusterParameter" ] , [ newIntParameter , newStrParameter ] ) ; }
as part of initial sync.
as part of initial sync .
// Update some parameter values. // Check that the new values are visible on the majority of the nodes. // Add a new node to the replica set, reinitiate the set, and wait for it to become a secondary // with all data fully replicated to it. // Check that the new node has the latest cluster parameter values. // Check that setClusterParameter properly works with the reconfigured replica set. // Check that the new values are visible on the majority of the nodes.