-
-
Notifications
You must be signed in to change notification settings - Fork 895
[client] Enhance SyncRequest with NetworkMap serial tracking #4546
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
base: main
Are you sure you want to change the base?
Conversation
- Added `networkMapSerial` field to `SyncRequest` for tracking the last known network map serial number. - Updated `GrpcClient` to store and utilize the last network map serial during sync operations, optimizing synchronization processes. - Improved handling of system info updates to ensure accurate metadata is sent with sync requests.
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.
Pull Request Overview
This PR enhances the SyncRequest
protocol buffer message with network map serial tracking functionality to optimize synchronization processes between clients and management servers.
- Added
networkMapSerial
field toSyncRequest
for tracking the last known network map serial number - Updated
GrpcClient
to store and utilize the last network map serial during sync operations - Improved system info handling to ensure accurate metadata is sent with sync requests
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
shared/management/proto/management.proto | Added networkMapSerial field to SyncRequest message |
shared/management/proto/management.pb.go | Auto-generated protobuf code with new field and getter method |
shared/management/client/grpc.go | Updated client to track network map serial and recompute system info for sync requests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
shared/management/client/grpc.go
Outdated
recomputed.SetFlags( | ||
sysInfo.RosenpassEnabled, | ||
sysInfo.RosenpassPermissive, | ||
&sysInfo.ServerSSHAllowed, | ||
sysInfo.DisableClientRoutes, | ||
sysInfo.DisableServerRoutes, | ||
sysInfo.DisableDNS, | ||
sysInfo.DisableFirewall, | ||
sysInfo.BlockLANAccess, | ||
sysInfo.BlockInbound, | ||
sysInfo.LazyConnectionEnabled, | ||
) |
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.
[nitpick] The manual copying of individual flags is error-prone and difficult to maintain. Consider implementing a method like MergeFlags()
or CopyFlags()
on the system.Info struct to handle this logic centrally and reduce the risk of missing fields when new flags are added.
recomputed.SetFlags( | |
sysInfo.RosenpassEnabled, | |
sysInfo.RosenpassPermissive, | |
&sysInfo.ServerSSHAllowed, | |
sysInfo.DisableClientRoutes, | |
sysInfo.DisableServerRoutes, | |
sysInfo.DisableDNS, | |
sysInfo.DisableFirewall, | |
sysInfo.BlockLANAccess, | |
sysInfo.BlockInbound, | |
sysInfo.LazyConnectionEnabled, | |
) | |
recomputed.CopyFlagsFrom(sysInfo) |
Copilot uses AI. Check for mistakes.
|
- Removed atomic operations for lastNetworkMapSerial and replaced them with mutex-based methods for thread-safe access.
Describe your changes
networkMapSerial
field toSyncRequest
for tracking the last known network map serial number.GrpcClient
to store and utilize the last network map serial during sync operations, optimizing synchronization processes.Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
.
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__