[SERVER-25451] gridfs.js should shard sharded_files_id_n.fs.chunks with key {files_id: 1, n: 1} and unique=true Created: 05/Aug/16  Updated: 18/Nov/16  Resolved: 05/Aug/16

Status: Closed
Project: Core Server
Component/s: GridFS
Affects Version/s: None
Fix Version/s: 3.2.10, 3.3.11

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: test-only
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: Query 18 (08/05/16)
Participants:
Linked BF Score: 0

 Description   

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.



 Comments   
Comment by Githook User [ 04/Sep/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-25451 Shard sharded_files_id_n.fs.chunks with unique=true.

(cherry picked from commit 8e7ab6c77df70cc1bc70c34d873f5d05f705e225)
Branch: v3.2
https://github.com/mongodb/mongo/commit/693717b18d85ad76f7b373246ecddf61811d8bf2

Comment by Githook User [ 05/Aug/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-25451 Shard sharded_files_id_n.fs.chunks with unique=true.
Branch: master
https://github.com/mongodb/mongo/commit/8e7ab6c77df70cc1bc70c34d873f5d05f705e225

Generated at Thu Feb 08 04:09:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.