|
When aggregation sets up multiple ClientCursors, the ClientCursors will never be accessed in that same thread. The aggregation command will setup the ClientCursors' PlanExecutors/Stages but never fetch any data through them before depositing them in the CursorManager and exiting.
Therefore, I do not believe we need to set up any RecoveryUnit state for these ClientCursors. Rather, we can just flag the ClientCursors/PlanExecutors that they should stash the RecoveryUnit after the first getMore command accessing data.
Note: this solution resolves the issue I realized would exist with lock-free reads if we were to use multiple RecoveryUnits. LFR specially sets up the first RecoveryUnit via AutoGetCollection*, and then subsequent RecoveryUnits would be uninitialized. We could have tried to duplicate the initialization, but fortunately I don't think we need to do so because we can skip stashing any RecoveryUnits with the ClientCursors.
|