Sharding an existing viewless timeseries fails due to missing index supporting the shard key

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: Catalog, Sharding
    • None
    • Catalog and Routing
    • Fully Compatible
    • Show
        https://gist.github.com/robsndr/67b5f1caadbfc9198f9e5cfbcdcca0c5
    • CAR Team 2025-07-07, CAR Team 2025-07-21
    • None
    • 3
    • TBD
    • 🟥 DDL
    • None
    • None
    • None
    • None
    • None
    • None

      When running with viewless timeseries, the ShardCollection command can fail with the following error (reproducer attached):

      uncaught exception: Error: command failed: {
          "ok" : 0,
          "errmsg" : "Please create an index that starts with the proposed shard key before sharding the collection. ",
          "code" : 72,
          "codeName" : "InvalidOptions",
      }

      The goal of this ticket is to investigate and fix the underlying issue.

              Assignee:
              Joan Bruguera Micó
              Reporter:
              Robert Sander
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: