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

agent: add default weights to service in local state to prevent AE churn #5126

Merged
merged 2 commits into from
Jan 8, 2019

Conversation

banks
Copy link
Member

@banks banks commented Dec 20, 2018

Add default weights when adding a service with no weights to local state to prevent constant AE re-sync.

This fix was contributed by @42wim in #5096 but was merged against the wrong base.

This adds it to master and adds a test to cover the behaviour.

…ate to prevent constant AE re-sync.

This fix was contributed by @42wim in #5096 but was merged against the wrong base. This adds it to master and adds a test to cover the behaviour.
@banks banks requested a review from a team December 20, 2018 15:38
@banks banks added this to the 1.4.1 milestone Dec 20, 2018
Copy link
Contributor

@pierresouchay pierresouchay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good To Me

@@ -1880,6 +1880,12 @@ func (a *Agent) AddService(service *structs.NodeService, chkTypes []*structs.Che
}
}

// Set default weights if not specified. This is important as it ensures AE
// doesn't consider the service different since it has nil weights.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this because on the server side they end up getting defaulted? This seems fine to me regardless, just trying to understand why there is a problem.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I think so as I understand it.

@mkeeler
Copy link
Member

mkeeler commented Jan 7, 2019

@banks the travis test failures look to be real and due to comparing nil to the new default weights.

@banks
Copy link
Member Author

banks commented Jan 7, 2019

I think I fixed all the tests that broke due to this - will check CI again in a bit.

@banks banks merged commit bb7145f into master Jan 8, 2019
@mkeeler mkeeler deleted the fix-default-weight-service-churn branch June 11, 2019 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants