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

analyzeShardKey command doesn't always throw an error when the collection becomes empty during the command

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 7.0.0-rc6
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v7.0
    • Sharding NYC 2023-06-26
    • 35
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, if the collection becomes empty after the initial check at the start the calculation of the characteristics about the shard key, and the supporting the index for the shard key is a unique index, the analyzeShardKey would return the following metrics instead of failing with an IllegalOperation error it would in the case where the index is not unique.

      {  "numDocs" : NumberLong(0),  "isUnique" : true,  "numDistinctValues" : NumberLong(0),  "mostCommonValues" : [ ],  "monotonicity" : {  "recordIdCorrelationCoefficient" : 0,  "type" : "not monotonic" },  "avgDocSizeBytes" : NumberLong(0),  "readDistribution" : {  "sampleSize" : {  "total" : NumberLong(0),  "find" : NumberLong(0),  "aggregate" : NumberLong(0),  "count" : NumberLong(0),  "distinct" : NumberLong(0) } },  "writeDistribution" : {  "sampleSize" : {  "total" : NumberLong(0),  "update" : NumberLong(0),  "delete" : NumberLong(0),  "findAndModify" : NumberLong(0) } },  "ok" : 1,  "$clusterTime" : {  "clusterTime" : Timestamp(1686168499, 3549),  "signature" : {  "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),  "keyId" : NumberLong(0) } },  "operationTime" : Timestamp(1686168499, 3549) }
      

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: