diff --git a/source/retryable-reads/retryable-reads.rst b/source/retryable-reads/retryable-reads.rst index bdd45c7f98..49ede870d9 100644 --- a/source/retryable-reads/retryable-reads.rst +++ b/source/retryable-reads/retryable-reads.rst @@ -331,6 +331,13 @@ other error originating from the server, that error should be raised instead as the caller can infer that an attempt was made and the second error is likely more relevant (with respect to the current topology state). +If a driver associates server information (e.g. the server address or +description) with an error, the driver MUST ensure the server information +reported with that error corresponds to the server that was selected when the +error occurred. Specifically, if a retry attempt fails, the server reported +with the error MUST correspond to the server that was selected for the retry +and MUST NOT simply be carried over from the original error. + 4. Implementation constraints ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/source/retryable-writes/retryable-writes.rst b/source/retryable-writes/retryable-writes.rst index b1604d8c14..5e9c45623b 100644 --- a/source/retryable-writes/retryable-writes.rst +++ b/source/retryable-writes/retryable-writes.rst @@ -411,6 +411,13 @@ from the driver) or the error is labeled "NoWritesPerformed", the error from the previous attempt should be raised. If all server errors are labeled "NoWritesPerformed", then the first error should be raised. +If a driver associates server information (e.g. the server address or +description) with an error, the driver MUST ensure the server information +reported with that error corresponds to the server that was selected when the +error occurred. Specifically, if a retry attempt fails, the server reported +with the error MUST correspond to the server that was selected for the retry +and MUST NOT simply be carried over from the original error. + The above rules are implemented in the following pseudo-code: .. code-block:: typescript