-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
etcdserver: Move version monitor logic to separate module #13132
Conversation
cc @ptabor |
7d09924
to
13212f3
Compare
cc @lilic |
LGTM |
f7d9c60
to
c623991
Compare
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.
Nice! 👍 One small thing, but we can do it in a follow up.
server/etcdserver/server.go
Outdated
var _ serverversion.VersionStorage = (*serverVersionAdapter)(nil) | ||
|
||
func (s *serverVersionAdapter) UpdateClusterVersion(version string) { | ||
// TODO switch to updateClusterVersionV3 in 3.6 |
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.
Since it's 3.6 now should we do this already? I am fine with a separate PR as well.
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.
Separate :P, lets make such changes in organized bulk way, instead of trickles.
c623991
to
823f85d
Compare
When working on version downgrade I noticed that logic responsible for managing versions is spread all over etcdserver module. As logic is spread around it was never tested together leading to errors like described in #11716 (comment) where cluster version monitor didn't work well with downgrade monitor.
To ensure that downgrades are well tested and working correctly we need one place to all logic together. This PR is a first step in this direction. It moves downgrade and version monitor logic to a separate module. We define an interface over etcdServer that will allow this logic to manipulate version, but also stub backend and member versions in future so we can simulate step by step upgrade process. To avoid exposing version change logic publicly I have created an adapter struct that implements the interface, but is not available outside of module.