summaryrefslogtreecommitdiff
path: root/jstests/concurrency
diff options
context:
space:
mode:
authorPaolo Polato <paolo.polato@mongodb.com>2022-05-16 14:26:43 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-16 15:35:11 +0000
commit4afa98e3a445ee7f6738c8717f7283c2ef6eeefd (patch)
tree8270cc2962820fc48835e81f3dbea3b86d1daeb6 /jstests/concurrency
parent9b3509a2217da69cca3e549a164ac7e6e26902d0 (diff)
downloadmongo-4afa98e3a445ee7f6738c8717f7283c2ef6eeefd.tar.gz
SERVER-65956 fix minor bugs in defragmentation source code/tests
Diffstat (limited to 'jstests/concurrency')
-rw-r--r--jstests/concurrency/fsm_libs/cluster.js5
-rw-r--r--jstests/concurrency/fsm_workloads/collection_defragmentation.js2
2 files changed, 6 insertions, 1 deletions
diff --git a/jstests/concurrency/fsm_libs/cluster.js b/jstests/concurrency/fsm_libs/cluster.js
index 5cf6c7facff..381131e2b54 100644
--- a/jstests/concurrency/fsm_libs/cluster.js
+++ b/jstests/concurrency/fsm_libs/cluster.js
@@ -319,6 +319,11 @@ var Cluster = function(options) {
});
};
+ this.getConfigPrimaryNode = function getConfigPrimaryNode() {
+ assert(initialized, 'cluster must be initialized first');
+ return st._configsvr.getPrimary();
+ };
+
this.synchronizeMongosClusterTimes = function synchronizeMongosClusterTimes() {
const contactConfigServerFn = ((mongosConn) => {
// The admin database is hosted on the config server.
diff --git a/jstests/concurrency/fsm_workloads/collection_defragmentation.js b/jstests/concurrency/fsm_workloads/collection_defragmentation.js
index 9d651a3566b..90f7e3de9c8 100644
--- a/jstests/concurrency/fsm_workloads/collection_defragmentation.js
+++ b/jstests/concurrency/fsm_workloads/collection_defragmentation.js
@@ -239,7 +239,7 @@ var $config = (function() {
// Wait for defragmentation to complete and check final state
defragmentationUtil.waitForEndOfDefragmentation(mongos, fullNs);
defragmentationUtil.checkPostDefragmentationState(
- mongos, fullNs, maxChunkSizeMB, "key");
+ cluster.getConfigPrimaryNode(), mongos, fullNs, maxChunkSizeMB, "key");
// Resume original throttling value
cluster.executeOnConfigNodes((db) => {
assert.commandWorked(db.adminCommand({