[DRIVERS-1385] Make retryable write test error labels behave consistently with server Created: 02/Sep/20  Updated: 03/Jan/24

Status: Implementing
Project: Drivers
Component/s: Retryability
Fix Version/s: None

Type: Spec Change Priority: Major - P3
Reporter: Emily Giurleo (Inactive) Assignee: Isabel Atkinson
Resolution: Unresolved Votes: 0
Labels: leads-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
Issue split
split to PYTHON-2984 Client does not retry retryable write... Closed
split to PHPLIB-755 Update retryable writes and transacti... Closed
split to JAVA-4382 Make retryable write test error label... Closed
split to CSHARP-3944 Make retryable write test error label... Backlog
split to CXX-2406 Make retryable write test error label... Backlog
split to GODRIVER-2212 Make retryable write test error label... Backlog
split to CDRIVER-4210 Make retryable write test error label... Closed
split to MOTOR-849 Make retryable write test error label... Closed
split to NODE-3733 Make retryable write test error label... Closed
split to RUBY-2836 Make retryable write test error label... Closed
split to RUST-1088 Make retryable write test error label... Closed
Related
related to DRIVERS-2799 Test-level runOnRequirements in retry... Implementing
related to DRIVERS-2802 Require 4.3.1+ server version when us... Implementing
is related to JAVA-4244 Top level error labels aren't added t... Closed
is related to PYTHON-2452 PyMongo does not retry command respon... Closed
Driver Changes: Needed
Downstream Changes Summary:

Drivers should sync the retryable-writes and transaction spec tests updated in the following commits:

Start date:
Driver Compliance:
Key Status/Resolution FixVersion
CDRIVER-4210 Fixed 1.26.0
CXX-2406 Backlog
CSHARP-3944 Backlog
GODRIVER-2212 Backlog
JAVA-4382 Fixed 4.4.1
NODE-3733 Fixed 4.4.0, 5.4.0
PHPLIB-755 Fixed 1.11.0
PYTHON-2984 Fixed 3.12.2, 4.0
MOTOR-849 Duplicate
RUBY-2836 Fixed 2.18.0
RUST-1088 Fixed 2.2.0
SWIFT-1402 Won't Do

 Description   

Summary

Drivers should sync the tests updated in this commit.

In our retryable writes spec tests, when a RetryableWriteError label is returned on a writeConcernError, we use fail points to include the label in the writeConcernError object, rather than as a top-level field on the error itself. Here's an example.

The server always returns error labels as top-level fields, so we should modify our spec tests to do so as well so that drivers do not need to check both the writeConcernError object and the error object for the presence of an error label.

Motivation

User reported running while testing Atlas by looping an update one operation during a failover with the default connection string.
"Test Failover" is often used to mimic Atlas Planned Maintenance by users who are on the Atlas Platform and consists of a very simple election/stepdown process that all clusters/user applications should be able to handle without any downtime.

If the problem does occur, what are the consequences and how severe are they?

The write may or may not have been propagated to the servers.

See also SERVER-51329, SERVER-53624, SERVER-55648, HELP-23256, HELP-30952. In particular, implementations of this ticket should note the more recent observations in JAVA-4244.



 Comments   
Comment by Jeremy Mikola [ 20/Apr/23 ]

I just noticed that https://github.com/mongodb/specifications/commit/ab48c5768bd5a19f27ee62d10951670448a8d8e9 (with unified tests) was never added to the downstream changes for this issue, so I've updated the field.

I also went through the resolved language tickets to see if anyone missed syncing those tests and left follow-up tests on:

Comment by Martin Bajana [ 02/May/22 ]

Leads Triage: isabel.atkinson@mongodb.com, rachelle.palmer@mongodb.comupdated this ticket's description. Can you please review it and validate your spec PR covers everything.

Comment by Githook User [ 09/Nov/21 ]

Author:

{'name': 'Isabel Atkinson', 'email': 'isabel.atkinson@mongodb.com', 'username': 'isabelatkinson'}

Message: DRIVERS-1385 Always specify error labels at the top level (#1086)
Branch: master
https://github.com/mongodb/specifications/commit/564547496b60c1f013c1a2edc27dd690f57ba04c

Comment by Githook User [ 26/Jul/21 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: DRIVERS-1385: Test top-level errorLabel with writeConcernError (#1042)

Add unified tests that add RetryableWriteError as a top-level
errorLabel of a writeConcernError, as is done by actual
MongoDB server.
Branch: master
https://github.com/mongodb/specifications/commit/ab48c5768bd5a19f27ee62d10951670448a8d8e9

Comment by Jeremy Mikola [ 09/Sep/20 ]

ross.lawley: Looking at the retryable writes spec, it appears you originally added the first mention of errorLabels being nested within a writeConcernError in 44d71db. Unfortunately, PR #750 isn't linked to a DRIVERS/SPEC ticket and we have no more context for the change. emily.giurleo later modified the text in cf29252.

Before I ask the server team if there were any stable server versions that actually included labels in a writeConcernError, can you explain the justification for this change? If this was only added due to some pre-4.4 behavior in a 4.3.x release, then I think we can drop it entirely.

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