[DRIVERS-290] Support sending writeConcern for commands that write Created: 01/Mar/16  Updated: 27/May/22  Resolved: 31/Oct/16

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Emily Stolfo Assignee: Barrie Segal
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-1322 Support sending writeConcern for comm... Closed
depends on CSHARP-1688 Support sending writeConcern for comm... Closed
depends on CXX-926 Support sending writeConcern for comm... Closed
depends on CXX-927 Support sending writeConcern for comm... Closed
depends on JAVA-2221 Always send writeConcern for commands... Closed
depends on NODE-729 Support sending writeConcern for comm... Closed
depends on PHPLIB-200 Support sending writeConcern for comm... Closed
depends on PYTHON-1101 Support sending writeConcern for comm... Closed
depends on RUBY-1115 Support sending writeConcern for comm... Closed
depends on RUST-35 Add integration tests for writeConcer... Closed
depends on SERVER-24191 Bump wire version to indicate improve... Closed
Duplicate
is duplicated by DRIVERS-294 Commands that write should take a wri... Closed
Related
is related to SERVER-20224 Commands which write should take a wr... Closed
Server Compat: 3.3, 3.4
Start date:
Driver Compliance:
Key Status/Resolution FixVersion
NODE-729 Done 2.2.5
PYTHON-1101 Done 3.4
CSHARP-1688 Done 2.4
PHPLIB-200 Done 1.1.0
JAVA-2221 Done 3.4.0
CXX-926 Won't Fix
RUBY-1115 Done 2.4.0
CDRIVER-1322 Done 1.5.0
CXX-927 Done 3.1.0
PERL-627 Done 1.6.0
SCALA-246 Done
RUST-35 Fixed 2.0.0-beta.2

 Description   

When talking with server 3.4 or greater (maxWireVersion >=5), writeConcern should be a supported option for commands that write.
Helpers for the following commands therefore must be updated to support the option.

These are commands that newly accept a writeConcern as of 3.4, for which driver helpers should be updated:

  • aggregate with $out
  • clone
  • cloneCollection
  • cloneCollectionAsCapped
  • collMod
  • convertToCapped
  • copydb
  • create
  • createIndexes
  • drop
  • dropDatabase
  • dropIndexes
  • reindex
  • mapReduce with out
  • renameCollection

Note:

When the writeConcern on a command that writes fails, the resulting document still comes back with ok: 1. Hence, to check for write concern and raise the appropriate error to your users, you will need to check the resulting document for a writeConcernError field. If it is present, then writeConcern failed.
See the specs here for details on writeConcern with the generic command method. See the specs here for details on handling writeConcern with command helpers.



 Comments   
Comment by Rathi Gnanasekaran [ 31/Oct/16 ]

Resolving ticket as all linked tickets are closed.

Comment by A. Jesse Jiryu Davis [ 16/Jun/16 ]

Let's remove a few things from this list that aren't for mortals: godInsert, capTrunc, appendoplognote, mergechunk, emptycapped.

Comment by Githook User [ 20/May/16 ]

Author:

{u'username': u'estolfo', u'name': u'Emily S', u'email': u'emily@10gen.com'}

Message: Merge pull request #86 from estolfo/DRIVERS-290-cmd-helpers

DRIVERS-290 Add text about commands that write supporting a writeConcern parameter
Branch: master
https://github.com/mongodb/specifications/commit/3e562d121cef07dc5b787ef2814946e27c4f6019

Comment by Githook User [ 20/May/16 ]

Author:

{u'username': u'estolfo', u'name': u'Emily S', u'email': u'emily@10gen.com'}

Message: Merge pull request #86 from estolfo/DRIVERS-290-cmd-helpers

DRIVERS-290 Add text about commands that write supporting a writeConcern parameter
Branch: master
https://github.com/mongodb/specifications/commit/3e562d121cef07dc5b787ef2814946e27c4f6019

Comment by Githook User [ 20/May/16 ]

Author:

{u'username': u'estolfo', u'name': u'Emily', u'email': u'emily@mongodb.com'}

Message: DRIVERS-290 Update to not mention helpers and reference in Test Plan
Branch: master
https://github.com/mongodb/specifications/commit/866edee7e88963d0fcd68d2d823b67821c90d9dd

Comment by Githook User [ 20/May/16 ]

Author:

{u'username': u'estolfo', u'name': u'Emily', u'email': u'emily@mongodb.com'}

Message: DRIVERS-290 Add note about command helpers supporting writeConcern parameter
Branch: master
https://github.com/mongodb/specifications/commit/27a54d3606bb93433ca11014735fb1cc6f925b59

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