-
Notifications
You must be signed in to change notification settings - Fork 615
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
feat(meta): wrap etcd client to be able to refresh conn when auth token expired #6872
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6872 +/- ##
==========================================
- Coverage 73.22% 73.15% -0.07%
==========================================
Files 1031 1032 +1
Lines 164642 164774 +132
==========================================
- Hits 120553 120543 -10
- Misses 44089 44231 +142
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Generally LGTM. Can we give some feedbacks to upstream? |
@arkbriar has opened an issue here etcdv3/etcd-client#45, I'm afraid the modification in this pr is only applicable to our project and It's quite difficult to achieve it in its library side. 🥵 Let's keep this workaround and see. |
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! Thanks for addressing this issue! cc. @mikechesterwang for awareness.
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
I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.
What's changed and what's your intention?
If auth enabled in etcd cluster and meta uses user/password to communicate with etcd, meta will crash when the etcd cluster encountered master/standby switchover or reboot.
But unfortunately Rust etcd library doesn't provide any token refresh APIs, and based on the library's implementation we can impossible refresh the token in all clients using auth interface. See etcdv3/etcd-client#45 for more details.
Currently the only way to achieve it is to create a new connection instead, which is what we did in this PR. Previously I think it might brings some overhead due to the clone of all requests, but since we have already introduced
etcd_retry_client
, we can leave it to the retry part.Checklist
./risedev check
(or alias,./risedev c
)Documentation
If your pull request contains user-facing changes, please specify the types of the changes, and create a release note. Otherwise, please feel free to remove this section.
Types of user-facing changes
Please keep the types that apply to your changes, and remove those that do not apply.
Release note
Please create a release note for your changes. In the release note, focus on the impact on users, and mention the environment or conditions where the impact may occur.
Refer to a related PR or issue link (optional)