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

Inherit individual DocumentSource subclasses from agg::Stage

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • QE 2025-04-28, QE 2025-05-12
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      With SERVER-103766, the QE-relevant methods and fields from DocumentSource are moved to agg::Stage and DocumentSource inherits from agg::Stage making it a light refactoring.

      In this ticket, we need to 'move' this inheritance 'down' the hierarchy:

      • DocumentSource inherits directly from RefCountable as before.
      • agg::Stage does not inherit from RefCountable anymore.
      • DocumentSource direct subclasses (around 80) inherit from both DocumentSource and agg::Stage (multiple inheritance).
      • Dome test-only and QO-only document sources inherit only from DocumentSource and do not need agg::Stage (please ask me if you need a list).
      • agg::Pipeline still contains StageContainer _stages, with StageContainer defined as std::list<boost::intrusive_ptr<Stage>>
      • we need to temporarily add void intrusive_ptr_add_ref(Stage*) and void intrusive_ptr_release(Stage*), because agg::Stage does not inherit from RefCountable anymore.

      Prototype commit for the reference (might not fully match the current design): https://github.com/10gen/mongo/pull/34036/commits/0839eed81d7a4596b5d8e112a5e1f0ba65263016

      We need to run the performance tests on this change.

            Assignee:
            daniel.tabacaru@mongodb.com Daniel Tabacaru
            Reporter:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: