Skip to content

Conversation

@baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Jan 8, 2026

This PR clarifies the behavior when multiple errors with NoWritesPerformed are encountered (potentially possible when CSOT is enabled, or in the future with backpressure).

I wanted to add testing, but I ran into some difficulties that led me to believe it probably isn't worth adding test infrastructure just for this test.

  • To test that the correct error is returned in this scenario, we need either a way to assert that the error returned is the first NoWritesPerformed error. However, command monitoring events do not include OP_MSG request ids and I don't know of another way to differentiate between requests.

To get around this, I wrote a simple JS proxy that added an incrementing counter to the payload of each response, so that the error a user receives has an identifier. This worked, but when I went to test this, I ran into another issue: to test this scenario, we need multiple retryable writes (CSOT or backpressure). Backpressure hasn't merged yet, so we can't rely on that feature. When I tried using CSOT, I could not actually reproduce this scenario because every CSOT error manifested as a timeoutMS error (which does not have a NoWritesPerformed error label).

One option is to make this PR depend on the client backpressure work and to put my proxy into drivers-evergreen-tools. This still might be more trouble than it's worth, because this is an additional CI variant for drivers, just for one test. The proxy must:

  • run not on standalone servers (so retryable writes are enabled)
  • proxy every node, or ensure we proxy the primary.
    • either of these options require extra work. either we must decode the URI to find all hosts, and then configure the proxy to proxy every host, and then provide a new URI against which the tests run OR we connect to the test URI, find the primary, proxy the primary and provide a new URI against which the tests can run.

Ultimately, I decided the testing here is more trouble than it's worth. Happy to reconsider if reviewers feel differently though.

Please complete the following before merging:

  • Is the relevant DRIVERS ticket in the PR title?
  • Update changelog.
  • Test changes in at least one language driver.
  • Test these changes against all server versions and topologies (including standalone, replica set, and sharded
    clusters).

@baileympearson baileympearson changed the title clarify retry behavior DRIVERS-3326: clarify retry behavior when errors with NoWritesPerformed are encountered Jan 8, 2026
@baileympearson baileympearson marked this pull request as ready for review January 14, 2026 17:58
@baileympearson baileympearson requested a review from a team as a code owner January 14, 2026 17:58
@baileympearson baileympearson requested review from jmikola and removed request for a team January 14, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants