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

Inserting array values for shard key succeeds when shard key is _id and inserts garbage data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.0.6, 2.1.2
    • Fix Version/s: 2.3.2
    • Component/s: Sharding
    • Labels:
      None
    • Operating System:
      ALL

      Description

      mongo
      MongoDB shell version: 2.0.4
      connecting to: test
      test[14:7:40]> sh.shardCollection('test.bar', {i:1})
      test[14:7:53]> db.bar.insert({i : [1, 2]})
      tried to insert object with no valid shard key for { i: 1.0 } : { _id: ObjectId('5005aa08ba72dc4f64314847'), i: [ 1.0, 2.0 ] }
      test[14:8:9]> sh.shardCollection('test.baz', {_id:1})
      test[14:8:25]> db.baz.insert({_id : [1, 2]})
      test[14:8:34]> db.baz.find()
      { "_id" : ObjectId("5005aa223af26b5b5e49a1be"), "_id" : ObjectId("5005aa223af26b5b5e49a1be") }

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: