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/update_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/update_request.h')
-rw-r--r-- | src/mongo/db/ops/update_request.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mongo/db/ops/update_request.h b/src/mongo/db/ops/update_request.h index 8bc42db69d4..381a012912b 100644 --- a/src/mongo/db/ops/update_request.h +++ b/src/mongo/db/ops/update_request.h @@ -53,7 +53,8 @@ namespace mongo { , _fromMigration(false) , _fromReplication(false) , _lifecycle(NULL) - , _isExplain(false) {} + , _isExplain(false) + , _yieldPolicy(PlanExecutor::YIELD_MANUAL) {} const NamespaceString& getNamespaceString() const { return _nsString; @@ -146,6 +147,14 @@ namespace mongo { return _isExplain; } + inline void setYieldPolicy(PlanExecutor::YieldPolicy yieldPolicy) { + _yieldPolicy = yieldPolicy; + } + + inline PlanExecutor::YieldPolicy getYieldPolicy() const { + return _yieldPolicy; + } + const std::string toString() const { return str::stream() << " query: " << _query @@ -198,6 +207,9 @@ namespace mongo { // Whether or not we are requesting an explained update. Explained updates are read-only. bool _isExplain; + // Whether or not the update should yield. Defaults to YIELD_MANUAL. + PlanExecutor::YieldPolicy _yieldPolicy; + }; } // namespace mongo |