summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/split_chunk_command.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-06-07 17:35:18 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-06-08 16:45:50 -0400
commit59c963afd41e36076bf2271b6ebc186e1587874e (patch)
treeb50d24eff254c7e2315950a06da3fe50968c3dc0 /src/mongo/db/s/split_chunk_command.cpp
parentc60ee7dd4244f58659f436ca54c68987637911e8 (diff)
downloadmongo-59c963afd41e36076bf2271b6ebc186e1587874e.tar.gz
SERVER-35497 Use more uasserts in the configsvr commands
Diffstat (limited to 'src/mongo/db/s/split_chunk_command.cpp')
-rw-r--r--src/mongo/db/s/split_chunk_command.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/mongo/db/s/split_chunk_command.cpp b/src/mongo/db/s/split_chunk_command.cpp
index 77b0cbacaf1..e092baa449a 100644
--- a/src/mongo/db/s/split_chunk_command.cpp
+++ b/src/mongo/db/s/split_chunk_command.cpp
@@ -141,19 +141,17 @@ public:
OID expectedCollectionEpoch;
uassertStatusOK(bsonExtractOIDField(cmdObj, "epoch", &expectedCollectionEpoch));
- auto statusWithOptionalChunkRange = splitChunk(
- opCtx, nss, keyPatternObj, chunkRange, splitKeys, shardName, expectedCollectionEpoch);
+ auto topChunk = uassertStatusOK(splitChunk(
+ opCtx, nss, keyPatternObj, chunkRange, splitKeys, shardName, expectedCollectionEpoch));
- // If the split chunk returns something that is not Status::Ok(), then something failed.
- uassertStatusOK(statusWithOptionalChunkRange.getStatus());
-
- // Otherwise, we want to check whether or not top-chunk optimization should be performed.
- // If yes, then we should have a ChunkRange that was returned. Regardless of whether it
- // should be performed, we will return true.
- if (auto topChunk = statusWithOptionalChunkRange.getValue()) {
+ // Otherwise, we want to check whether or not top-chunk optimization should be performed. If
+ // yes, then we should have a ChunkRange that was returned. Regardless of whether it should
+ // be performed, we will return true.
+ if (topChunk) {
result.append("shouldMigrate",
BSON("min" << topChunk->getMin() << "max" << topChunk->getMax()));
}
+
return true;
}