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

Running aggregations through the embedded router from a cluster without shards must succeed with an empty result

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • Hide
      const st = new ShardingTest({shards: 0, embeddedRouter: true});
      
      assert.commandWorked(
          st.s.getDB('admin').currentOp({type: 'op', desc: 'ReshardCollectionCoordinator'}));
      
      st.stop();
      
      Show
      const st = new ShardingTest({shards: 0, embeddedRouter: true }); assert .commandWorked( st.s.getDB( 'admin' ).currentOp({type: 'op' , desc: 'ReshardCollectionCoordinator' })); st.stop();
    • CAR Team 2024-04-15
    • 160

      When using a MongoS, and running an aggregation in a sharded cluster with no shards, we are going to return an empty result and a successful status. The flow is the following:

      1. Run cluster aggregate (link)
      2. Check for the routing information (link)
      3. As there are no shards in the cluster, return ShardNotFound (link)
      4. Return empty result and OK (link)

      On the other hand, when using an embedded router placed in a csrs we are not following the same path, when we should, resulting in an expected behaviour (see BF-32481). The flow is the following:

      1. Run cluster aggregate (link)
      2. Check for the routing information (link)
      3. There are no shards in the cluster but this node has ConfigServer as serverGlobalParams (shared because the router is embedded in the configsvr node), so it will skip returning ShardNotFound when it should throw (link)

      The goal of this ticket is to refactor this condition to make it compatible with the embedded router placed in a config server node.

            Assignee:
            pol.pinol@mongodb.com Pol Pinol
            Reporter:
            pol.pinol@mongodb.com Pol Pinol
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: