diff options
author | Eliot Horowitz <eliot@10gen.com> | 2014-10-16 17:25:07 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2014-10-16 17:56:42 -0400 |
commit | 02c1c52514c7d6b54ff2d6dd6a3c564c3543f0a5 (patch) | |
tree | f6ddbfa8b0cd75af3af7e467ab498dbdbb461c9c /src/mongo | |
parent | 80d9852c431084e4b6e4fd1b9a5b968b937b96ac (diff) | |
download | mongo-02c1c52514c7d6b54ff2d6dd6a3c564c3543f0a5.tar.gz |
SERVER-13635: add hook to RecoveryUnit for when we are take out of and put back into service
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/operation_context_impl.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/storage/recovery_unit.h | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/operation_context_impl.cpp b/src/mongo/db/operation_context_impl.cpp index 47310d3b0f5..e4e05af90a5 100644 --- a/src/mongo/db/operation_context_impl.cpp +++ b/src/mongo/db/operation_context_impl.cpp @@ -71,11 +71,13 @@ namespace mongo { } RecoveryUnit* OperationContextImpl::releaseRecoveryUnit() { + _recovery->beingReleasedFromOperationContext(); return _recovery.release(); } void OperationContextImpl::setRecoveryUnit(RecoveryUnit* unit) { _recovery.reset(unit); + unit->beingSetOnOperationContext(); } Locker* OperationContextImpl::lockState() const { diff --git a/src/mongo/db/storage/recovery_unit.h b/src/mongo/db/storage/recovery_unit.h index 39fb62b47cd..cdc28054e3c 100644 --- a/src/mongo/db/storage/recovery_unit.h +++ b/src/mongo/db/storage/recovery_unit.h @@ -48,6 +48,9 @@ namespace mongo { virtual void reportState( BSONObjBuilder* b ) const { } + virtual void beingReleasedFromOperationContext() {} + virtual void beingSetOnOperationContext() {} + /** * These should be called through WriteUnitOfWork rather than directly. * |