diff options
author | David Storch <david.storch@10gen.com> | 2014-10-21 15:37:06 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2014-10-21 17:43:50 -0400 |
commit | 11ad1edebfafea650ff00912bdf7a3a48dede144 (patch) | |
tree | 6b8c4aa4fc88bad42ff5cb8a1888fe5708d070cb /src/mongo/db/ops/delete_request.h | |
parent | a1a2e24b34d818cfed86b3ad5eb01d62bc375eaa (diff) | |
download | mongo-11ad1edebfafea650ff00912bdf7a3a48dede144.tar.gz |
SERVER-15760 internally issued update and delete requests should not yield
This change adds a default yield policy of YIELD_MANUAL in the UpdateRequest and DeleteRequest,
only setting it to YIELD_AUTO as needed. This prevents yielding in internal plans used for repl
while inside a WriteUnitOfWork.
Diffstat (limited to 'src/mongo/db/ops/delete_request.h')
-rw-r--r-- | src/mongo/db/ops/delete_request.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/ops/delete_request.h b/src/mongo/db/ops/delete_request.h index ee58c59d476..f1378da5533 100644 --- a/src/mongo/db/ops/delete_request.h +++ b/src/mongo/db/ops/delete_request.h @@ -46,7 +46,8 @@ namespace mongo { _logop(false), _god(false), _fromMigrate(false), - _isExplain(false) {} + _isExplain(false), + _yieldPolicy(PlanExecutor::YIELD_MANUAL) {} void setQuery(const BSONObj& query) { _query = query; } void setMulti(bool multi = true) { _multi = multi; } @@ -54,6 +55,7 @@ namespace mongo { void setGod(bool god = true) { _god = god; } void setFromMigrate(bool fromMigrate = true) { _fromMigrate = fromMigrate; } void setExplain(bool isExplain = true) { _isExplain = isExplain; } + void setYieldPolicy(PlanExecutor::YieldPolicy yieldPolicy) { _yieldPolicy = yieldPolicy; } const NamespaceString& getNamespaceString() const { return _nsString; } const BSONObj& getQuery() const { return _query; } @@ -63,6 +65,7 @@ namespace mongo { bool isFromMigrate() const { return _fromMigrate; } bool isExplain() const { return _isExplain; } OperationContext* getOpCtx() const { return _txn; } + PlanExecutor::YieldPolicy getYieldPolicy() const { return _yieldPolicy; } std::string toString() const; @@ -75,6 +78,7 @@ namespace mongo { bool _god; bool _fromMigrate; bool _isExplain; + PlanExecutor::YieldPolicy _yieldPolicy; }; } // namespace mongo |