[SERVER-6558] findAndModify should take a write concern Created: 23/Jul/12  Updated: 08/May/17  Resolved: 01/Sep/15

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: 3.1.1

Type: Improvement Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Unassigned
Resolution: Done Votes: 16
Labels: commands, findAndModify
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CSHARP-799 Add support to helper methods for com... Closed
is depended on by DRIVERS-106 Commands that write should take a wri... Closed
is depended on by JAVA-908 Support write concern for findAndModi... Closed
Documented
is documented by DOCS-6898 findAndModify takes a write concern Closed
is documented by DOCS-9565 Docs for SERVER-6558: findAndModify s... Closed
Duplicate
is duplicated by SERVER-4469 Make findAndModify behave as expected Closed
is duplicated by SERVER-12544 Add write concern parameters to commands Closed
Related
is related to SERVER-20224 Commands which write should take a wr... Closed
is related to DRIVERS-224 Implement findAndModify writeConcern ... Closed
is related to SERVER-12535 aggregation $out should take a write ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 1 04/03/15, Sharding 2 04/24/15, Sharding 3 05/15/15, Sharding 4 06/05/15, Sharding 5 06/26/16
Participants:
Linked BF Score: 0

 Description   

The findAndModify should support specification of a writeConcern, in the same manner as the write commands (insert, update, delete), and should support returning write concern failures in the same manner, as well.

EDIT 8/31/15
This ticket originally encompassed work to support sending write concern for all commands, but the work committed for this ticket is only for the findAndModify command.

The ticket describing the work for extending support for this to all commands which write can be found in SERVER-20224.

All commands that perform writes on behalf of users should support specification of a writeConcern, in the same manner as the write commands (insert, update, delete), and should support returning write concern failures in the same manner, as well.



 Comments   
Comment by Githook User [ 27/Mar/15 ]

Author:

{u'username': u'visualzhou', u'name': u'Siyuan Zhou', u'email': u'siyuan.zhou@mongodb.com'}

Message: SERVER-6558 Fix write concern option enum on Solaris.
Branch: master
https://github.com/mongodb/mongo/commit/5ae2eb08677cb40ae9c05c109adca7de948a7208

Comment by Githook User [ 27/Mar/15 ]

Author:

{u'username': u'visualzhou', u'name': u'Siyuan Zhou', u'email': u'siyuan.zhou@mongodb.com'}

Message: SERVER-6558 Attach write concern to operation context.
Branch: master
https://github.com/mongodb/mongo/commit/ee8ebe091acd1c519b6e5485e8da642f3c4af892

Comment by Githook User [ 17/Mar/15 ]

Author:

{u'username': u'alabid', u'name': u'Daniel Alabi', u'email': u'alabidan@gmail.com'}

Message: SERVER-6558 Add writeConcern option to findAndModify command
Branch: master
https://github.com/mongodb/mongo/commit/21c4f06e356d42aa12442e3f6bca99e55266cd6d

Comment by Githook User [ 16/Mar/15 ]

Author:

{u'username': u'alabid', u'name': u'Daniel Alabi', u'email': u'alabidan@gmail.com'}

Message: Revert "SERVER-6558 Add writeConcern option to findAndModify command"

This reverts commit bb9b4e27c8c31542af52d80f4c3751c435909d69.
Branch: master
https://github.com/mongodb/mongo/commit/9ac525aa529e825634004758fade4738c3c7b0a8

Comment by Githook User [ 16/Mar/15 ]

Author:

{u'username': u'alabid', u'name': u'Daniel Alabi', u'email': u'alabidan@gmail.com'}

Message: SERVER-6558 Add writeConcern option to findAndModify command
Branch: master
https://github.com/mongodb/mongo/commit/bb9b4e27c8c31542af52d80f4c3751c435909d69

Comment by Antoine Girbal [ 09/Oct/14 ]

Most implementation of "transactions" require use of findAndModify, but with w=1 it’s really not viable with possible rollbacks
I think most ppl overlook it, but it’s a real problem. Most implementation of queues with mongo are not durable today, even though it’s the only good pattern for "transactional behavior" in many cases. Basically findAndModify is the building block of transactional designs, so it really should be durable.

Comment by Eric Milkie [ 30/Jan/14 ]

Note: write commands and user management commands already take a write concern. We should come up with a standard for this and apply it to all commands which do writing.

Comment by Yuri Finkelstein [ 02/Nov/12 ]

for instance, findAndModify must be able to support write concern with w:2 just like the regular update would do.

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