summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/cleanup_orphaned_cmd.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-08-21 10:50:04 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2019-02-27 10:51:15 -0500
commitb049257fbd1d215388cffaf7544f6741dbce5b45 (patch)
tree90e385d3c5af33c64f2dc8b590447c606c58f611 /src/mongo/db/s/cleanup_orphaned_cmd.cpp
parent6df5463e57c068a653f27fa44daaa619453d602f (diff)
downloadmongo-b049257fbd1d215388cffaf7544f6741dbce5b45.tar.gz
SERVER-39495 Move ShardingState::needCollectionMetadata under OperationShardingState
ShardingState logically contains answers to questions about whether the current instance is node in a sharded cluster, whereas OperationShardingState is responsible for the 'shardedness' of the commands.
Diffstat (limited to 'src/mongo/db/s/cleanup_orphaned_cmd.cpp')
-rw-r--r--src/mongo/db/s/cleanup_orphaned_cmd.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/mongo/db/s/cleanup_orphaned_cmd.cpp b/src/mongo/db/s/cleanup_orphaned_cmd.cpp
index b959633557a..28eab0d23bb 100644
--- a/src/mongo/db/s/cleanup_orphaned_cmd.cpp
+++ b/src/mongo/db/s/cleanup_orphaned_cmd.cpp
@@ -79,13 +79,7 @@ CleanupResult cleanupOrphanedData(OperationContext* opCtx,
{
AutoGetCollection autoColl(opCtx, ns, MODE_IX);
auto* const css = CollectionShardingRuntime::get(opCtx, ns);
- const auto optMetadata = css->getCurrentMetadataIfKnown();
- uassert(ErrorCodes::ConflictingOperationInProgress,
- str::stream() << "Unable to establish sharding status for collection " << ns.ns(),
- optMetadata);
-
- const auto& metadata = *optMetadata;
-
+ const auto metadata = css->getCurrentMetadata();
if (!metadata->isSharded()) {
LOG(0) << "skipping orphaned data cleanup for " << ns.ns()
<< ", collection is not sharded";