summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-02-06 00:47:36 -0500
committerEliot Horowitz <eliot@10gen.com>2012-02-06 00:47:36 -0500
commit43fa534919634758b32353c77f18a4e608a39206 (patch)
treebc13e109cc268bc83ced5441dd6b3e01a81535a2
parent6b3ab0f6e12da01b2443664534e655aa70685c52 (diff)
parente74f5546d554f8de441b62f264c73ea86913c4f8 (diff)
downloadmongo-43fa534919634758b32353c77f18a4e608a39206.tar.gz
Merge branch 'v2.0' of github.com:mongodb/mongo into v2.0
-rw-r--r--SConstruct14
-rw-r--r--client/dbclient_rs.cpp3
-rw-r--r--[-rwxr-xr-x]jstests/sharding/sharding_with_keyfile.key0
-rw-r--r--jstests/slowNightly/replReads.js14
-rw-r--r--third_party/snappy.py2
5 files changed, 22 insertions, 11 deletions
diff --git a/SConstruct b/SConstruct
index 4349159786f..55d234343fc 100644
--- a/SConstruct
+++ b/SConstruct
@@ -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"
diff --git a/client/dbclient_rs.cpp b/client/dbclient_rs.cpp
index dccaf571a4f..0189700db02 100644
--- a/client/dbclient_rs.cpp
+++ b/client/dbclient_rs.cpp
@@ -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;
diff --git a/jstests/sharding/sharding_with_keyfile.key b/jstests/sharding/sharding_with_keyfile.key
index fe3344b9444..fe3344b9444 100755..100644
--- a/jstests/sharding/sharding_with_keyfile.key
+++ b/jstests/sharding/sharding_with_keyfile.key
diff --git a/jstests/slowNightly/replReads.js b/jstests/slowNightly/replReads.js
index 4fe91305738..dadc2c6cac7 100644
--- a/jstests/slowNightly/replReads.js
+++ b/jstests/slowNightly/replReads.js
@@ -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()
}
diff --git a/third_party/snappy.py b/third_party/snappy.py
index e53ee632bbd..e9881106c87 100644
--- a/third_party/snappy.py
+++ b/third_party/snappy.py
@@ -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" ] )