summaryrefslogtreecommitdiff
path: root/jstests/sharding/prefix_shard_key.js
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@10gen.com>2016-02-26 10:26:54 -0500
committerDianna Hohensee <dianna.hohensee@10gen.com>2016-02-26 17:10:54 -0500
commit66746f4654189fa633066f2a353c66279d3cadab (patch)
tree3e48a760d220b46d6c40d143f85c920feeb630c6 /jstests/sharding/prefix_shard_key.js
parent7f7a64a1d6ef791d3b111245301d73902e9e4875 (diff)
downloadmongo-66746f4654189fa633066f2a353c66279d3cadab.tar.gz
SERVER-22870 rename getServerName and getServer
Diffstat (limited to 'jstests/sharding/prefix_shard_key.js')
-rw-r--r--jstests/sharding/prefix_shard_key.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/jstests/sharding/prefix_shard_key.js b/jstests/sharding/prefix_shard_key.js
index a473be73cb4..6e906add822 100644
--- a/jstests/sharding/prefix_shard_key.js
+++ b/jstests/sharding/prefix_shard_key.js
@@ -68,8 +68,10 @@ printjson( result2 );
assert.eq( 1, result2.ok , "splitting didn't succeed");
//test moving
-var result3 = admin.runCommand({ movechunk: coll.getFullName(), find: { num: 20 },
- to: s.getOther(s.getServer("test")).name, _waitForDelete: true });
+var result3 = admin.runCommand({ movechunk: coll.getFullName(),
+ find: { num: 20 },
+ to: s.getOther(s.getPrimaryShard("test")).name,
+ _waitForDelete: true });
printjson( result3 );
assert.eq( 1, result3.ok , "moveChunk didn't succeed");
@@ -97,7 +99,7 @@ for (var docs = 0; docs < 1000; docs++) {
assert.eq(1000, db.user.find().itcount());
var result4 = admin.runCommand({ movechunk: 'test.user', find: { num: 70 },
- to: s.getOther(s.getServer("test")).name, _waitForDelete: true });
+ to: s.getOther(s.getPrimaryShard("test")).name, _waitForDelete: true });
assert.commandWorked(result4);
var expectedShardCount = { shard0000: 0, shard0001: 0 };
@@ -137,7 +139,7 @@ for( i=0; i < 3; i++ ){
// setup new collection on shard0
var coll2 = db.foo2;
coll2.drop();
- if ( s.getServerName( coll2.getDB() ) != shards[0]._id ) {
+ if ( s.getPrimaryShardIdForDatabase( coll2.getDB() ) != shards[0]._id ) {
var moveRes = admin.runCommand( { movePrimary : coll2.getDB() + "", to : shards[0]._id } );
assert.eq( moveRes.ok , 1 , "primary not moved correctly" );
}