diff options
author | Esha Maharishi <esha.maharishi@mongodb.com> | 2016-10-04 14:47:24 -0400 |
---|---|---|
committer | Esha Maharishi <esha.maharishi@mongodb.com> | 2016-10-04 17:42:19 -0400 |
commit | e8345ff602fc528dbc33944b21bd344cbea5e3e5 (patch) | |
tree | ff9d67d109003d3dd7a7af38f265d93e3ec5df85 /src/mongo/db/s/operation_sharding_state.cpp | |
parent | dfb56737ec8506e60676b93332558cf155b767a7 (diff) | |
download | mongo-e8345ff602fc528dbc33944b21bd344cbea5e3e5.tar.gz |
SERVER-26102 set shardVersion to IGNORED for system.indexes, but only if a shardVersion was sent in the command
Diffstat (limited to 'src/mongo/db/s/operation_sharding_state.cpp')
-rw-r--r-- | src/mongo/db/s/operation_sharding_state.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/s/operation_sharding_state.cpp b/src/mongo/db/s/operation_sharding_state.cpp index a940ffc01df..0f92bbd5492 100644 --- a/src/mongo/db/s/operation_sharding_state.cpp +++ b/src/mongo/db/s/operation_sharding_state.cpp @@ -66,6 +66,11 @@ void OperationShardingState::initializeShardVersion(NamespaceString nss, return; } + if (nss.isSystemDotIndexes()) { + setShardVersion(std::move(nss), ChunkVersion::IGNORED()); + return; + } + setShardVersion(std::move(nss), std::move(newVersion)); } @@ -84,6 +89,7 @@ ChunkVersion OperationShardingState::getShardVersion(const NamespaceString& nss) void OperationShardingState::setShardVersion(NamespaceString nss, ChunkVersion newVersion) { // This currently supports only setting the shard version for one namespace. invariant(!_hasVersion || _ns == nss); + invariant(!nss.isSystemDotIndexes() || ChunkVersion::isIgnoredVersion(newVersion)); _ns = std::move(nss); _shardVersion = std::move(newVersion); |