summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/create_indexes.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-09-21 11:08:06 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-09-22 09:16:40 -0400
commit9123d2d3263ea56d8651ba9d4cf5ad1158d939cb (patch)
treebddf1cbf162fca2acb3312604c5949cce3941021 /src/mongo/db/commands/create_indexes.cpp
parent416764e1c50f9c31ab9d9845d21b7d80062fee30 (diff)
downloadmongo-9123d2d3263ea56d8651ba9d4cf5ad1158d939cb.tar.gz
SERVER-18084 Remove usages of ShardingState::get(globalOperationContext())
So that call can be removed in place of the variant, which accepts OperationContext.
Diffstat (limited to 'src/mongo/db/commands/create_indexes.cpp')
-rw-r--r--src/mongo/db/commands/create_indexes.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/commands/create_indexes.cpp b/src/mongo/db/commands/create_indexes.cpp
index 74c4eeb7a54..604ddaf7ac8 100644
--- a/src/mongo/db/commands/create_indexes.cpp
+++ b/src/mongo/db/commands/create_indexes.cpp
@@ -295,10 +295,11 @@ private:
const BSONObj& newIdxKey) {
invariant(txn->lockState()->isCollectionLockedForMode(ns, MODE_X));
- if (ShardingState::get(getGlobalServiceContext())->enabled()) {
+ ShardingState* const shardingState = ShardingState::get(txn);
+
+ if (shardingState->enabled()) {
std::shared_ptr<CollectionMetadata> metadata(
- ShardingState::get(getGlobalServiceContext())
- ->getCollectionMetadata(ns.toString()));
+ shardingState->getCollectionMetadata(ns.toString()));
if (metadata) {
ShardKeyPattern shardKeyPattern(metadata->getKeyPattern());
if (!shardKeyPattern.isUniqueIndexCompatible(newIdxKey)) {