-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: optimize implement of the sync peers #3677
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
8a1941e
to
0a2873b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3677 +/- ##
==========================================
- Coverage 35.50% 35.45% -0.05%
==========================================
Files 336 335 -1
Lines 37657 37617 -40
==========================================
- Hits 13369 13337 -32
+ Misses 23461 23457 -4
+ Partials 827 823 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
0a2873b
to
b809422
Compare
0b273ad
to
1a855da
Compare
chlins
previously approved these changes
Nov 29, 2024
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.
lgtm
af40d1a
to
3a0ba1f
Compare
Signed-off-by: Gaius <gaius.qi@gmail.com>
3a0ba1f
to
da3184a
Compare
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
Description
This pull request includes significant changes to the synchronization of peer information in the
manager
package, specifically focusing on improving the sync process and validation. The most important changes include updating the peer sync logic, adding validation for theBatchSize
parameter, and modifying related tests.Improvements to peer synchronization:
manager/job/sync_peers.go
: Refactored theSyncPeers
interface and related methods to make the sync operation synchronous, ensuring no concurrent sync jobs run simultaneously. The new logic merges sync peer results with the database and handles batch operations more efficiently. [1] [2] [3]Validation enhancements:
manager/config/config.go
: Added validation to ensureBatchSize
is not zero in theValidate
method and updated theSyncPeersConfig
struct to clarify the purpose of theBatchSize
field. [1] [2]Test updates:
manager/config/config_test.go
: Updated tests to include validation for theBatchSize
parameter and ensure proper configuration loading. [1] [2]Configuration updates:
manager/config/constants.go
: Updated the description of the default batch size constant to reflect its dual purpose for syncing peers and database operations.manager/config/testdata/manager.yaml
: Added thebatchSize
parameter to thesyncPeers
configuration in the test data.These changes enhance the robustness and efficiency of the peer synchronization process and ensure proper configuration validation.
Related Issue
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist