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

analyzeShardKey command can return incorrect monotonicity for compound hashed shard keys

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 7.0.0-rc1
    • None
    • None
    • None
    • Fully Compatible
    • ALL
    • v7.0
    • Sharding NYC 2023-05-15
    • 0

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: