Closed ZuLiangWang closed 1 year ago
Merging #215 (93bc41b) into main (7f1354e) will increase coverage by
21.49%
. Report is 27 commits behind head on main. The diff coverage is65.21%
.
@@ Coverage Diff @@
## main #215 +/- ##
===========================================
+ Coverage 39.66% 61.15% +21.49%
===========================================
Files 34 43 +9
Lines 4213 5337 +1124
===========================================
+ Hits 1671 3264 +1593
+ Misses 2317 1673 -644
- Partials 225 400 +175
Files Changed | Coverage Δ | |
---|---|---|
pkg/coderr/code.go | 0.00% <ø> (ø) |
|
server/cluster/metadata/types.go | 0.00% <0.00%> (ø) |
|
server/coordinator/procedure/util.go | 0.00% <ø> (ø) |
|
server/storage/meta.go | 0.00% <ø> (ø) |
|
server/storage/storage_impl.go | 57.21% <0.00%> (-5.10%) |
:arrow_down: |
server/member/watch_leader.go | 40.62% <20.00%> (-2.71%) |
:arrow_down: |
server/cluster/manager.go | 38.96% <23.18%> (ø) |
|
server/coordinator/factory.go | 76.68% <27.27%> (+72.22%) |
:arrow_up: |
.../operation/transferleader/batch_transfer_leader.go | 33.80% <33.80%> (ø) |
|
server/member/member.go | 47.70% <47.82%> (-1.02%) |
:arrow_down: |
... and 21 more |
Which issue does this PR close?
Closes #200 #208
Rationale for this change
As mentioned in the issue, we need to optimize the current algorithm for assigning shards to nodes so that the distribution of shards on nodes becomes more even.
What changes are included in this PR?
ConsistentHashRing
withUniformityHash
.NodePicker
based onuniformityHash
, which make the distribution of shards on nodes becomes more even.Are there any user-facing changes?
How does this change test
Pass all unit tests and integration test, and observe the distribution of Shard in the unit test to ensure that its distribution is reasonable.