summaryrefslogtreecommitdiff
path: root/src/mongo/s/client
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-09-12 15:43:03 -0400
committerMathias Stearn <mathias@10gen.com>2017-09-13 17:50:40 -0400
commitc514e143a50cb2623078087f56144a05c1419e9f (patch)
treec1d60ccf5be5a368a08fd5fb1b3db7e18590631f /src/mongo/s/client
parent47db63707f8dd9c86691e04ded450e4044ff7467 (diff)
downloadmongo-c514e143a50cb2623078087f56144a05c1419e9f.tar.gz
SERVER-31069 Stop converting SendStaleConfig to RecvStaleConfig
Diffstat (limited to 'src/mongo/s/client')
-rw-r--r--src/mongo/s/client/parallel.cpp26
-rw-r--r--src/mongo/s/client/parallel.h4
-rw-r--r--src/mongo/s/client/version_manager.cpp4
3 files changed, 17 insertions, 17 deletions
diff --git a/src/mongo/s/client/parallel.cpp b/src/mongo/s/client/parallel.cpp
index 23594f586da..5ba651ec1b6 100644
--- a/src/mongo/s/client/parallel.cpp
+++ b/src/mongo/s/client/parallel.cpp
@@ -328,10 +328,10 @@ void ParallelSortClusteredCursor::_markStaleNS(const NamespaceString& staleNS,
const int tries = ++_staleNSMap[staleNS.ns()];
if (tries >= 5) {
- throw SendStaleConfigException(staleNS.ns(),
- "too many retries of stale version info",
- e.getVersionReceived(),
- e.getVersionWanted());
+ throw StaleConfigException(staleNS.ns(),
+ "too many retries of stale version info",
+ e.getVersionReceived(),
+ e.getVersionWanted());
}
}
@@ -764,7 +764,7 @@ void ParallelSortClusteredCursor::finishInit(OperationContext* opCtx) {
LOG(pc) << "finished on shard " << shardId << ", current connection state is "
<< mdata.toBSON();
}
- } catch (RecvStaleConfigException& e) {
+ } catch (StaleConfigException& e) {
retry = true;
string staleNS = e.getns();
@@ -999,10 +999,10 @@ void ParallelSortClusteredCursor::_oldInit() {
// Version is zero b/c this is deprecated codepath
staleConfigExs.push_back(str::stream()
<< "stale config detected for "
- << RecvStaleConfigException(_ns,
- "ParallelCursor::_init",
- ChunkVersion(0, 0, OID()),
- ChunkVersion(0, 0, OID()))
+ << StaleConfigException(_ns,
+ "ParallelCursor::_init",
+ ChunkVersion(0, 0, OID()),
+ ChunkVersion(0, 0, OID()))
.what()
<< errLoc);
break;
@@ -1157,7 +1157,7 @@ void ParallelSortClusteredCursor::_oldInit() {
if (throwException && staleConfigExs.size() > 0) {
// Version is zero b/c this is deprecated codepath
- throw RecvStaleConfigException(
+ throw StaleConfigException(
_ns, errMsg.str(), ChunkVersion(0, 0, OID()), ChunkVersion(0, 0, OID()));
} else if (throwException) {
throw DBException(14827, errMsg.str());
@@ -1341,7 +1341,7 @@ void throwCursorStale(DBClientCursor* cursor) {
if (cursor->hasResultFlag(ResultFlag_ShardConfigStale)) {
BSONObj error;
cursor->peekError(&error);
- throw RecvStaleConfigException("query returned a stale config error", error);
+ throw StaleConfigException("query returned a stale config error", error);
}
if (NamespaceString(cursor->getns()).isCommand()) {
@@ -1351,8 +1351,8 @@ void throwCursorStale(DBClientCursor* cursor) {
//
// TODO: Standardize stale config reporting.
BSONObj res = cursor->peekFirst();
- if (res.hasField("code") && res["code"].Number() == ErrorCodes::SendStaleConfig) {
- throw RecvStaleConfigException("command returned a stale config error", res);
+ if (res.hasField("code") && res["code"].Number() == ErrorCodes::StaleConfig) {
+ throw StaleConfigException("command returned a stale config error", res);
}
}
}
diff --git a/src/mongo/s/client/parallel.h b/src/mongo/s/client/parallel.h
index d1680f1e74f..3b97c373085 100644
--- a/src/mongo/s/client/parallel.h
+++ b/src/mongo/s/client/parallel.h
@@ -166,8 +166,8 @@ private:
};
/**
- * Throws a RecvStaleConfigException wrapping the stale error document in this cursor when the
- * ShardConfigStale flag is set or a command returns a ErrorCodes::SendStaleConfig error code.
+ * Throws a StaleConfigException wrapping the stale error document in this cursor when the
+ * ShardConfigStale flag is set or a command returns a ErrorCodes::StaleConfig error code.
*/
void throwCursorStale(DBClientCursor* cursor);
diff --git a/src/mongo/s/client/version_manager.cpp b/src/mongo/s/client/version_manager.cpp
index 7f97716f620..0b3195e3859 100644
--- a/src/mongo/s/client/version_manager.cpp
+++ b/src/mongo/s/client/version_manager.cpp
@@ -311,7 +311,7 @@ bool checkShardVersion(OperationContext* opCtx,
<< shard->getConnString().toString()
<< ")");
- throw SendStaleConfigException(ns, msg, refVersion, currentVersion);
+ throw StaleConfigException(ns, msg, refVersion, currentVersion);
}
} else if (refManager) {
string msg(str::stream() << "not sharded (" << (!manager ? string("<none>") : str::stream()
@@ -325,7 +325,7 @@ bool checkShardVersion(OperationContext* opCtx,
<< conn_in->getServerAddress()
<< ")");
- throw SendStaleConfigException(
+ throw StaleConfigException(
ns, msg, refManager->getVersion(shard->getId()), ChunkVersion::UNSHARDED());
}