summaryrefslogtreecommitdiff
path: root/shell/servers.js
diff options
context:
space:
mode:
Diffstat (limited to 'shell/servers.js')
-rw-r--r--shell/servers.js26
1 files changed, 23 insertions, 3 deletions
diff --git a/shell/servers.js b/shell/servers.js
index 7b306d7..eb548ea 100644
--- a/shell/servers.js
+++ b/shell/servers.js
@@ -993,6 +993,7 @@ ReplSetTest = function( opts ){
this.name = opts.name || "testReplSet";
this.host = opts.host || getHostName();
this.numNodes = opts.nodes || 0;
+ this.oplogSize = opts.oplogSize || 2;
this.useSeedList = opts.useSeedList || false;
this.bridged = opts.bridged || false;
@@ -1114,7 +1115,7 @@ ReplSetTest.prototype.getOptions = function( n , extra , putBinaryFirst ){
extra = {};
if ( ! extra.oplogSize )
- extra.oplogSize = "2";
+ extra.oplogSize = this.oplogSize;
var a = []
@@ -1124,8 +1125,12 @@ ReplSetTest.prototype.getOptions = function( n , extra , putBinaryFirst ){
a.push( "--replSet" );
-
- a.push( this.getURL() )
+ if( this.useSeedList ) {
+ a.push( this.getURL() );
+ }
+ else {
+ a.push( this.name );
+ }
a.push( "--noprealloc", "--smallfiles" );
@@ -1188,6 +1193,21 @@ ReplSetTest.prototype.callIsMaster = function() {
return master || false;
}
+ReplSetTest.prototype.awaitSecondaryNodes = function( timeout ) {
+ var master = this.getMaster();
+ var slaves = this.liveNodes.slaves;
+ var len = slaves.length;
+
+ this.attempt({context: this, timeout: 60000, desc: "Awaiting secondaries"}, function() {
+ var ready = true;
+ for(var i=0; i<len; i++) {
+ ready = ready && slaves[i].getDB("admin").runCommand({ismaster: 1})['secondary'];
+ }
+
+ return ready;
+ });
+}
+
ReplSetTest.prototype.getMaster = function( timeout ) {
var tries = 0;
var sleepTime = 500;