[SERVER-1667] Failed to insert data while sharding gridfs.fs.chunks with key {"files_id": 1, "n": 1} Created: 24/Aug/10 Updated: 30/Mar/12 Resolved: 25/Aug/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 1.6.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Che-Ching Wu | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Operating System: | ALL |
| Participants: |
| Description |
|
I built up a system that consists of 2 replica set shards (each has 3 servers), 1 config server, 1 mongos. |
| Comments |
| Comment by Mathias Stearn [ 25/Aug/10 ] |
|
FYI: I looked into it and this message was hidden by the python driver. See http://jira.mongodb.org/browse/PYTHON-158 |
| Comment by Mathias Stearn [ 25/Aug/10 ] |
|
We currently only support sharding on {files_id:1}. The issue is that we don't yet have code to distribute the md5 calculations between shards, so a file must live fully on a single shard. You should get an error that looks something like this: 13092: "GridFS chunks collection can only be sharded on files_id" |
| Comment by Che-Ching Wu [ 25/Aug/10 ] |
|
The exception of python insertion script I've posted above. > show dbs , "ns" : "gridfs_bench2.fs.chunks", "min" : { "files_id" : { $minKey : 1 }, "n" : { $minKey : 1 }}, "max" : { "files_id" : { $maxKey : 1 }, "n" : { $maxKey : 1 } }, "shard" : "shard0000" } > db.collections.find() , "unique" : false } ============== Here is the log from mongod. Wed Aug 25 07:17:02 [conn14] dropDatabase gridfs_bench2 for gridfs_bench2.fs.chunks for gridfs_bench2.fs.chunks ============== Finally, if I use {files_id:1}only for shard key. There's no error. |
| Comment by Eliot Horowitz (Inactive) [ 25/Aug/10 ] |
|
There are no errors there. What happens when you try to write something? |
| Comment by Che-Ching Wu [ 25/Aug/10 ] |
|
I've modified to use SON in python script and it's in the right sequence now. Following is the output messages of mongos. Wed Aug 25 02:16:31 connection accepted from 172.16.1.181:29753 #3 } Wed Aug 25 02:16:34 [conn3] no chunks for:gridfs_bench2.fs.chunks so creating first: ns:gridfs_bench2.fs.chunks at: shard0000:shard1/172.16.1.190:27018,172.16.1.191:27018,172.16.1.192:27018 lastmod: 1|0 min: { files_id: MinKey, n: MinKey }max: { files_id: MaxKey, n: MaxKey }Wed Aug 25 02:16:34 [conn3] end connection 172.16.1.181:29753 |
| Comment by Eliot Horowitz (Inactive) [ 25/Aug/10 ] |
|
Something is weird notice: Tue Aug 24 21:20:42 [conn1] CMD: shardcollection: { shardcollection: "gridfs_bench.fs.chunks", key: { n: 1, files_id: 1 } } Do you have the commands you used to shard? |
| Comment by Che-Ching Wu [ 25/Aug/10 ] |
|
BTW, here is the exception from python script. Traceback (most recent call last): |
| Comment by Che-Ching Wu [ 25/Aug/10 ] |
|
> use config , "unique" : false } { "_id" : "gridfs.fs.chunks", "lastmod" : "Thu Jan 15 1970 20:17:00 GMT+0000 (UTC)", "dropped" : true }> |
| Comment by Eliot Horowitz (Inactive) [ 25/Aug/10 ] |
|
Looks like you created the shard key backwards. You made it on { n: 1, files_id: 1 }needs to be on { files_id: 1 , n : 1 } |
| Comment by Eliot Horowitz (Inactive) [ 24/Aug/10 ] |
|
Can you send the full mongos log? |