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

`sh.getShardDistribution` concatenates strings instead of summing number of docs

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • ALL
    • Sharding EMEA 2022-12-12

      The total number of documents for a collection is expected to be returned as part of the output of getShardDistribution. However, currently the returned number is wrong as it concatenates strings representing the number of docs present on each shard rather than performing the actual sum.

      This has been observed on a user cluster. Relevant part of the output:

      Shard 0
      
      {
        ....
        docs: 22558525,
        ....
      }
      
      ---
      
      Shard 1
      {
        ....
        docs: Long("2533229933"),
        ....
      }
      
      ---
      
      Shard 2
      
      {
        ....
        docs: Long("2543629431"),
        ....
      }
      
      ---
      
      Shard 3
      
      {
        ....
        docs: Long("2601286991"),
        ....
      }
      
      ---
      
      Shard 4
      
      {
        ....
        docs: Long("2639120994")
        ....
      }
      
      ---
      
      Totals
      
      {
        docs: '225585252533229933254362943126012869912639120994',
      ....
      }
      
      

            Assignee:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Reporter:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: