8 Commits

Author SHA1 Message Date
Piotr Tabor
9e1abbab6e Fix goimports in all existing files. Execution of ./scripts/fix.sh
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-29 09:41:31 +01:00
Benjamin Wang
39d96b2557 clientv3: add protection code to prevent SnapshotWithVersion from panicking
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-20 12:51:08 +08:00
Benjamin Wang
7f46da223d client: no need to getToken when dial specific endpoint for maintenance
The existing client may connect to different endpoint from the
specific endpoint to be maintained. Maintenance operations do not
go through raft at all, so it might run into issue if the server
hasn't finished applying the authentication request.

Let's work with an example. Assuming the existing client connects to
ep1, while the user wants to maintain ep2. If we getToken again, it
sends an authentication request, which goes through raft. When the
specific endpoint receives the maintenance request, it might haven't
finished previous authentication request, but the new token is already
carried in the context, so it will reject the maintenance request
due to invalid token.

We already have retry logic in `unaryClientInterceptor` and
`streamClientInterceptor`. When the token expires, it can automatically
refresh the token, so it should be safe to remove the `getToken`
logic in `maintenance.dial`

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 04:39:42 +08:00
jianfei.zhang
d75d1e575a fix: close conn
Signed-off-by: jianfei.zhang <jianfei.zhang@daocloud.io>
2022-10-27 11:09:14 +08:00
Marek Siarkowicz
d0c1c3a1fd client: Alias downgrade action enum 2022-02-21 17:58:20 +01:00
Marek Siarkowicz
e1b1d93548 *: Snapshot returns local etcd version
Co-authored-by: Lili Cosic <cosiclili@gmail.com>
2021-06-14 16:36:50 +02:00
Lili Cosic
d563c76e92 client/v3/maintenance.go: Add Downgrade support to client 2021-06-04 13:53:09 +02:00
Piotr Tabor
8a7f15511c clientv3: Move to client/v3 (just file move)
Mechanical:
% git mv clientv3 client/v3
% git mv client/mock client/v3/
2020-10-20 10:08:35 +02:00