[SERVER-2698] mongos seems to swallow 'No matching object found' errors when running findAndModify on a sharded collection. Created: 07/Mar/11  Updated: 12/Jul/16  Resolved: 14/Mar/11

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 1.8.0-rc1
Fix Version/s: 1.8.1, 1.9.0

Type: Bug Priority: Major - P3
Reporter: Bernie Hackett Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux x86_64


Issue Links:
Depends
is depended on by PYTHON-219 KeyError in find_and_modify Closed
Operating System: ALL
Participants:

 Description   

Steps to reproduce:

1. Set up a sharded system with at least two shards (in my case they are both replica sets with a primary and two secondaries)
2. Enable sharding on a database
3. Shard a collection in that database.
4. Insert enough data that chunks are migrated to both shards (this may not be required)
5. Run findAndModify querying for a document that does not exist using the shard key.

Expected results:

mongos returns 'No matching object found'

Actual result:

mongos returns

{u'ok': 1.0}

This was found while investigating http://jira.mongodb.org/browse/PYTHON-219 so the problem also exists in at least 1.7.6.



 Comments   
Comment by auto [ 26/Mar/11 ]

Author:

{u'login': u'behackett', u'name': u'behackett', u'email': u'bernie@10gen.com'}

Message: Fix KeyError when value isn't returned PYTHON-219

This change works around bugs like SERVER-2698.
https://github.com/mongodb/mongo-python-driver/commit/4e2ebbbcfc66eb8427338a8e923430a8f1971213

Comment by auto [ 16/Mar/11 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: Better handling of sharded findAndModify output SERVER-2698 180?
https://github.com/mongodb/mongo/commit/0dcc19701f1f5d5b4a99be6d1f49dc189a3fb32b

Comment by auto [ 14/Mar/11 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: Better handling of sharded findAndModify output SERVER-2698 180?
https://github.com/mongodb/mongo/commit/2fb5c66361e9a2cfa95e28f29f40d2b19cc785e2

Comment by Bernie Hackett [ 07/Mar/11 ]

This likely doesn't matter but all the mongods are running with --dur.

Comment by Bernie Hackett [ 07/Mar/11 ]

I should also note that the correct thing happens in a single server environment.

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