-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[Performance On Large clusters] Reduce updates on large services #4720
Merged
banks
merged 14 commits into
hashicorp:master
from
pierresouchay:checks_do_not_modify_services_when_not_needed
Oct 11, 2018
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5441c83
[Performance On Large clusters] Checks do update services/nodes only …
pierresouchay 6515fb5
[Performance for large clusters] Only updates index of service if ser…
pierresouchay 11ce5a2
[Performance for large clusters] Only updates index of nodes if node …
pierresouchay eb95545
Added comments / ensure IsSame() has clear semantics
pierresouchay 82a903e
Avoid having modified boolean, return nil directly if stutures are Same
pierresouchay efce3f1
Fixed unstable unit tests TestLeader_ChangeServerID
pierresouchay 4b1f466
Rewrite TestNode_IsSame() for better readability as suggested by @banks
pierresouchay aab2d16
Rename ServiceNode.IsSame() into IsSameService() + added unit tests
pierresouchay af4c8d7
Merge remote-tracking branch 'origin' into checks_do_not_modify_servi…
pierresouchay 8c535cd
Do not duplicate TestStructs_ServiceNode_Conversions() and increase t…
pierresouchay b29fcd5
Clearer documentation in IsSameService
pierresouchay f8bf4c8
Take into account ServiceProxy into ServiceNode.IsSameService()
pierresouchay 4ca41d5
Merge remote-tracking branch 'origin' into checks_do_not_modify_servi…
pierresouchay 9c1ffd6
Fixed IsSameService() with all new structures
pierresouchay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I assume there is a reason why we cannot just return here like you did for the IsSame check on the node. If so it would be good to have a comment indicating why you can't, why the node needs to still be Inserted but why the "index" table doesn't require updating.
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.
Not really, was just to avoid to change too many tests.
Another possible reason was adding into Consul some values in DB, for instance pre-filled values from ToServiceNodes(), for instance Weights.
While semantics to not change, we are sure we are keeping the same kind of data before and after the patch (while upgrade semantics stays untouched).
Added comments in next patch
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.
As for the default values coming from ToServiceNode, that call happens prior to the IsSame check so if any of the defaults change then IsSame should return false and cause reinsertion.
As for the other reason of wanting to return ErrMissingNode, why can't we just move the node check block to before the ToServiceNode call?
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.
You are right, I wanted to have a change as small as possible, but you are definitely right, changing that...