-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: upgrade etcd to v3.5.15 #8441
Conversation
Skipping CI for Draft Pull Request. |
// If Linearizable is set to false, the member list will be returned with server's local data. | ||
// If Linearizable is set to true, it is served with linearizable guarantee. If the server is disconnected from quorum, `MemberList` call will fail. | ||
c := clientv3.RetryClusterClient(client) | ||
resp, err := c.MemberList(newCtx, &etcdserverpb.MemberListRequest{Linearizable: false}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set it to false to keep it consistent with previous behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is RetryClusterClient
needed here and not elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to pass &etcdserverpb.MemberListRequest{Linearizable: false}
If we use resp, err :=client.MemberList(ctx)
, it will always be true
https://github.com/etcd-io/etcd/blame/v3.5.15/client/v3/cluster.go#L125-L132
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8441 +/- ##
==========================================
+ Coverage 77.40% 77.59% +0.19%
==========================================
Files 473 474 +1
Lines 61934 61866 -68
==========================================
+ Hits 47941 48006 +65
+ Misses 10409 10326 -83
+ Partials 3584 3534 -50
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -88,7 +89,7 @@ func CheckClusterID(localClusterID types.ID, um types.URLsMap, tlsConfig *tls.Co | |||
trp := &http.Transport{ | |||
TLSClientConfig: tlsConfig, | |||
} | |||
remoteCluster, gerr := etcdserver.GetClusterFromRemotePeers(nil, []string{u}, trp, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the default value of the new function GetClusterFromRemotePeers
true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is introduced by #8017 and etcd-io/etcd#17330, it means Enable 3.4 to be compatible with next version 3.5, to allow 3.4 server to join 3.5 cluster and start on 3.5 schema.
/hold |
server/config/config.go
Outdated
@@ -739,6 +739,7 @@ func (c *Config) GenEmbedEtcdConfig() (*embed.Config, error) { | |||
cfg.PeerTLSInfo.TrustedCAFile = c.Security.CAPath | |||
cfg.PeerTLSInfo.CertFile = c.Security.CertPath | |||
cfg.PeerTLSInfo.KeyFile = c.Security.KeyPath | |||
//nolint:staticcheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after etcd-io/etcd#18015, AllowedCN is Deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be replaced by AllowedCNs in a later pr to support multi cn
cancel() | ||
if err != nil { | ||
return listResp, errs.ErrEtcdMemberList.Wrap(err).GenWithStackByCause() | ||
return (*clientv3.MemberListResponse)(resp), errs.ErrEtcdMemberList.Wrap(err).GenWithStackByCause() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need (*clientv3.MemberListResponse)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the return value of ListEtcdMembers is expected to be (*clientv3.MemberListResponse)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the current type without (*clientv3.MemberListResponse)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I notice you are using retryClusterClient. Is it necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current type is etcdserverpb.MemberListResponse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to pass &etcdserverpb.MemberListRequest{Linearizable: false}
If we use resp, err :=client.MemberList(ctx)
, it will always be true
https://github.com/etcd-io/etcd/blame/v3.5.15/client/v3/cluster.go#L125-L132
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client.MemberList
call c.remote.MemberList
. c.remote
is built by RetryClusterClient
https://github.com/etcd-io/etcd/blob/v3.5.15/client/v3/cluster.go#L60-L67
Signed-off-by: lhy1024 <[email protected]>
/unhold |
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
/test pull-integration-realcluster-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: niubell, nolouch, rleungx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: Close #3877 Ref #5134 #5520
What is changed and how does it work?
Check List
Tests
Release note