buildStages() STAGE_SHARDING_FILTER block should hold child stage tree by unique_ptr

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.3.1, 4.2.10
    • Affects Version/s: 4.2.0, 4.3.1
    • Component/s: None
    • Fully Compatible
    • ALL
    • v4.2
    • 72
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            David Storch
            Reporter:
            James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: