summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec
diff options
context:
space:
mode:
authorMarcos José Grillo Ramírez <marcos.grillo@mongodb.com>2020-05-06 11:35:22 +0200
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-19 17:44:47 +0000
commit25ee2b61ed8467f7c07b26bf52953d25caed95fd (patch)
tree6341076500813da822209904949f3cbe373e2f15 /src/mongo/db/exec
parentb55528c5954b9d055e5cc55e2e7e58048f149208 (diff)
downloadmongo-25ee2b61ed8467f7c07b26bf52953d25caed95fd.tar.gz
SERVER-47701 Allow CRUD and DDL commands on shards when connected to the primary directly instead of the router
Diffstat (limited to 'src/mongo/db/exec')
-rw-r--r--src/mongo/db/exec/update_stage.cpp8
-rw-r--r--src/mongo/db/exec/upsert_stage.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/exec/update_stage.cpp b/src/mongo/db/exec/update_stage.cpp
index ab30f56867f..dd7f405115e 100644
--- a/src/mongo/db/exec/update_stage.cpp
+++ b/src/mongo/db/exec/update_stage.cpp
@@ -181,8 +181,8 @@ BSONObj UpdateStage::transformAndUpdate(const Snapshotted<BSONObj>& oldObj, Reco
const bool isInsert = false;
FieldRefSet immutablePaths;
if (isUserInitiatedWrite) {
- const auto collDesc =
- CollectionShardingState::get(opCtx(), collection()->ns())->getCollectionDescription();
+ const auto collDesc = CollectionShardingState::get(opCtx(), collection()->ns())
+ ->getCollectionDescription(opCtx());
if (collDesc.isSharded() && !OperationShardingState::isOperationVersioned(opCtx())) {
immutablePaths.fillFrom(collDesc.getKeyPatternFields());
}
@@ -255,7 +255,7 @@ BSONObj UpdateStage::transformAndUpdate(const Snapshotted<BSONObj>& oldObj, Reco
args.update = logObj;
if (isUserInitiatedWrite) {
args.criteria = CollectionShardingState::get(opCtx(), collection()->ns())
- ->getCollectionDescription()
+ ->getCollectionDescription(opCtx())
.extractDocumentKey(newObj);
} else {
const auto docId = newObj[idFieldName];
@@ -705,7 +705,7 @@ PlanStage::StageState UpdateStage::prepareToRetryWSM(WorkingSetID idToRetry, Wor
bool UpdateStage::checkUpdateChangesShardKeyFields(const Snapshotted<BSONObj>& oldObj) {
auto* const css = CollectionShardingState::get(opCtx(), collection()->ns());
- const auto collDesc = css->getCollectionDescription();
+ const auto collDesc = css->getCollectionDescription(opCtx());
if (!collDesc.isSharded()) {
return false;
}
diff --git a/src/mongo/db/exec/upsert_stage.cpp b/src/mongo/db/exec/upsert_stage.cpp
index a157ca9b762..dc81610bb96 100644
--- a/src/mongo/db/exec/upsert_stage.cpp
+++ b/src/mongo/db/exec/upsert_stage.cpp
@@ -175,7 +175,7 @@ BSONObj UpsertStage::_produceNewDocumentForInsert() {
if (!isInternalRequest) {
optCollDesc.emplace(
CollectionShardingState::get(opCtx(), _params.request->getNamespaceString())
- ->getCollectionDescription());
+ ->getCollectionDescription(opCtx()));
// If the collection is sharded, add all fields from the shard key to the 'shardKeyPaths'
// set.