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

analyzeShardKey command can return incorrect monotonicity for compound hashed shard keys

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 7.0.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v7.0
    • Sharding NYC 2023-05-15
    • 0

      Currently, shard keys with a hashed field are handled as follows. If the number of fields is 1, then the analyzeShardKey command would just return "not monotonic". If the number of fields is > 1, the command would instead try to infer its monotonicity from the correlation coefficient of the recordIds. The latter is incorrect since hashing introduces randomness so it is meaningless to calculate the correlation coefficient of recordIds in a hashed index. According to BF-28591, this is causing a monotonic shard key to be reported as "not monotonic" and vice versa.

            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: