Permalink
Browse files

Merge branch 'v2.0' of github.com:mongodb/mongo into v2.0

  • Loading branch information...
2 parents 6b3ab0f + e74f554 commit 43fa534919634758b32353c77f18a4e608a39206 @erh erh committed Feb 6, 2012
View
@@ -823,17 +823,19 @@ def smoke_python_name():
# which we assume to be installed.
import subprocess
version = re.compile(r'[Pp]ython ([\d\.]+)', re.MULTILINE)
- binaries = ['python', 'python2.5', 'python2.6', 'python2.7', 'python25', 'python26', 'python27']
+ binaries = ['python2.5', 'python2.6', 'python2.7', 'python25', 'python26', 'python27', 'python']
for binary in binaries:
try:
# py-2.4 compatible replacement for shell backticks
- output = subprocess.Popen([binary, '--version'], stdout=subprocess.PIPE).communicate()[0]
- match = version.search(output)
- if match and float(match.group(1)) >= 2.5:
- return binary
+ out, err = subprocess.Popen([binary, '-V'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
+ for stream in (out, err):
+ match = version.search(stream)
+ if match:
+ versiontuple = tuple(map(int, match.group(1).split('.')))
+ if versiontuple >= (2, 5):
+ return binary
except:
pass
-
# if that all fails, fall back to "python"
return "python"
@@ -446,8 +446,6 @@ namespace mongo {
}
catch( DBException& e ){
warning() << "cannot connect to new host " << *i << " to replica set " << this->_name << causedBy( e ) << endl;
- delete newConn;
- newConn = NULL;
}
_nodes.push_back( Node( h , newConn ) );
@@ -458,6 +456,7 @@ namespace mongo {
bool ReplicaSetMonitor::_checkConnection( DBClientConnection * c , string& maybePrimary , bool verbose , int nodesOffset ) {
+ assert( c );
scoped_lock lk( _checkConnectionLock );
bool isMaster = false;
bool changed = false;
View
No changes.
@@ -43,6 +43,8 @@ function testReadLoadBalancing(numReplicas) {
assert.soon( function(){ return secondaries[i].getDB("test").foo.count() > 0; } )
secondaries[i].getDB('test').setProfilingLevel(2)
}
+ // Primary may change with reconfig
+ primary.getDB('test').setProfilingLevel(2)
for (var i = 0; i < secondaries.length * 10; i++) {
conn = new Mongo(s._mongos[0].host)
@@ -75,13 +77,21 @@ function testReadLoadBalancing(numReplicas) {
var x = rsStats();
printjson(x);
var numOk = 0;
+ // Now wait until the host disappears, since now we actually update our
+ // replica sets via isMaster in mongos
+ if( x.hosts.length == rs.conf()["members"].length - 1 ) return true
+ /*
for ( var i=0; i<x.hosts.length; i++ )
if ( x.hosts[i].hidden )
return true;
+ */
return false;
} , "one slave not ok" , 180000 , 5000
);
-
+
+ // Secondaries may change here
+ secondaries = s._rs[0].test.liveNodes.slaves
+
for (var i = 0; i < secondaries.length * 10; i++) {
conn = new Mongo(s._mongos[0].host)
conn.setSlaveOk()
@@ -95,7 +105,7 @@ function testReadLoadBalancing(numReplicas) {
}
counts = counts.sort();
- assert.eq( 20 , counts[1] - counts[0] , "counts wrong: " + tojson( counts ) );
+ assert.eq( 20 , Math.abs( counts[1] - counts[0] ), "counts wrong: " + tojson( counts ) );
s.stop()
}
@@ -11,4 +11,4 @@ def configure( env , fileLists , options ):
fileLists["serverOnlyFiles"] += [ myenv.Object(f) for f in files ]
def configureSystem( env , fileLists , options ):
- configure( env , fileLists , options )
+ env.Append( LIBS=[ "snappy" ] )

0 comments on commit 43fa534

Please sign in to comment.