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:
Ezra Chung <88335979+eramongodb@users.noreply.github.com>
parent
badc2af0
Please register or sign in to comment