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

Review/fix usages of `ChunkRange::extractKeyPattern` and `Helpers::inferKeyPattern`

    • Catalog and Routing
    • Fully Compatible
    • ALL
    • Sharding EMEA 2023-01-23, Sharding EMEA 2023-02-20, Sharding EMEA 2023-03-06, Sharding EMEA 2023-05-01, Sharding EMEA 2023-05-15, CAR Team 2024-10-14
    • 3

      Both extractKeyPattern and inferKeyPattern wrongly assume that no field in a shard key can be hashed.

      Given a document, they simply generate a key pattern by setting at 1 all the values of the fields.

      Examples:

      Real shard key pattern Document Inferred/extracted key pattern  
      {x:1, y:1} {x: 12345, y: 67890} {x:1, y:1} Correct
      {x:hashed, y:1} {x: 12345, y: 67890} {x:1, y:1} Wrong

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

              Created:
              Updated:
              Resolved: