1- if ( 0 ) { // disabled due to SERVER-3650
1+ if ( 1 ) { // SERVER-3650
22
33var num = 7 ;
44var host = getHostName ( ) ;
@@ -45,25 +45,26 @@ replTest.partition(2,5)
4545replTest . partition ( 2 , 6 )
4646printjson ( { endPartition : new Date ( ) } ) ;
4747
48- var gotOneThrough = false
48+ var gotThrough = 0
4949try {
5050 while ( true ) {
5151 mColl . insert ( { } )
52- out = master . adminCommand ( { getLastError :1 } ) ;
52+ out = master . adminCommand ( { getLastError :1 , w : 3 } ) ;
5353 if ( out . err )
5454 break ;
5555
56- gotOneThrough = true ;
56+ gotThrough ++ ;
5757 }
5858}
5959catch ( e ) {
6060 print ( "caught exception" ) ;
6161}
6262
63+ printjson ( { gotThrough : gotThrough } ) ;
6364printjson ( { cantWriteOldPrimary : new Date ( ) } ) ;
6465printjson ( master . adminCommand ( "replSetGetStatus" ) ) ;
6566
66- assert ( gotOneThrough , "gotOneThrough" ) ;
67+ assert ( gotThrough > 0 , "gotOneThrough" ) ;
6768
6869sleep ( 5 * 1000 ) ; // make sure new seconds field in opTime
6970
@@ -78,6 +79,8 @@ m2Coll.insert(sentinel);
7879printjson ( master2 . adminCommand ( { getLastError :1 , w :4 , wtimeout :30 * 1000 } ) ) ;
7980printjson ( master2 . adminCommand ( "replSetGetStatus" ) ) ;
8081
82+ m2Coll . insert ( { } ) ; // this shouldn't be necessary but the next GLE doesn't work without it
83+
8184printjson ( { startUnPartition : new Date ( ) } ) ;
8285replTest . unPartition ( 0 , 3 )
8386replTest . unPartition ( 0 , 4 )
@@ -93,10 +96,14 @@ replTest.unPartition(2,5)
9396replTest . unPartition ( 2 , 6 )
9497printjson ( { endUnPartition : new Date ( ) } ) ;
9598
96- m2Coll . insert ( { } ) ; // this shouldn't be necessary but the next line doesn't work without it
9799printjson ( master2 . adminCommand ( { getLastError :1 , w :7 , wtimeout :30 * 1000 } ) ) ;
98100printjson ( master2 . adminCommand ( "replSetGetStatus" ) ) ;
99101
102+ assert . soon ( function ( ) { return master . adminCommand ( 'isMaster' ) . ismaster } ,
103+ "Node 0 back to primary" ,
104+ 60 * 1000 /*needs to be longer than LeaseTime*/ ) ;
105+ printjson ( master . adminCommand ( "replSetGetStatus" ) ) ;
106+
100107// make sure old master rolled back to new master
101108assert . eq ( m2Coll . count ( sentinel ) , 1 , "check sentinal on node 6" ) ;
102109assert . eq ( mColl . count ( sentinel ) , 1 , "check sentinal on node 0" ) ;
0 commit comments