(function() {
|
'use strict';
|
|
load("jstests/libs/fail_point_util.js");
|
load("jstests/sharding/libs/resharding_test_fixture.js");
|
load("jstests/libs/discover_topology.js");
|
|
const reshardingTest = new ReshardingTest();
|
reshardingTest.setup();
|
|
const donorName = reshardingTest.donorShardNames[0];
|
const recipientName = reshardingTest.recipientShardNames[0];
|
const sourceCollection = reshardingTest.createShardedCollection({
|
ns: 'reshardingDb.coll',
|
shardKeyPattern: {oldKey: 1},
|
chunks: [
|
{min: {oldKey: MinKey}, max: {oldKey: MaxKey}, shard: donorName},
|
]
|
});
|
const mongos = sourceCollection.getMongo();
|
const topology = DiscoverTopology.findConnectedNodes(mongos);
|
const config = new Mongo(topology.configsvr.primary);
|
|
const hangBeforeRemovingStateDoc =
|
configureFailPoint(config, "reshardingPauseCoordinatorBeforeRemovingStateDoc");
|
|
reshardingTest.withReshardingInBackground(
|
{
|
newShardKeyPattern: {newKey: 1},
|
newChunks: [{min: {newKey: MinKey}, max: {newKey: MaxKey}, shard: recipientName}],
|
},
|
(tempNs) => {},
|
{
|
postDecisionPersistedFn: () => {
|
hangBeforeRemovingStateDoc.wait();
|
assert.commandWorked(config.adminCommand({replSetStepDown: 10, force: true}));
|
}
|
});
|
|
reshardingTest.teardown();
|
})();
|