Skip to content
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

Merged
merged 1 commit into from
Jun 24, 2021

Conversation

serathius
Copy link
Member

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.

@serathius
Copy link
Member Author

cc @ptabor

@serathius
Copy link
Member Author

cc @lilic

@xiang90
Copy link
Contributor

xiang90 commented Jun 22, 2021

LGTM

@serathius serathius force-pushed the refactor-monitor branch 6 times, most recently from f7d9c60 to c623991 Compare June 22, 2021 21:46
Copy link
Contributor

@lilic lilic left a 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.

var _ serverversion.VersionStorage = (*serverVersionAdapter)(nil)

func (s *serverVersionAdapter) UpdateClusterVersion(version string) {
// TODO switch to updateClusterVersionV3 in 3.6
Copy link
Contributor

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.

Copy link
Member Author

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.

@ptabor ptabor merged commit 72cb652 into etcd-io:main Jun 24, 2021
@serathius serathius deleted the refactor-monitor branch June 15, 2023 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants