summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheahuychou Mao <mao.cheahuychou@gmail.com>2023-02-08 21:17:47 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-09 07:14:21 +0000
commit183748b052afa6fecdc42a2a72c0327964ddbd13 (patch)
treecdf5108b30433d66640c1f7f2cbd8e969d7eee26
parent467980502d5649fbc0d553aeb53646617b063e92 (diff)
downloadmongo-183748b052afa6fecdc42a2a72c0327964ddbd13.tar.gz
SERVER-73624 Not disable the periodic index consistency checker in query sampling tests
-rw-r--r--jstests/sharding/analyze_shard_key/libs/query_sampling_util.js6
-rw-r--r--jstests/sharding/analyze_shard_key/sample_nested_agg_queries_sharded.js8
-rw-r--r--jstests/sharding/analyze_shard_key/sample_nested_agg_queries_unsharded.js8
-rw-r--r--jstests/sharding/analyze_shard_key/sample_read_queries_sharded.js8
-rw-r--r--jstests/sharding/analyze_shard_key/sample_read_queries_unsharded.js8
-rw-r--r--jstests/sharding/analyze_shard_key/sample_write_queries_sharded.js8
-rw-r--r--jstests/sharding/analyze_shard_key/sample_write_queries_unsharded.js8
7 files changed, 11 insertions, 43 deletions
diff --git a/jstests/sharding/analyze_shard_key/libs/query_sampling_util.js b/jstests/sharding/analyze_shard_key/libs/query_sampling_util.js
index a20f370a775..05fa68cc15b 100644
--- a/jstests/sharding/analyze_shard_key/libs/query_sampling_util.js
+++ b/jstests/sharding/analyze_shard_key/libs/query_sampling_util.js
@@ -28,7 +28,6 @@ var QuerySamplingUtil = (function() {
/**
* Waits for the given node to have one active collection for query sampling.
- * Throws if the featureFlagAnalyzeShardKey is not set.
*/
function waitForActiveSampling(node) {
assert.soon(() => {
@@ -36,6 +35,8 @@ var QuerySamplingUtil = (function() {
assert(res.hasOwnProperty("queryAnalyzers"));
return res.queryAnalyzers.activeCollections == 1;
});
+ // Wait for the bucket to contain at least one second of tokens.
+ sleep(1000);
}
/**
@@ -56,10 +57,13 @@ var QuerySamplingUtil = (function() {
rs.nodes.forEach(node => {
assert.soon(() => {
const res = assert.commandWorked(node.adminCommand({serverStatus: 1}));
+ assert(res.hasOwnProperty("queryAnalyzers"));
return res.queryAnalyzers.activeCollections == 1;
});
});
});
+ // Wait for the bucket to contain at least one second of tokens.
+ sleep(1000);
}
/**
diff --git a/jstests/sharding/analyze_shard_key/sample_nested_agg_queries_sharded.js b/jstests/sharding/analyze_shard_key/sample_nested_agg_queries_sharded.js
index 1359f340256..a877544c253 100644
--- a/jstests/sharding/analyze_shard_key/sample_nested_agg_queries_sharded.js
+++ b/jstests/sharding/analyze_shard_key/sample_nested_agg_queries_sharded.js
@@ -23,13 +23,7 @@ const st = new ShardingTest({
// Disable query sampling on mongos to verify that the nested aggregate queries are sampled by
// the shard that routes them.
mongosOptions:
- {setParameter: {"failpoint.disableQueryAnalysisSampler": tojson({mode: "alwaysOn"})}},
- other: {
- // Disable periodic index checker so its aggregate isn't incorrectly sampled. This is only a
- // problem when the catalog shard feature flag is enabled because otherwise the config
- // server fails the "supportsSamplingQueries()" check.
- configOptions: {setParameter: {enableShardedIndexConsistencyCheck: false}},
- }
+ {setParameter: {"failpoint.disableQueryAnalysisSampler": tojson({mode: "alwaysOn"})}}
});
const dbName = "testDb";
diff --git a/jstests/sharding/analyze_shard_key/sample_nested_agg_queries_unsharded.js b/jstests/sharding/analyze_shard_key/sample_nested_agg_queries_unsharded.js
index 694665f55ba..9507755e252 100644
--- a/jstests/sharding/analyze_shard_key/sample_nested_agg_queries_unsharded.js
+++ b/jstests/sharding/analyze_shard_key/sample_nested_agg_queries_unsharded.js
@@ -23,13 +23,7 @@ const st = new ShardingTest({
// Disable query sampling on mongos to verify that the nested aggregate queries are sampled by
// the shard that routes them.
mongosOptions:
- {setParameter: {"failpoint.disableQueryAnalysisSampler": tojson({mode: "alwaysOn"})}},
- other: {
- // Disable periodic index checker so its aggregate isn't incorrectly sampled. This is only a
- // problem when the catalog shard feature flag is enabled because otherwise the config
- // server fails the "supportsSamplingQueries()" check.
- configOptions: {setParameter: {enableShardedIndexConsistencyCheck: false}},
- }
+ {setParameter: {"failpoint.disableQueryAnalysisSampler": tojson({mode: "alwaysOn"})}}
});
const dbName = "testDb";
diff --git a/jstests/sharding/analyze_shard_key/sample_read_queries_sharded.js b/jstests/sharding/analyze_shard_key/sample_read_queries_sharded.js
index 1e61dd23afd..b9757a6feea 100644
--- a/jstests/sharding/analyze_shard_key/sample_read_queries_sharded.js
+++ b/jstests/sharding/analyze_shard_key/sample_read_queries_sharded.js
@@ -17,13 +17,7 @@ const st = new ShardingTest({
setParameter:
{queryAnalysisWriterIntervalSecs: 1, logComponentVerbosity: tojson({verbosity: 2})}
},
- mongosOptions: {setParameter: {queryAnalysisSamplerConfigurationRefreshSecs: 1}},
- other: {
- // Disable periodic index checker so its aggregate isn't incorrectly sampled. This is only a
- // problem when the catalog shard feature flag is enabled because otherwise the config
- // server fails the "supportsSamplingQueries()" check.
- configOptions: {setParameter: {enableShardedIndexConsistencyCheck: false}},
- }
+ mongosOptions: {setParameter: {queryAnalysisSamplerConfigurationRefreshSecs: 1}}
});
const dbName = "testDb";
diff --git a/jstests/sharding/analyze_shard_key/sample_read_queries_unsharded.js b/jstests/sharding/analyze_shard_key/sample_read_queries_unsharded.js
index 156eedb219c..be96cff6a3f 100644
--- a/jstests/sharding/analyze_shard_key/sample_read_queries_unsharded.js
+++ b/jstests/sharding/analyze_shard_key/sample_read_queries_unsharded.js
@@ -18,13 +18,7 @@ const st = new ShardingTest({
setParameter:
{queryAnalysisWriterIntervalSecs: 1, logComponentVerbosity: tojson({verbosity: 2})}
},
- mongosOptions: {setParameter: {queryAnalysisSamplerConfigurationRefreshSecs: 1}},
- other: {
- // Disable periodic index checker so its aggregate isn't incorrectly sampled. This is only a
- // problem when the catalog shard feature flag is enabled because otherwise the config
- // server fails the "supportsSamplingQueries()" check.
- configOptions: {setParameter: {enableShardedIndexConsistencyCheck: false}},
- }
+ mongosOptions: {setParameter: {queryAnalysisSamplerConfigurationRefreshSecs: 1}}
});
const dbName = "testDb";
diff --git a/jstests/sharding/analyze_shard_key/sample_write_queries_sharded.js b/jstests/sharding/analyze_shard_key/sample_write_queries_sharded.js
index 0314937e610..574f7500268 100644
--- a/jstests/sharding/analyze_shard_key/sample_write_queries_sharded.js
+++ b/jstests/sharding/analyze_shard_key/sample_write_queries_sharded.js
@@ -17,13 +17,7 @@ const st = new ShardingTest({
setParameter:
{queryAnalysisWriterIntervalSecs: 1, logComponentVerbosity: tojson({verbosity: 2})}
},
- mongosOptions: {setParameter: {queryAnalysisSamplerConfigurationRefreshSecs: 1}},
- other: {
- // Disable periodic index checker so its aggregate isn't incorrectly sampled. This is only a
- // problem when the catalog shard feature flag is enabled because otherwise the config
- // server fails the "supportsSamplingQueries()" check.
- configOptions: {setParameter: {enableShardedIndexConsistencyCheck: false}},
- }
+ mongosOptions: {setParameter: {queryAnalysisSamplerConfigurationRefreshSecs: 1}}
});
const dbName = "testDb";
diff --git a/jstests/sharding/analyze_shard_key/sample_write_queries_unsharded.js b/jstests/sharding/analyze_shard_key/sample_write_queries_unsharded.js
index 1032cab5307..ba9ff505bab 100644
--- a/jstests/sharding/analyze_shard_key/sample_write_queries_unsharded.js
+++ b/jstests/sharding/analyze_shard_key/sample_write_queries_unsharded.js
@@ -18,13 +18,7 @@ const st = new ShardingTest({
setParameter:
{queryAnalysisWriterIntervalSecs: 1, logComponentVerbosity: tojson({verbosity: 2})}
},
- mongosOptions: {setParameter: {queryAnalysisSamplerConfigurationRefreshSecs: 1}},
- other: {
- // Disable periodic index checker so its aggregate isn't incorrectly sampled. This is only a
- // problem when the catalog shard feature flag is enabled because otherwise the config
- // server fails the "supportsSamplingQueries()" check.
- configOptions: {setParameter: {enableShardedIndexConsistencyCheck: false}},
- }
+ mongosOptions: {setParameter: {queryAnalysisSamplerConfigurationRefreshSecs: 1}}
});
const dbName = "testDb";