Investigate shardKeyIndex scan incorrect behavior with a compound wildcard index

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When a sharded collection uses a compound wildcard index with a descending order as a shard key - like {x: 1, 'a.$**': -1}, a shardkey index scan will miss documents containing the min boundary.

      You'll find a reproducible here.

      Note that compound wildcard indexes are not allowed to act as a shard key index since SERVER-103774.
      However, it would be nice to understand why we are having this behavior to make sure we don't have other bugs caused by the same root cause.

       

            Assignee:
            Unassigned
            Reporter:
            Silvia Surroca
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: