ShardingDDLCoordinator follows a pattern for creating an OperationContext that looks like this:
return ExecutorFuture<void>(**executor).then( _buildPhaseHandler(Phase::kStuff, [this, executor = executor, anchor = shared_from_this()] { const auto opCtxHolder = cc().makeOperationContext(); auto* opCtx = opCtxHolder.get(); getForwardableOpMetadata().setOn(opCtx); doStuff(opCtx); } ) );
Aside from being repetitive, this pattern introduces the possibility for oversights such as missing the line that sets ForwardableOpMetadata on the OperationContext.
This ticket is for eliminating this boilerplate pattern. For example:
return ExecutorFuture<void>(**executor).then( _buildPhaseHandler(Phase::kStuff, [this, executor = executor, anchor = shared_from_this()](auto* opCtx) { doStuff(opCtx); } ) );
- is depended on by
-
SERVER-103370 Set ForwardableOperationMetadata implicitly in coordinators (remaining cases)
-
- Closed
-