[SERVER-20635]  Write failed with error code 61 and error message 'upsert Created: 25/Sep/15  Updated: 25/Sep/15  Resolved: 25/Sep/15

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 3.0.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Andy.Z [X] Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File mongo-shell.txt    
Issue Links:
Duplicate
duplicates SERVER-13010 Sharded upsert incorrectly errors if ... Closed
Operating System: ALL
Participants:

 Description   

Hi:

I'm used the shared Mongo with version 3.0.4.

I got the error when i do the follow cmd :

db.collection.update(query,update,true,true)

error:

com.mongodb.WriteConcernException: Write failed with error code 61 and error message 'upsert { q: { fileId: "8eabe793f2f24846a2c566f1cbc4d30d", keyword: "豹米空气净化大师", marketName: "360手机助手", displayName: "豹米空气净化大师", pageUrl: "http://zhushou.360.cn/detail/index/soft_id/3015603?recrefer=SE_D_豹米空气净化大师", downloadUrl: "http://shouji.360tpcdn.com/150728/d17a9303e2649653b71c1c8a77343dcd/com.cmair_203020003.apk", md5: "d17a9303e2649653b71c1c8a77343dcd", realName: "豹米空气净化大师", version: "2.3.2" }, u: { $set: { publishDate: "2015-07-28", downloads: "1337", thumbPrint: "1005723193FBEE3F7EF38AE95896FF43", matchResult: "TRUE", updateDate: 1443168730167 } }, multi: true, upsert: true } does not contain shard key for pattern { _id: 1.0 }'

more info plz see the attachment



 Comments   
Comment by Ramon Fernandez Marina [ 25/Sep/15 ]

Andy.Z, I was convinced this was expected because of the use of {multi:true, upsert:true}: your update may create new documents that can't be targeted to the right shard since you're sharding on _id. However I run into SERVER-13010, which is still open, so I'm going to close this ticket as a duplicate of SERVER-13010 and dig in a bit deeper.

Please feel free to watch SERVER-13010 and comment there. You may also be interested in posting on the mongodb-user group or Stack Overflow with the mongodb tag for MongoDB-related support discussion, where your questions will reach a larger audience. A question like this involving more discussion would be best posted on the mongodb-user group.

Regards,
Ramón.

Generated at Thu Feb 08 03:54:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.