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

GridFS should support sharding of the chunks collection with hashed shard keys

    Details

      Description

      I have created a sharded cluster for use with GridFS.

      I would like to use a hashed shard key for the chunks to ensure the data is uniformly distributed across the cluster. When I try to use the filemd5 command to validate the files I receive an error saying the collection has to be indexed on the {{

      {files_id:1}

      or

      {files_id:1, n:1}

      }}.

      mongos> db.gridfs.chunks.runCommand( { filemd5 : ObjectId("51b535788544eb45b4cdaab5"), root : 'gridfs' } )
      {
          "ok" : 0,
          "errmsg" : "GridFS fs.chunks collection must be sharded on either {files_id:1} or {files_id:1, n:1}"
      }
      

      I think the set of acceptable indexes should be updated to include the hashed type.

      The stats() for the chunks collection is attached.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                6 Vote for this issue
                Watchers:
                16 Start watching this issue

                Dates

                • Created:
                  Updated: