Unverified Commit 7cbea30c authored by Kevin Albertson's avatar Kevin Albertson Committed by GitHub
Browse files

CDRIVER-2386 refactor retryable writes into shared function (#1576)



Adds a new private function `mongoc_cluster_run_retryable_write` and removes duplicate retry logic. No functional changes are expected.

* rename `is_retryable` to `can_retry`

Intended to better describe. `is_retryable_write` describes if the command is eligible for retry (regardless of whether retry occurred). `can_retry` is initially true if `is_retryable_write` is true. `can_retry` is set to false after a retry (can only retry once).

* simplify condition

`_mongoc_write_error_update_if_unsupported_storage_engine` only applies if the server does not support retryable writes. Apply regardless of whether a retry occurred.

* remove `_mongoc_client_retryable_write_command_with_stream`

---------

Co-authored-by: default avatarEzra Chung <88335979+eramongodb@users.noreply.github.com>
parent badc2af0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment