Skip to content

Commit eed3b58

Browse files
committed
CXX-444 Backport server r2.6.6..r2.6.7 changes
1 parent e80083f commit eed3b58

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

src/mongo/client/dbclient_rs.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ namespace {
178178
return rsm->getServerAddress();
179179
}
180180

181+
HostAndPort DBClientReplicaSet::getSuspectedPrimaryHostAndPort() const {
182+
if (!_master) {
183+
return HostAndPort();
184+
}
185+
return _master->getServerHostAndPort();
186+
}
187+
181188
void DBClientReplicaSet::setRunCommandHook(DBClientWithCommands::RunCommandHookFunc func) {
182189
// Set the hooks in both our sub-connections and in ourselves.
183190
if (_master) {

src/mongo/client/dbclient_rs.h

+11
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ namespace mongo {
133133

134134
// ----- informational ----
135135

136+
/**
137+
* Gets the replica set name of the set we are connected to.
138+
*/
139+
const std::string& getSetName() const { return _setName; }
140+
141+
/**
142+
* Returns the HostAndPort of the server this connection believes belongs to the primary,
143+
* or returns an empty HostAndPort if it doesn't know about a current primary.
144+
*/
145+
HostAndPort getSuspectedPrimaryHostAndPort() const;
146+
136147
double getSoTimeout() const { return _so_timeout; }
137148

138149
string toString() const { return getServerAddress(); }

src/mongo/client/dbclientinterface.h

+1
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,7 @@ namespace mongo {
13021302
}
13031303

13041304
string getServerAddress() const { return _serverString; }
1305+
const HostAndPort& getServerHostAndPort() const { return _server; }
13051306

13061307
virtual void killCursor( long long cursorID );
13071308
virtual bool callRead( Message& toSend , Message& response ) { return call( toSend , response ); }

src/mongo/s/shard.h

+1-6
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ namespace mongo {
4747

4848
Shard( const Shard& other )
4949
: _name( other._name ) , _addr( other._addr ) , _cs( other._cs ) ,
50-
_maxSize( other._maxSize ) , _isDraining( other._isDraining ),
51-
_tags( other._tags ) {
50+
_maxSize( other._maxSize ) , _isDraining( other._isDraining ) {
5251
}
5352

5453
Shard( const Shard* other )
@@ -138,9 +137,6 @@ namespace mongo {
138137
*/
139138
bool containsNode( const string& node ) const;
140139

141-
const set<string>& tags() const { return _tags; }
142-
void addTag( const string& tag ) { _tags.insert( tag ); }
143-
144140
static void getAllShards( vector<Shard>& all );
145141
static void printShardInfo( ostream& out );
146142
static Shard lookupRSName( const string& name);
@@ -168,7 +164,6 @@ namespace mongo {
168164
ConnectionString _cs;
169165
long long _maxSize; // in MBytes, 0 is unlimited
170166
bool _isDraining; // shard is currently being removed
171-
set<string> _tags;
172167
};
173168
typedef shared_ptr<Shard> ShardPtr;
174169

src/mongo/util/version.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace mongo {
3131
* 1.2.3-rc4-pre-
3232
* If you really need to do something else you'll need to fix _versionArray()
3333
*/
34-
const char versionString[] = "2.6.6";
34+
const char versionString[] = "2.6.7";
3535

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

0 commit comments

Comments
 (0)