diff options
author | clang-format-7.0.1 <adam.martin@10gen.com> | 2019-07-26 18:20:35 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-07-27 11:02:23 -0400 |
commit | 134a4083953270e8a11430395357fb70a29047ad (patch) | |
tree | dd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /jstests/sharding/addshard5.js | |
parent | 1e46b5049003f427047e723ea5fab15b5a9253ca (diff) | |
download | mongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz |
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'jstests/sharding/addshard5.js')
-rw-r--r-- | jstests/sharding/addshard5.js | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/jstests/sharding/addshard5.js b/jstests/sharding/addshard5.js index f2e6068d023..31d2c10f505 100644 --- a/jstests/sharding/addshard5.js +++ b/jstests/sharding/addshard5.js @@ -1,46 +1,46 @@ // Tests that dropping and re-adding a shard with the same name to a cluster doesn't mess up // migrations (function() { - 'use strict'; +'use strict'; - var st = new ShardingTest({shards: 2, mongos: 1}); +var st = new ShardingTest({shards: 2, mongos: 1}); - var mongos = st.s; - var admin = mongos.getDB('admin'); - var coll = mongos.getCollection('foo.bar'); +var mongos = st.s; +var admin = mongos.getDB('admin'); +var coll = mongos.getCollection('foo.bar'); - // Shard collection - assert.commandWorked(mongos.adminCommand({enableSharding: coll.getDB() + ''})); +// Shard collection +assert.commandWorked(mongos.adminCommand({enableSharding: coll.getDB() + ''})); - // Just to be sure what primary we start from - st.ensurePrimaryShard(coll.getDB().getName(), st.shard0.shardName); - assert.commandWorked(mongos.adminCommand({shardCollection: coll + '', key: {_id: 1}})); +// Just to be sure what primary we start from +st.ensurePrimaryShard(coll.getDB().getName(), st.shard0.shardName); +assert.commandWorked(mongos.adminCommand({shardCollection: coll + '', key: {_id: 1}})); - // Insert one document - assert.writeOK(coll.insert({hello: 'world'})); +// Insert one document +assert.writeOK(coll.insert({hello: 'world'})); - // Migrate the collection to and from shard1 so shard0 loads the shard1 host - assert.commandWorked(mongos.adminCommand( - {moveChunk: coll + '', find: {_id: 0}, to: st.shard1.shardName, _waitForDelete: true})); - assert.commandWorked(mongos.adminCommand( - {moveChunk: coll + '', find: {_id: 0}, to: st.shard0.shardName, _waitForDelete: true})); +// Migrate the collection to and from shard1 so shard0 loads the shard1 host +assert.commandWorked(mongos.adminCommand( + {moveChunk: coll + '', find: {_id: 0}, to: st.shard1.shardName, _waitForDelete: true})); +assert.commandWorked(mongos.adminCommand( + {moveChunk: coll + '', find: {_id: 0}, to: st.shard0.shardName, _waitForDelete: true})); - // Drop and re-add shard with the same name but a new host. - assert.commandWorked(mongos.adminCommand({removeShard: st.shard1.shardName})); - assert.commandWorked(mongos.adminCommand({removeShard: st.shard1.shardName})); +// Drop and re-add shard with the same name but a new host. +assert.commandWorked(mongos.adminCommand({removeShard: st.shard1.shardName})); +assert.commandWorked(mongos.adminCommand({removeShard: st.shard1.shardName})); - var shard2 = MongoRunner.runMongod({'shardsvr': ''}); - assert.commandWorked(mongos.adminCommand({addShard: shard2.host, name: st.shard1.shardName})); +var shard2 = MongoRunner.runMongod({'shardsvr': ''}); +assert.commandWorked(mongos.adminCommand({addShard: shard2.host, name: st.shard1.shardName})); - jsTest.log('Shard was dropped and re-added with same name...'); - st.printShardingStatus(); +jsTest.log('Shard was dropped and re-added with same name...'); +st.printShardingStatus(); - // Try a migration - assert.commandWorked( - mongos.adminCommand({moveChunk: coll + '', find: {_id: 0}, to: st.shard1.shardName})); +// Try a migration +assert.commandWorked( + mongos.adminCommand({moveChunk: coll + '', find: {_id: 0}, to: st.shard1.shardName})); - assert.eq('world', shard2.getCollection(coll + '').findOne().hello); +assert.eq('world', shard2.getCollection(coll + '').findOne().hello); - st.stop(); - MongoRunner.stopMongod(shard2); +st.stop(); +MongoRunner.stopMongod(shard2); })(); |