[GODRIVER-2821] Don't return "ErrUnacknowledgedWrite" when using an unacknowledged write concern Created: 26/Apr/23  Updated: 05/Feb/24

Status: Backlog
Project: Go Driver
Component/s: CRUD
Affects Version/s: None
Fix Version/s: 2.0.0

Type: Improvement Priority: Major - P3
Reporter: Matt Dale Assignee: Preston Vasquez
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Go Driver 2.0: Driver

 Description   

Currently, the Go driver returns mongo.ErrUnacknowledgedWrite for any write operation performed with an unacknowledged write concern. That makes handling errors difficult because you have to explicitly check for and discard mongo.ErrUnacknowledgedWrite. Instead, we should just return a nil result and a nil error if everything worked (i.e. if there were no observed errors).

Definition of done:

  • Remove mongo.ErrUnacknowledgedWrite.
  • Add an Acknowledged bool to all write result types (e.g. InsertOneResult, BulkWriteResult, etc) to indicate whether or not the result information is from an unacknowledged write.


 Comments   
Comment by PM Bot [ 14/Dec/23 ]

There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to reopen this ticket if you're still experiencing the issue, and add a comment if you're able to provide more information.

Comment by PM Bot [ 06/Dec/23 ]

Hi matt.dale@mongodb.com! GODRIVER-2821 is awaiting your response.

If this is still an issue for you, please open Jira to review the latest status and provide your feedback. Thanks!

Comment by Preston Vasquez [ 29/Nov/23 ]

matt.dale@mongodb.comShould we close this ticket since ErrUnacknowledgeWrite is a sentinel error with a fairly valid purpose? Or should we add an "Acknowledged" bool to the results?

Comment by Preston Vasquez [ 10/Nov/23 ]

matt.dale@mongodb.comThe argument for why we return ErrUnacknowledgedWrite is so that a user knows that they are trading speed for unreliability in followup requests. See the link mentioned in the above comment for more details. Do we still want to proceed with implementing this ticket?

Comment by Preston Vasquez [ 10/Nov/23 ]

For brevity, here is the thread with the details of why we do this: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/408527/9/mongo/collection.go#152 .

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