summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2017-07-12 11:16:23 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2017-07-18 10:03:30 -0400
commit32da960b3d4f80e4005bfcc21dd56067353d64fb (patch)
treea68f367be75b4b3ca74c74d7dddc733517dd1408 /src/mongo
parent6ed160ddce8ea4bb9fcd92ec17f26a6edc129c6a (diff)
downloadmongo-32da960b3d4f80e4005bfcc21dd56067353d64fb.tar.gz
SERVER-28948 open up secondaries to checking shardVersion
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/s/collection_sharding_state.cpp5
-rw-r--r--src/mongo/db/service_entry_point_mongod.cpp5
2 files changed, 2 insertions, 8 deletions
diff --git a/src/mongo/db/s/collection_sharding_state.cpp b/src/mongo/db/s/collection_sharding_state.cpp
index c7f410eeda4..fa51f7b7171 100644
--- a/src/mongo/db/s/collection_sharding_state.cpp
+++ b/src/mongo/db/s/collection_sharding_state.cpp
@@ -458,11 +458,6 @@ bool CollectionShardingState::_checkShardVersionOk(OperationContext* opCtx,
ChunkVersion* actualShardVersion) {
Client* client = opCtx->getClient();
- if (!repl::ReplicationCoordinator::get(opCtx)->canAcceptWritesForDatabase(opCtx, _nss.db())) {
- // Right now connections to secondaries aren't versioned at all.
- return true;
- }
-
auto& oss = OperationShardingState::get(opCtx);
// If there is a version attached to the OperationContext, use it as the received version.
diff --git a/src/mongo/db/service_entry_point_mongod.cpp b/src/mongo/db/service_entry_point_mongod.cpp
index a7cbe6a3a5c..eb2561ed73f 100644
--- a/src/mongo/db/service_entry_point_mongod.cpp
+++ b/src/mongo/db/service_entry_point_mongod.cpp
@@ -653,9 +653,8 @@ void execCommandDatabase(OperationContext* opCtx,
opCtx->setDeadlineAfterNowBy(Milliseconds{maxTimeMS});
}
- // Operations are only versioned against the primary. We also make sure not to redo shard
- // version handling if this command was issued via the direct client.
- if (iAmPrimary && !opCtx->getClient()->isInDirectClient()) {
+ // We do not redo shard version handling if this command was issued via the direct client.
+ if (!opCtx->getClient()->isInDirectClient()) {
// Handle a shard version that may have been sent along with the command.
auto commandNS = NamespaceString(command->parseNs(dbname, request.body));
auto& oss = OperationShardingState::get(opCtx);