summaryrefslogtreecommitdiff
path: root/src/mongo/db/operation_context.h
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2018-04-11 12:05:03 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2018-04-13 10:11:59 -0400
commit77abd6ad01e6ecf616f53ce6dafdb428d4806866 (patch)
treef8073728d1f8a62bb5400079705ec99ae646a061 /src/mongo/db/operation_context.h
parent404d3fc4c5d1183e5a29433ea7fe52ef88546710 (diff)
downloadmongo-77abd6ad01e6ecf616f53ce6dafdb428d4806866.tar.gz
SERVER-33548 Enable profiling for batch writes within transactions
Diffstat (limited to 'src/mongo/db/operation_context.h')
-rw-r--r--src/mongo/db/operation_context.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/mongo/db/operation_context.h b/src/mongo/db/operation_context.h
index 1e53a5648e5..dc30d6dfd17 100644
--- a/src/mongo/db/operation_context.h
+++ b/src/mongo/db/operation_context.h
@@ -54,7 +54,6 @@ class CurOp;
class ProgressMeter;
class ServiceContext;
class StringData;
-class WriteUnitOfWork;
namespace repl {
class UnreplicatedWritesBlock;
@@ -75,15 +74,6 @@ class OperationContext : public Decorable<OperationContext> {
MONGO_DISALLOW_COPYING(OperationContext);
public:
- /**
- * The RecoveryUnitState is used by WriteUnitOfWork to ensure valid state transitions.
- */
- enum RecoveryUnitState {
- kNotInUnitOfWork, // not in a unit of work, no writes allowed
- kActiveUnitOfWork, // in a unit of work that still may either commit or abort
- kFailedUnitOfWork // in a unit of work that has failed and must be aborted
- };
-
OperationContext(Client* client, unsigned int opId);
virtual ~OperationContext() = default;
@@ -115,7 +105,8 @@ public:
* returned separately even though the state logically belongs to the RecoveryUnit,
* as it is managed by the OperationContext.
*/
- RecoveryUnitState setRecoveryUnit(RecoveryUnit* unit, RecoveryUnitState state);
+ WriteUnitOfWork::RecoveryUnitState setRecoveryUnit(RecoveryUnit* unit,
+ WriteUnitOfWork::RecoveryUnitState state);
/**
* Interface for locking. Caller DOES NOT own pointer.
@@ -476,7 +467,8 @@ private:
std::unique_ptr<Locker> _locker;
std::unique_ptr<RecoveryUnit> _recoveryUnit;
- RecoveryUnitState _ruState = kNotInUnitOfWork;
+ WriteUnitOfWork::RecoveryUnitState _ruState =
+ WriteUnitOfWork::RecoveryUnitState::kNotInUnitOfWork;
// Operations run within a transaction will hold a WriteUnitOfWork for the duration in order
// to maintain two-phase locking.