-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 4.2.0, 4.3.1
-
Component/s: None
-
Fully Compatible
-
ALL
-
v4.2
-
72
When building a ShardFilterStage we will do the following:
1) Build the child stage tree, and hold by raw pointer
2) Get a CollectionShardingState object and use it to retrieve an orphans filter via call to CollectionShardingState::getOrphansFilter().
3) Create and return the ShardFilterStage
The call to CollectionShardingState::get() can dassert and the call to CollectionShardingState::getOrphansFilter() can uassert. In either case we will leak the child stage tree.
We should change this block to hold the child stage tree by unique_ptr and not release until after acquiring the orphans filter.