-
-
Notifications
You must be signed in to change notification settings - Fork 538
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
[management] Optimize network map updates #2718
Merged
Merged
Conversation
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
* Enhance network updates by skipping unchanged messages Optimizes the network update process by skipping updates where no changes in the peer update message received. * Add unit tests * add locks * Improve concurrency and update peer message handling * Refactor account manager network update tests * fix test * Fix inverted network map update condition * Add default group and policy to test data * Run peer updates in a separate goroutine * Refactor * Refactor lock
# Conflicts: # management/server/peer.go
# Conflicts: # go.sum
# Conflicts: # management/server/account_test.go # management/server/peer.go
Signed-off-by: bcmmbaga <[email protected]>
# Conflicts: # management/server/testdata/store.json
Signed-off-by: bcmmbaga <[email protected]>
mlsmaycon
reviewed
Oct 21, 2024
mlsmaycon
reviewed
Oct 21, 2024
# Conflicts: # management/server/peer/peer.go
) * Remove incrementing network serial and updating peers after group deletion * Update account peer if posture check is linked to policy * Remove account peers update on saving setup key * Refactor group link checking into re-usable functions * Add HasPeers function to group * Refactor group management * Optimize group change effects on account peers * Update account peers if ns group has peers * Refactor group changes * Optimize account peers update in DNS settings * Optimize update of account peers on jwt groups sync * Refactor peer account updates for efficiency * Optimize peer update on user deletion and changes * Remove condition check for network serial update * Optimize account peers updates on route changes * Remove UpdatePeerSSHKey method * Remove unused isPolicyRuleGroupsEmpty * Add tests for peer update behavior on posture check changes * Add tests for peer update behavior on policy changes * Add tests for peer update behavior on group changes * Add tests for peer update behavior on dns settings changes * Refactor * Add tests for peer update behavior on name server changes * Add tests for peer update behavior on user changes * Add tests for peer update behavior on route changes * fix tests * Add tests for peer update behavior on setup key changes * Add tests for peer update behavior on peers changes * fix merge * Fix tests * go mod tidy * Add NameServer and Route comparators * Update network map diff logic with custom comparators * Add tests * Refactor duplicate diff handling logic * fix linter * fix tests * Refactor policy group handling and update logic. Signed-off-by: bcmmbaga <[email protected]> * Update route check by checking if group has peers Signed-off-by: bcmmbaga <[email protected]> * Refactor posture check policy linking logic Signed-off-by: bcmmbaga <[email protected]> * Simplify peer update condition in DNS management Refactor the condition for updating account peers to remove redundant checks Signed-off-by: bcmmbaga <[email protected]> * fix tests Signed-off-by: bcmmbaga <[email protected]> * fix merge Signed-off-by: bcmmbaga <[email protected]> * add policy tests Signed-off-by: bcmmbaga <[email protected]> * add posture checks tests Signed-off-by: bcmmbaga <[email protected]> * fix user and setup key tests Signed-off-by: bcmmbaga <[email protected]> * fix account and route tests Signed-off-by: bcmmbaga <[email protected]> * fix typo Signed-off-by: bcmmbaga <[email protected]> * fix nameserver tests Signed-off-by: bcmmbaga <[email protected]> * fix routes tests Signed-off-by: bcmmbaga <[email protected]> * fix group tests Signed-off-by: bcmmbaga <[email protected]> * upgrade diff package Signed-off-by: bcmmbaga <[email protected]> * fix nameserver tests Signed-off-by: bcmmbaga <[email protected]> * use generic differ for netip.Addr and netip.Prefix Signed-off-by: bcmmbaga <[email protected]> * go mod tidy Signed-off-by: bcmmbaga <[email protected]> * add peer tests Signed-off-by: bcmmbaga <[email protected]> * fix merge Signed-off-by: bcmmbaga <[email protected]> * fix management suite tests Signed-off-by: bcmmbaga <[email protected]> * fix postgres tests Signed-off-by: bcmmbaga <[email protected]> * enable diff nil structs comparison Signed-off-by: bcmmbaga <[email protected]> * skip the update only last sent the serial is larger Signed-off-by: bcmmbaga <[email protected]> * refactor peer and user Signed-off-by: bcmmbaga <[email protected]> * skip spell check for groupD Signed-off-by: bcmmbaga <[email protected]> * Refactor group, ns group, policy and posture checks Signed-off-by: bcmmbaga <[email protected]> * skip spell check for GroupD Signed-off-by: bcmmbaga <[email protected]> * update account policy check before verifying policy status Signed-off-by: bcmmbaga <[email protected]> * Update management/server/route_test.go Co-authored-by: Maycon Santos <[email protected]> * Update management/server/route_test.go Co-authored-by: Maycon Santos <[email protected]> * Update management/server/route_test.go Co-authored-by: Maycon Santos <[email protected]> * Update management/server/route_test.go Co-authored-by: Maycon Santos <[email protected]> * Update management/server/route_test.go Co-authored-by: Maycon Santos <[email protected]> * add tests missing tests for dns setting groups Signed-off-by: bcmmbaga <[email protected]> * add tests for posture checks changes Signed-off-by: bcmmbaga <[email protected]> * add ns group and policy tests Signed-off-by: bcmmbaga <[email protected]> * add route and group tests Signed-off-by: bcmmbaga <[email protected]> * increase Linux test timeout to 10 minutes Signed-off-by: bcmmbaga <[email protected]> * Run diff for client posture checks only Signed-off-by: bcmmbaga <[email protected]> * add panic recovery and detailed logging in peer update comparison Signed-off-by: bcmmbaga <[email protected]> * Fix tests Signed-off-by: bcmmbaga <[email protected]> --------- Signed-off-by: bcmmbaga <[email protected]> Co-authored-by: Maycon Santos <[email protected]>
Quality Gate passedIssues Measures |
pascal-fischer
approved these changes
Oct 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Describe your changes
This PR optimizes account peer updates to trigger only when necessary, reducing unnecessary network map processing and updates. These changes improve efficiency by avoiding redundant updates while ensuring all necessary updates are still performed.
Issue ticket number and link
Checklist