diff options
author | Sergi Mateo Bellido <sergi.mateo-bellido@mongodb.com> | 2022-03-31 08:54:16 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-31 09:20:28 +0000 |
commit | bfaa1ac7797c77e2d7f27660363f43f126cf0dce (patch) | |
tree | 5342725c8cd9a668d0594b6ed7f8ee2331ee354a /src/mongo/s/chunk_version.cpp | |
parent | 16aad2450f4af5887e688ce52b05e6bf873ac13a (diff) | |
download | mongo-v5.2.tar.gz |
Revert "SERVER-63363 Fixing parsing of ChunkVersion"v5.2
This reverts commit e8942de372206059a8acf80a1a17b2d4b02551a2.
(looking for another way to fix this problem)
Diffstat (limited to 'src/mongo/s/chunk_version.cpp')
-rw-r--r-- | src/mongo/s/chunk_version.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/mongo/s/chunk_version.cpp b/src/mongo/s/chunk_version.cpp index f249eba8cb6..3379d433f35 100644 --- a/src/mongo/s/chunk_version.cpp +++ b/src/mongo/s/chunk_version.cpp @@ -97,11 +97,9 @@ StatusWith<ChunkVersion> ChunkVersion::fromBSON(const BSONObj& obj) { version._timestamp = (version.epoch() == UNSHARDED().epoch()) ? Timestamp() : Timestamp::max(); } else { - // TODO (SERVER-64813): remove this code once 6.0 becomes lastLTS - // Hack to solve a complex problem related to the addition of the timestamp in 5.0 - uasserted(ErrorCodes::StaleShardVersion, - str::stream() << "Failed to parse " << obj.toString() - << " as a ChunkVersion because it is missing the timestamp field."); + return {ErrorCodes::TypeMismatch, + str::stream() << "Invalid type " << nextElem.type() + << " for version timestamp part."}; } return version; @@ -153,13 +151,9 @@ StatusWith<ChunkVersion> ChunkVersion::parseLegacyWithField(const BSONObj& obj, version._timestamp = (version.epoch() == UNSHARDED().epoch()) ? Timestamp() : Timestamp::max(); } else { - // TODO (SERVER-64813): remove this code once 6.0 becomes lastLTS - // Hack to solve a complex problem related to the addition of the timestamp in 5.0 - uasserted(ErrorCodes::StaleShardVersion, - str::stream() - << "Failed to parse { epoch: " << version._epoch.toString() - << ", combined: " << version._combined - << "} as a ChunkVersion because it is missing the timestamp field."); + return {ErrorCodes::TypeMismatch, + str::stream() << "Invalid type " << timestampElem.type() + << " for version timestamp part."}; } } else { invariant(timestampElem.eoo()); |