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

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

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • 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
    • 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:
            backlog-server-catalog-and-routing [DO NOT USE] Backlog - Catalog and Routing
            Reporter:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: