replication: add remote peer connection timeout
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
Showing
- changelogs/unreleased/gh-7294-long-reconnection-fix.md 4 additions, 0 deletionschangelogs/unreleased/gh-7294-long-reconnection-fix.md
- src/box/applier.cc 4 additions, 3 deletionssrc/box/applier.cc
- test/replication-luatest/gh_7294_dont_connect_infinitely_test.lua 36 additions, 0 deletions...lication-luatest/gh_7294_dont_connect_infinitely_test.lua
Loading