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

Return more useful errors when a shard key index can't be found for shardCollection/refineCollectionShardKey

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Sharding
    • Labels:
      None

      Description

      When a collection is sharded or its shard key is refined, a "useful" index must exist on the collection that supports the proposed shard key (as defined in this comment). Verifying this involves both inspecting the collection's listIndexes output and running the checkShardingIndex command on a shard. An index with the shard key pattern can be invalid for several reasons (e.g. it's multikey, partial, sparse, has a collation, or is in the process of being built) but the error messages returned for many of these cases is the same, which can make diagnosing failures difficult. (Message when listIndexes finds no candidate index and message when checkShardingIndex finds no valid index.)

      Instead, the command should return more information as to why there is no valid index. In particular, the error should at least differentiate these cases:

      • No index exists with the shard key pattern as a prefix at all
      • An otherwise valid index exists, but is multikey, partial, sparse, is being built, or has a collation

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-sharding Backlog - Sharding Team
              Reporter:
              jack.mulrow Jack Mulrow
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: