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

gridfs.js should shard sharded_files_id_n.fs.chunks with key {files_id: 1, n: 1} and unique=true

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.10, 3.3.11
    • Affects Version/s: None
    • Component/s: GridFS
    • Fully Compatible
    • ALL
    • Query 18 (08/05/16)
    • 0

      The mgo driver attempts to create an index {files_id: 1, n: 1} on the sharded_files_id_n.fs.chunks collection with unique=true, per the GridFS specification. However, until 162b080, the mgo driver used to create an index with unique=false.

      The sharded_files_id_n.fs.chunks collection is being sharded without specifying that the shard key should impose a uniqueness constraint, so mongos ends up implicitly create an index {files_id: 1, n: 1} on the sharded_files_id_n.fs.chunks collection with unique=false. This causes the error "Index with name: files_id_1_n_1 already exists with different options" to be returned to the mongofiles tool.

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: