replication: add remote peer connection timeout#8380
Merged
locker merged 1 commit intotarantool:masterfrom Mar 2, 2023
Merged
Conversation
We use coio_connect() to connect the replica to a remote peer. It implies no timeout, and does a non-blocking connect() to the peer and then waits for the socket to become writable indefinitely. When the remote peer changes its IP address, connect() might try connecting to the old address for as long as ~ 2 minutes (given the default tcp_syn_retries value of 6). This blocks replica from trying to reconnect to the updated address and is pretty inconvenient. Let's use coio_connect_timeout() instead and use replication_disconnect_timeout() as a timeout, like everywhere else in master-replica communication. Closes tarantool#7294 NO_DOC=bugfix
locker
approved these changes
Mar 1, 2023
Gerold103
approved these changes
Mar 1, 2023
Collaborator
Gerold103
left a comment
There was a problem hiding this comment.
Thanks for the patch!
Member
|
Cherry-picked to 2.11. |
mkostoevr
added a commit
to mkostoevr/tarantool
that referenced
this pull request
Oct 27, 2025
It's been used by the applier originally, but in commit 0486a48 ("replication: add remote peer connection timeout"), the function is only used in the coio test. Let's drop it completely and rename the `coio_connect_timeout` to `coio_connect`. Follows-up tarantool#8380 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring
mkostoevr
added a commit
to mkostoevr/tarantool
that referenced
this pull request
Nov 11, 2025
It's been used by the applier originally, but in commit 0486a48 ("replication: add remote peer connection timeout"), the function is only used in the coio test. Let's drop it completely and rename the `coio_connect_timeout` to `coio_connect`. Follows-up tarantool#8380 NO_DOC=refactoring NO_CHANGELOG=refactoring
locker
pushed a commit
that referenced
this pull request
Nov 18, 2025
It's been used by the applier originally, but in commit 0486a48 ("replication: add remote peer connection timeout"), the function is only used in the coio test. Let's drop it completely and rename the `coio_connect_timeout` to `coio_connect`. Follows-up #8380 NO_DOC=refactoring NO_CHANGELOG=refactoring
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We use coio_connect() to connect the replica to a remote peer. It implies no timeout, and does a non-blocking connect() to the peer and then waits for the socket to become writable indefinitely.
When the remote peer changes its IP address, connect() might try connecting to the old address for as long as ~ 2 minutes (given the default tcp_syn_retries value of 6).
This blocks replica from trying to reconnect to the updated address and is pretty inconvenient.
Let's use coio_connect_timeout() instead and use
replication_disconnect_timeout() as a timeout, like everywhere else in master-replica communication.
Closes #7294
NO_DOC=bugfix