service: remove the Reconnect trait#13525
Merged
Merged
Conversation
This commit removes the `Reconnect` trait, which augmented the `GenericClient` trait with a `reconnect` method. Folks that previously called `Client::reconnect` instead construct a new client from scratch. This eliminates several heaps of complexity. Clients no longer need to support a "disconnected" state, as they are connected at construction. The `ActiveReplication` controller doesn't have a complicated protocol with asynchronous tasks where commands are drained after an error; instead, the controller simply constructs a fresh after an error. Touches #12946.
1 task
frankmcsherry
approved these changes
Jul 8, 2022
frankmcsherry
left a comment
Contributor
There was a problem hiding this comment.
This all looks good to me. I like the fact that there is one code path now for establishing and re-establishing connections, and I think that is a great way forward to higher confidence code!
umanwizard
approved these changes
Jul 8, 2022
antiguru
reviewed
Jul 14, 2022
Comment on lines
+91
to
+100
| match ComputeGrpcClient::connect_partitioned(addrs).await { | ||
| Ok(client) => Ok(client), | ||
| Err(e) => { | ||
| warn!( | ||
| "error connecting to replica {replica_id}, retrying in {:?}: {e}", | ||
| state.next_backoff.unwrap() | ||
| ); | ||
| Err(e) | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
I think this prevents replicas from being dropped if they never succeed in connecting to any peer. Even if dropped, they don't see it because they don't try to receive on their command channel.
Contributor
Author
There was a problem hiding this comment.
I filed https://github.com/MaterializeInc/materialize/issues/13668 about this.
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.
This commit removes the
Reconnecttrait, which augmented theGenericClienttrait with areconnectmethod. Folks that previouslycalled
Client::reconnectinstead construct a new client from scratch.This eliminates several heaps of complexity. Clients no longer need to
support a "disconnected" state, as they are connected at construction.
The
ActiveReplicationcontroller doesn't have a complicated protocolwith asynchronous tasks where commands are drained after an error;
instead, the controller simply constructs a fresh after an error.
Touches MaterializeInc/database-issues#3125.
Touches MaterializeInc/database-issues#3718.
Motivation
Testing
Release notes
This PR includes the following user-facing behavior changes: