Skip to content

Commit

Permalink
Merge branch 'release-7.5' into cherry-pick-8028-to-release-7.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot[bot] authored Jun 19, 2024
2 parents 4cf0562 + c2928cd commit aa4e30c
Show file tree
Hide file tree
Showing 15 changed files with 137 additions and 4 deletions.
26 changes: 26 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See the OWNERS docs at https://go.k8s.io/owners
approvers:
- AndreMouche
- binshi-bing
- bufferflies
- CabinfeverB
- Connor1996
- disksing
- huachaohuang
- HunDunDM
- HuSharp
- JmPotato
- lhy1024
- nolouch
- overvenus
- qiuyesuifeng
- rleungx
- siddontang
- Yisaer
- zhouqiang-cl
reviewers:
- BusyJay
- howardlau1999
- Luffbee
- shafreeck
- xhebox
6 changes: 6 additions & 0 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Sort the member alphabetically.
aliases:
sig-critical-approvers-config:
- easonn7
- kevin-xianliu
- niubell
7 changes: 7 additions & 0 deletions client/resource_group/controller/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"(OWNERS|config\\.go)$":
approvers:
- sig-critical-approvers-config
7 changes: 7 additions & 0 deletions client/tlsutil/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"(OWNERS|tlsconfig\\.go)$":
approvers:
- sig-critical-approvers-config
7 changes: 7 additions & 0 deletions conf/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"(OWNERS|config\\.toml)$":
approvers:
- sig-critical-approvers-config
7 changes: 7 additions & 0 deletions pkg/encryption/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"(OWNERS|config\\.go)$":
approvers:
- sig-critical-approvers-config
7 changes: 7 additions & 0 deletions pkg/mcs/resourcemanager/server/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"(OWNERS|config\\.go)$":
approvers:
- sig-critical-approvers-config
2 changes: 2 additions & 0 deletions pkg/mcs/resourcemanager/server/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ func (m *Manager) Init(ctx context.Context) error {
return err
}
// Load resource group meta info from storage.
m.Lock()
m.groups = make(map[string]*ResourceGroup)
m.Unlock()
handler := func(k, v string) {
group := &rmpb.ResourceGroup{}
if err := proto.Unmarshal([]byte(v), group); err != nil {
Expand Down
7 changes: 7 additions & 0 deletions pkg/mcs/scheduling/server/config/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"(OWNERS|config\\.go)$":
approvers:
- sig-critical-approvers-config
7 changes: 7 additions & 0 deletions pkg/mcs/tso/server/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"(OWNERS|config\\.go)$":
approvers:
- sig-critical-approvers-config
7 changes: 7 additions & 0 deletions pkg/schedule/config/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"(OWNERS|(config|store_config)\\.go)$":
approvers:
- sig-critical-approvers-config
7 changes: 7 additions & 0 deletions pkg/schedule/schedulers/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"(OWNERS|hot_region_config\\.go)$":
approvers:
- sig-critical-approvers-config
11 changes: 7 additions & 4 deletions pkg/utils/etcdutil/health_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func (checker *healthChecker) updateEvictedEps(lastEps, pickedEps []string) {
for _, ep := range pickedEps {
pickedSet[ep] = true
}
// Reset the count to 0 if it's in evictedEps but not in the pickedEps.
// Reset the count to 0 if it's in `evictedEps` but not in `pickedEps`.
checker.evictedEps.Range(func(key, value any) bool {
ep := key.(string)
count := value.(int)
Expand All @@ -286,18 +286,21 @@ func (checker *healthChecker) updateEvictedEps(lastEps, pickedEps []string) {
}
return true
})
// Find all endpoints which are in the lastEps but not in the pickedEps,
// and add them to the evictedEps.
// Find all endpoints which are in `lastEps` and `healthyClients` but not in `pickedEps`,
// and add them to the `evictedEps`.
for _, ep := range lastEps {
if pickedSet[ep] {
continue
}
if hc := checker.loadClient(ep); hc == nil {
continue
}
checker.evictedEps.Store(ep, 0)
log.Info("evicted etcd endpoint found",
zap.String("endpoint", ep),
zap.String("source", checker.source))
}
// Find all endpoints which are in both pickedEps and evictedEps to
// Find all endpoints which are in both `pickedEps` and `evictedEps` to
// increase their picked count.
for _, ep := range pickedEps {
if count, ok := checker.evictedEps.Load(ep); ok {
Expand Down
26 changes: 26 additions & 0 deletions pkg/utils/etcdutil/health_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func check(re *require.Assertions, testCases []*testCase) {
probeCh := make(chan healthProbe, len(tc.healthProbes))
for _, probe := range tc.healthProbes {
probeCh <- probe
// Mock that all the endpoints are healthy.
checker.healthyClients.LoadOrStore(probe.ep, &healthyClient{})
}
close(probeCh)
// Pick and filter the endpoints.
Expand Down Expand Up @@ -361,3 +363,27 @@ func TestLatencyPick(t *testing.T) {
}
check(re, testCases)
}

func TestUpdateEvictedEpsAfterRemoval(t *testing.T) {
re := require.New(t)
var (
checker = &healthChecker{}
lastEps = []string{"A", "B", "C"}
pickedEps = []string{"A", "C"}
)
// All endpoints are healthy.
for _, ep := range lastEps {
checker.healthyClients.Store(ep, &healthyClient{})
}
checker.updateEvictedEps(lastEps, pickedEps)
// B should be evicted.
_, ok := checker.evictedEps.Load("B")
re.True(ok)
// Remove the endpoint B to mock member removal.
checker.healthyClients.Delete("B")
checker.evictedEps.Delete("B")
checker.updateEvictedEps(lastEps, pickedEps)
// B should not be evicted since it has been removed.
_, ok = checker.evictedEps.Load("B")
re.False(ok)
}
7 changes: 7 additions & 0 deletions server/config/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"(OWNERS|(config|service_middleware_config)\\.go)$":
approvers:
- sig-critical-approvers-config

0 comments on commit aa4e30c

Please sign in to comment.