diff options
author | Allison Easton <allison.easton@mongodb.com> | 2022-03-03 09:28:33 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-03 09:54:21 +0000 |
commit | 1b5a42d1032b0004ce64e704c353a7774871184d (patch) | |
tree | 6651a7137454e5fdcf727b3a3ea1664d5dce27ee /jstests/concurrency | |
parent | 92d3d8026fd0ad28b6416524a146f9a82a67d628 (diff) | |
download | mongo-1b5a42d1032b0004ce64e704c353a7774871184d.tar.gz |
SERVER-63911 Allow balancer to run and re-run defragmentation at the end of collection_defragmentation.js
Diffstat (limited to 'jstests/concurrency')
-rw-r--r-- | jstests/concurrency/fsm_workloads/collection_defragmentation.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/jstests/concurrency/fsm_workloads/collection_defragmentation.js b/jstests/concurrency/fsm_workloads/collection_defragmentation.js index 625937d2763..9abfd261541 100644 --- a/jstests/concurrency/fsm_workloads/collection_defragmentation.js +++ b/jstests/concurrency/fsm_workloads/collection_defragmentation.js @@ -220,7 +220,26 @@ var $config = (function() { const dbName = dbPrefix + i; for (let j = 0; j < collCount; j++) { const fullNs = dbName + "." + collPrefix + j; + // Wait for defragmentation to complete defragmentationUtil.waitForEndOfDefragmentation(mongos, fullNs); + // Enable balancing and wait for balanced + assertAlways.commandWorked(mongos.getDB('config').collections.update( + {_id: fullNs}, {$set: {"noBalance": false}})); + assertAlways.soon(function() { + let res = mongos.adminCommand({balancerCollectionStatus: fullNs}); + assertAlways.commandWorked(res); + return res.balancerCompliant; + }); + // Begin defragmentation again + assertAlways.commandWorked(mongos.adminCommand({ + configureCollectionBalancing: fullNs, + defragmentCollection: true, + chunkSize: maxChunkSizeMB, + })); + // Wait for defragmentation to complete and check final state + defragmentationUtil.waitForEndOfDefragmentation(mongos, fullNs); + defragmentationUtil.checkPostDefragmentationState( + mongos, fullNs, maxChunkSizeMB, "key"); } } } |