Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-42852

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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 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

      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@mongodb.com David Storch
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: