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

mongos takes forever for multi shard queries

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.5
    • Component/s: Sharding
    • None
    • ALL
    • Hide
      1. Run query db.sessions4.find({r: "gce-us-east1", u: {$lt: "V"}}).limit(2).explain() on mongos
      2. Notice it's hanging for multiple minutes

       

      1. Run db.sessions4.find({r: "gce-us-east1", u: {$lt: "V"}}).limit(2).explain() on both replica sets 
      2. Both return instantly
      Show
      Run query db.sessions4.find({r: "gce-us-east1", u: {$lt: "V"}}).limit(2).explain() on mongos Notice it's hanging for multiple minutes   Run db.sessions4.find({r: "gce-us-east1", u: {$lt: "V"}}).limit(2).explain() on both replica sets  Both return instantly

      If mongos needs to hit multiple shards then the query stalls but if I run the query on both shards independently they finish instantly. I have a sharded collection on r,u. Additionally, if I run a command on the mongos that only needs to query a single shard it finishes instantly as well.

      "conn34" is the affected connection in the logs. It looks like it returns from a single node very quickly and the other server is the slow one. I attached the operation from that server by running db.currentOp(true).

        1. explain-local.json
          4 kB
        2. explain-local-phil.json
          12 kB
        3. explain-local-queen.json
          12 kB
        4. explain-mongos.json
          6 kB
        5. mongos.log
          1.37 MB
        6. mongos.stack.txt
          28 kB
        7. op.json
          4 kB
        8. Screen Shot 2019-01-16 at 2.10.44 PM.png
          Screen Shot 2019-01-16 at 2.10.44 PM.png
          68 kB

            Assignee:
            daniel.hatcher@mongodb.com Danny Hatcher (Inactive)
            Reporter:
            james@getadmiral.com James Hartig
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: