[PR #2236] [MERGED] Skip peer update on unchanged network map #14853

Closed
opened 2026-08-05 03:06:27 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2236
Author: @bcmmbaga
Created: 7/4/2024
Status: Merged
Merged: 7/18/2024
Merged by: @bcmmbaga

Base: feature/optimize-network-map-updatesHead: feature/validate-proto-message-send-response


📝 Commits (10+)

  • b721f2d Enhance network updates by skipping unchanged messages
  • e3e66fe Add unit tests
  • 0a69f8a add locks
  • 2ae4b1b Improve concurrency and update peer message handling
  • 5ebbef5 Refactor account manager network update tests
  • 9693af8 fix test
  • dd73262 Fix inverted network map update condition
  • f866348 Add default group and policy to test data
  • 30bf028 Run peer updates in a separate goroutine
  • dbd2f38 Refactor

📊 Changes

9 files changed (+410 additions, -148 deletions)

View changed files

📝 go.mod (+1 -0)
📝 go.sum (+2 -0)
📝 management/server/account_test.go (+174 -128)
📝 management/server/network.go (+2 -2)
📝 management/server/peer.go (+3 -1)
📝 management/server/peer/peer.go (+9 -9)
📝 management/server/testdata/store.json (+35 -3)
📝 management/server/updatechannel.go (+81 -5)
📝 management/server/updatechannel_test.go (+103 -0)

📄 Description

Describe your changes

Optimizes the peer sync update process by skipping sending peer updates where no changes in network map or client posture checks.

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/2236 **Author:** [@bcmmbaga](https://github.com/bcmmbaga) **Created:** 7/4/2024 **Status:** ✅ Merged **Merged:** 7/18/2024 **Merged by:** [@bcmmbaga](https://github.com/bcmmbaga) **Base:** `feature/optimize-network-map-updates` ← **Head:** `feature/validate-proto-message-send-response` --- ### 📝 Commits (10+) - [`b721f2d`](https://github.com/netbirdio/netbird/commit/b721f2d01f4ef1e59a74d23f770a9328b86a7959) Enhance network updates by skipping unchanged messages - [`e3e66fe`](https://github.com/netbirdio/netbird/commit/e3e66fea4beb4418d99e36334c74a13425c49a2a) Add unit tests - [`0a69f8a`](https://github.com/netbirdio/netbird/commit/0a69f8ad1c82ad8308654c4f162c0e3fa6cbcdde) add locks - [`2ae4b1b`](https://github.com/netbirdio/netbird/commit/2ae4b1b6fb794f5bdbd411fc40ee19d18fd84074) Improve concurrency and update peer message handling - [`5ebbef5`](https://github.com/netbirdio/netbird/commit/5ebbef5f24f8c1f4ca078a99c3571c692940f911) Refactor account manager network update tests - [`9693af8`](https://github.com/netbirdio/netbird/commit/9693af816b7083faa6ee80328fc0e86c4b1eaeaa) fix test - [`dd73262`](https://github.com/netbirdio/netbird/commit/dd732627e2833cff5d99cfb2ee1e20c29d419ea9) Fix inverted network map update condition - [`f866348`](https://github.com/netbirdio/netbird/commit/f8663480e35113f7a9877b3d38ed415a743780b7) Add default group and policy to test data - [`30bf028`](https://github.com/netbirdio/netbird/commit/30bf0287073dcb8d085baa94c13c21cb1f954c8c) Run peer updates in a separate goroutine - [`dbd2f38`](https://github.com/netbirdio/netbird/commit/dbd2f3834195eea1015537ca09d0b424729d9434) Refactor ### 📊 Changes **9 files changed** (+410 additions, -148 deletions) <details> <summary>View changed files</summary> 📝 `go.mod` (+1 -0) 📝 `go.sum` (+2 -0) 📝 `management/server/account_test.go` (+174 -128) 📝 `management/server/network.go` (+2 -2) 📝 `management/server/peer.go` (+3 -1) 📝 `management/server/peer/peer.go` (+9 -9) 📝 `management/server/testdata/store.json` (+35 -3) 📝 `management/server/updatechannel.go` (+81 -5) 📝 `management/server/updatechannel_test.go` (+103 -0) </details> ### 📄 Description ## Describe your changes Optimizes the peer sync update process by skipping sending peer updates where no changes in network map or client posture checks. ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 03:06:27 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#14853