Update aggregation_request_helper::validate() to allow both explain and writeConcern for internal commands

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • Hide

      Run the failing test locally on the latest master:

      python3 buildscripts/resmoke.py run --suites=no_passthrough_with_mongod \
          --additionalFeatureFlags=featureFlagSbeFull \
          --installDir=bazel-bin/install-dist-test/bin \
          jstests/noPassthroughWithMongod/query/group_pushdown.js
      
      
      Show
      Run the failing test locally on the latest master: python3 buildscripts/resmoke.py run --suites=no_passthrough_with_mongod \ --additionalFeatureFlags=featureFlagSbeFull \ --installDir=bazel-bin/install-dist-test/bin \ jstests/noPassthroughWithMongod/query/group_pushdown.js
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We have contradictory validation checks for aggregation explain commands:
      aggregation_request_helper::validate(): we assert that we cannot have explain and writeConcern
      in service_entry_point_shard_role we explicitly require all commands to have writeConcern to be explicitly set.

      We should update aggregation_request_helper::validate() to permit writeConcern with explain if the command was issued from an internal connection.

      We can do this by modifying the assertion condition here to be:

        !hasExplain || !aggregate.getWriteConcern().has_value() || client->isInternalClient() || client->isInDirectClient()
      

      The following may also suffice:

      !hasExplain || !aggregate.getWriteConcern().has_value() || hasFromRouterElem
      

      There may be some collision with SERVER-119513 as that will expose the Client* in validate().

            Assignee:
            Naafiyan Ahmed
            Reporter:
            Naafiyan Ahmed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: