Draft
Conversation
Move proxy creation and forwarding from Client#initialize and the start of Client#follow to after sync completes. This prevents the follower from accepting connections on AMQP/MQTT/HTTP ports before the initial data sync is finished, avoiding premature connection attempts during the sync window.
|
Code Review No issues found. The change correctly defers proxy startup until after the first successful replication sync, preventing clients from connecting to a follower that hasn't synchronized yet. The implementation is clean:
|
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.
Summary
Clustering::Client#initializeto after the firstsync()completes infollow()proxies_startedflag prevents re-creation on reconnect)Motivation
During initial sync the leader is already under load transferring the full data set to the new follower. If the proxy ports are open during this window, clients can connect through the follower and add more work to the leader at the worst possible time. Deferring the proxies until sync is complete means the follower only starts accepting traffic once it is caught up.
Test plan
make lintpassesproxy: false)