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

Need the ability to update the shard key

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.7.1
    • Component/s: None
    • None
    • Environment:
      db version v1.7.2-pre-, pdfile version 4.5
      Tue Oct 5 16:50:28 git version: 41b422b789dd8ce8c9ae57063bc6fcca29182912

      Problem:
      In some scenarios the user chosen shard key may be update-able. Currently these updates are prevented.

      Reproduce:

      > db.blogs.find()

      { "_id" : ObjectId("4cab5334e9d125376ee1006d"), "author" : "jim", "clocktime" : "Tue Oct 05 2010 12:32:52 GMT-0400 (EDT)", "ts" : 1, "tags" : [ "yes", "no" ] }

      > db.printShardingStatus()
      — Sharding Status —
      sharding version:

      { "_id" : 1, "version" : 3 }

      shards:

      { "_id" : "shard0000", "host" : "10.194.251.95:27000" } { "_id" : "shard0001", "host" : "10.202.251.67:27000" }

      databases:

      { "_id" : "admin", "partitioned" : false, "primary" : "config" } { "_id" : "scaleout", "partitioned" : true, "primary" : "shard0000" }

      scaleout.blogs chunks:
      { "ts" :

      { $minKey : 1 }

      } -->>

      { "ts" : 0 }

      on : shard0000

      { "t" : 2000, "i" : 1 }

      { "ts" : 0 }

      -->> { "ts" :

      { $maxKey : 1 }

      } on : shard0001

      { "t" : 2000, "i" : 0 }

      > db.blogs.update(

      { ts : 1}

      ,

      {ts : 2}

      )
      change would move shards!

      Solution:
      Allow shard_key updates and therefore moves between shards.

            Assignee:
            Unassigned Unassigned
            Reporter:
            alvin Alvin Richards (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: