diff --git a/jstests/repl/mastermaster1.js b/jstests/repl/mastermaster1.js index 4932d5a55b6..564aa7c6a25 100644 --- a/jstests/repl/mastermaster1.js +++ b/jstests/repl/mastermaster1.js @@ -4,30 +4,41 @@ ports = allocatePorts( 2 ) left = startMongodTest( ports[0] , "mastermaster1left" , false , { master : "" , slave : "" , source : "127.0.0.1:" + ports[1] } ) -right = startMongodTest( ports[1] , "mastermaster1left" , false , { master : "" , slave : "" , source : "127.0.0.1:" + ports[0] } ) - -print( "check 1" ) x = left.getDB( "admin" ).runCommand( "ismaster" ) assert( x.ismaster , "left: " + tojson( x ) ) +right = startMongodTest( ports[1] , "mastermaster1right" , false , { master : "" , slave : "" , source : "127.0.0.1:" + ports[0] } ) + x = right.getDB( "admin" ).runCommand( "ismaster" ) assert( x.ismaster , "right: " + tojson( x ) ) +print( "check 1" ) + + ldb = left.getDB( "test" ) rdb = right.getDB( "test" ) print( "check 2" ) ldb.foo.insert( { _id : 1 , x : "eliot" } ) -var result = ldb.runCommand( { getlasterror : 1 , w : 2 , wtimeout : 20000 } ); +result = ldb.runCommand( { getlasterror : 1 , w : 2 , wtimeout : 40000 } ); printjson(result); rdb.foo.insert( { _id : 2 , x : "sara" } ) -result = rdb.runCommand( { getlasterror : 1 , w : 2 , wtimeout : 20000 } ) +result = rdb.runCommand( { getlasterror : 1 , w : 2 , wtimeout : 40000 } ) printjson(result); print( "check 3" ) +print( "left" ) +ldb.foo.find().forEach( printjsononeline ) +print( "right" ) +rdb.foo.find().forEach( printjsononeline ) + +print( "oplog" ) + +rdb.getSisterDB( "local" ).getCollection( "oplog.$main" ).find().forEach( printjsononeline ) + assert.eq( 2 , ldb.foo.count() , "B1" ) assert.eq( 2 , rdb.foo.count() , "B2" ) diff --git a/shell/dbshell.cpp b/shell/dbshell.cpp index 3039ad178ee..6b9a99b9221 100644 --- a/shell/dbshell.cpp +++ b/shell/dbshell.cpp @@ -18,7 +18,7 @@ #include "pch.h" #include -#ifndef _WIN32 +#ifndef WIN32 #define USE_LINENOISE extern "C" { #include "../third_party/linenoise/linenoise.h"