Skip to content

Commit

Permalink
SERVER-26684 Do not rountrip between ChunkType and BSON during chunk …
Browse files Browse the repository at this point in the history
…reload
  • Loading branch information
kaloianm committed Oct 19, 2016
1 parent 13e8019 commit f597163
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/mongo/s/chunk_diff.cpp
Expand Up @@ -120,10 +120,9 @@ int ConfigDiffTracker<ValType>::calculateConfigDiff(OperationContext* txn,
_validDiffs = 0;

for (const ChunkType& chunk : chunks) {
ChunkVersion chunkVersion =
ChunkVersion::fromBSON(chunk.toBSON(), ChunkType::DEPRECATED_lastmod());
const ChunkVersion& chunkVersion = chunk.getVersion();

if (!chunkVersion.isSet() || !chunkVersion.hasEqualEpoch(currEpoch)) {
if (!chunkVersion.hasEqualEpoch(currEpoch)) {
warning() << "got invalid chunk version " << chunkVersion << " in document "
<< redact(chunk.toString())
<< " when trying to load differing chunks at version "
Expand Down

0 comments on commit f597163

Please sign in to comment.