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

shardCollection fails with "couldn't find valid index for shard key" despite index existing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Sharding
    • Operating System:
      ALL

      Description

      I'm attempting to shard a number of existing collections. They were all created and populated in a standalone mongod which has now been converted to a sharded cluster. Some of the collections have sharded successfully, others have failed with the above error. A possible cause of this was that the indexes were in the process of being created (with the background: true option) when the shardCollection command was first run, due to the script used not waiting for the background creation to complete.

       

      Full example error:

        Attachments

        1. mongod.log
          74 kB
        2. mongod.log - config server
          4 kB
        3. mongos.log
          360 kB
        4. mongos.log.gz
          77.44 MB

          Activity

            People

            Assignee:
            backlog-server-execution Backlog - Execution Team
            Reporter:
            gavin.aiken@netcuras.com Gavin AIken
            Participants:
            Votes:
            3 Vote for this issue
            Watchers:
            10 Start watching this issue

              Dates

              Created:
              Updated: