Skip to content

Commit

Permalink
CXX-444 Backport server r2.6.6..r2.6.7 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
acmorrow committed Jan 16, 2015
1 parent e80083f commit eed3b58
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/mongo/client/dbclient_rs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ namespace {
return rsm->getServerAddress();
}

HostAndPort DBClientReplicaSet::getSuspectedPrimaryHostAndPort() const {
if (!_master) {
return HostAndPort();
}
return _master->getServerHostAndPort();
}

void DBClientReplicaSet::setRunCommandHook(DBClientWithCommands::RunCommandHookFunc func) {
// Set the hooks in both our sub-connections and in ourselves.
if (_master) {
Expand Down
11 changes: 11 additions & 0 deletions src/mongo/client/dbclient_rs.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ namespace mongo {

// ----- informational ----

/**
* Gets the replica set name of the set we are connected to.
*/
const std::string& getSetName() const { return _setName; }

/**
* Returns the HostAndPort of the server this connection believes belongs to the primary,
* or returns an empty HostAndPort if it doesn't know about a current primary.
*/
HostAndPort getSuspectedPrimaryHostAndPort() const;

double getSoTimeout() const { return _so_timeout; }

string toString() const { return getServerAddress(); }
Expand Down
1 change: 1 addition & 0 deletions src/mongo/client/dbclientinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,7 @@ namespace mongo {
}

string getServerAddress() const { return _serverString; }
const HostAndPort& getServerHostAndPort() const { return _server; }

virtual void killCursor( long long cursorID );
virtual bool callRead( Message& toSend , Message& response ) { return call( toSend , response ); }
Expand Down
7 changes: 1 addition & 6 deletions src/mongo/s/shard.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ namespace mongo {

Shard( const Shard& other )
: _name( other._name ) , _addr( other._addr ) , _cs( other._cs ) ,
_maxSize( other._maxSize ) , _isDraining( other._isDraining ),
_tags( other._tags ) {
_maxSize( other._maxSize ) , _isDraining( other._isDraining ) {
}

Shard( const Shard* other )
Expand Down Expand Up @@ -138,9 +137,6 @@ namespace mongo {
*/
bool containsNode( const string& node ) const;

const set<string>& tags() const { return _tags; }
void addTag( const string& tag ) { _tags.insert( tag ); }

static void getAllShards( vector<Shard>& all );
static void printShardInfo( ostream& out );
static Shard lookupRSName( const string& name);
Expand Down Expand Up @@ -168,7 +164,6 @@ namespace mongo {
ConnectionString _cs;
long long _maxSize; // in MBytes, 0 is unlimited
bool _isDraining; // shard is currently being removed
set<string> _tags;
};
typedef shared_ptr<Shard> ShardPtr;

Expand Down
2 changes: 1 addition & 1 deletion src/mongo/util/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace mongo {
* 1.2.3-rc4-pre-
* If you really need to do something else you'll need to fix _versionArray()
*/
const char versionString[] = "2.6.6";
const char versionString[] = "2.6.7";

// See unit test for example outputs
BSONArray toVersionArray(const char* version){
Expand Down

0 comments on commit eed3b58

Please sign in to comment.