diff options
Diffstat (limited to 'src/mongo/db/index/index_build_interceptor.h')
-rw-r--r-- | src/mongo/db/index/index_build_interceptor.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/index/index_build_interceptor.h b/src/mongo/db/index/index_build_interceptor.h index a9b36131ed5..4bdaaebf6f0 100644 --- a/src/mongo/db/index/index_build_interceptor.h +++ b/src/mongo/db/index/index_build_interceptor.h @@ -29,6 +29,8 @@ #pragma once +#include <memory> + #include "mongo/db/index/duplicate_key_tracker.h" #include "mongo/db/index/index_access_method.h" #include "mongo/db/index/multikey_paths.h" @@ -155,7 +157,12 @@ private: int64_t _numApplied{0}; - AtomicWord<long long> _sideWritesCounter{0}; + // This allows the counter to be used in a RecoveryUnit rollback handler where the + // IndexBuildInterceptor is no longer available (e.g. due to index build cleanup). If there are + // additional fields that have to be referenced in commit/rollback handlers, this counter should + // be moved to a new IndexBuildsInterceptor::InternalState structure that will be managed as a + // shared resource. + std::shared_ptr<AtomicWord<long long>> _sideWritesCounter; mutable stdx::mutex _multikeyPathMutex; boost::optional<MultikeyPaths> _multikeyPaths; |