summaryrefslogtreecommitdiff
path: root/jstests/sharding/global_index_feature_flagging.js
blob: 314e1dfbb4b58b18dfe20dcdb5f1172d4a702db1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
 * Tests that the serverStatus output does not contain a globalIndex section when the feature flag
 * is off.
 * @tags: [
 * requires_fcv_61, featureFlagGlobalIndexes, multiversion_incompatible
 * ]
 */
(function() {
"use strict";

delete TestData.setParameters.featureFlagGlobalIndexes;
delete TestData.setParametersMongos.featureFlagGlobalIndexes;

// Default value of the featureFlagGlobalIndexes is false
const st = new ShardingTest({
    mongos: 1,
    mongosOptions: {setParameter: {featureFlagGlobalIndexes: false}},
    config: 1,
    configOptions: {setParameter: {featureFlagGlobalIndexes: false}},
    shards: 1,
    rs: {nodes: 1},
    rsOptions: {setParameter: {featureFlagGlobalIndexes: false}},
});
const configPrimary = st.configRS.getPrimary();
const serverStatusCmd = ({serverStatus: 1, shardingStatistics: 1});
let res = assert.commandWorked(configPrimary.adminCommand(serverStatusCmd));
assert(!res.shardingStatistics.hasOwnProperty("globalIndex"), res.shardingStatistics);

const shardPrimary = st.shard0.rs.getPrimary();
res = assert.commandWorked(shardPrimary.adminCommand(serverStatusCmd));
assert(!res.shardingStatistics.hasOwnProperty("globalIndex"), res.shardingStatistics);

st.stop();
})();