Skip to content
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

Dynamic/test #8

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c6f7726
add one metrics
bufferflies Jul 11, 2022
efc783c
Merge branches 'master' and 'master' of github.com:tikv/pd
bufferflies Jul 13, 2022
2ac5ce1
Merge branch 'master' of github.com:tikv/pd
bufferflies Jul 14, 2022
1606d99
Merge branch 'master' of github.com:tikv/pd
bufferflies Jul 14, 2022
500e3a8
Revert "add one metrics"
bufferflies Jul 14, 2022
c56199f
Merge branch 'master' of github.com:tikv/pd
bufferflies Jul 18, 2022
af1b6b6
init store limit
bufferflies Jul 18, 2022
590cf75
add unit test
bufferflies Jul 19, 2022
5ed9032
panic
bufferflies Jul 19, 2022
e3daa3b
recv-snap-limit
bufferflies Jul 19, 2022
bfa9c11
add log
bufferflies Jul 19, 2022
c46d0ff
token
bufferflies Jul 19, 2022
defc392
add log
bufferflies Jul 26, 2022
f826930
add log
bufferflies Jul 26, 2022
14cffea
refactor snap size
bufferflies Jul 27, 2022
e3da3cd
add config for snapshot
bufferflies Jul 29, 2022
d5cfd10
add sender snapshot limit
bufferflies Aug 2, 2022
3fe5beb
raft
bufferflies Aug 8, 2022
f4f9d1d
cache influence
bufferflies Aug 15, 2022
3323cb2
update origin
bufferflies Aug 15, 2022
1d819d6
Merge branch 'feature/influence' into dynamic/test
bufferflies Aug 15, 2022
3433cdc
merge cache influence
bufferflies Aug 15, 2022
6d8e7f1
update kvproto
bufferflies Aug 16, 2022
ae53a4c
add log
bufferflies Aug 16, 2022
4a3fbea
fix recv size bug
bufferflies Aug 16, 2022
1710746
add limit
bufferflies Aug 16, 2022
c1f6ad9
report sent size
bufferflies Aug 17, 2022
51b6365
unsent
bufferflies Aug 17, 2022
fabdd34
remove log and send filter
bufferflies Aug 17, 2022
087a4a7
add sec
bufferflies Aug 22, 2022
5fcf717
rlock
bufferflies Aug 22, 2022
915a270
panic
bufferflies Aug 22, 2022
dea16d2
cost
bufferflies Aug 22, 2022
42cd811
add feedback for recv
bufferflies Aug 23, 2022
1b21d1e
log
bufferflies Aug 23, 2022
d3e29eb
panic
bufferflies Aug 23, 2022
6cda434
adjust size
bufferflies Aug 23, 2022
785312b
min vaue
bufferflies Aug 23, 2022
de11f4f
avoid inc
bufferflies Aug 23, 2022
dec2c66
adjust pi
bufferflies Aug 23, 2022
177f5e1
add generator size
bufferflies Aug 24, 2022
10150c8
feedback send
bufferflies Aug 24, 2022
db52bc3
add log
bufferflies Aug 25, 2022
2e57ee9
filter recv
bufferflies Aug 25, 2022
8afc236
add switch
bufferflies Aug 25, 2022
dd6f288
log
bufferflies Aug 25, 2022
e206710
update kvproto
bufferflies Sep 5, 2022
d674f5a
conflict
bufferflies Sep 5, 2022
2725727
uint64 to int64
bufferflies Sep 5, 2022
c569511
min tolerate sec
bufferflies Sep 6, 2022
9a2d329
use send
bufferflies Sep 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
conflict
Signed-off-by: bufferflies <1045931706@qq.com>
  • Loading branch information
bufferflies committed Sep 5, 2022
commit d674f5a882b6f2ece3bda12d31166c1b8b74c6e4
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -176,4 +176,4 @@ require (
sigs.k8s.io/yaml v1.1.0 // indirect
)

replace github.com/pingcap/kvproto v0.0.0-20220805093305-ab1ee4d521ab => github.com/bufferflies/kvproto v0.0.0-20220905085223-a755556a1053
replace github.com/pingcap/kvproto v0.0.0-20220818063303-5c20f55db5ad => github.com/bufferflies/kvproto v0.0.0-20220905085223-a755556a1053
4 changes: 1 addition & 3 deletions go.sum
Original file line number Diff line number Diff line change
@@ -49,9 +49,7 @@ github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4Yn
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/breeswish/gin-jwt/v2 v2.6.4-jwt-patch h1:KLE/YeX+9FNaGVW5MtImRVPhjDpfpgJhvkuYWBmOYbo=
github.com/breeswish/gin-jwt/v2 v2.6.4-jwt-patch/go.mod h1:KjBLriHXe7L6fGceqWzTod8HUB/TP1WWDtfuSYtYXaI=
github.com/bufferflies/kvproto v0.0.0-20220822072948-2d22d5ad68c3 h1:H4qG9RENpQfn679FByBDS5Z8MA7IwbBCsM08bG85d/Q=
github.com/bufferflies/kvproto v0.0.0-20220822072948-2d22d5ad68c3/go.mod h1:OYtxs0786qojVTmkVeufx93xe+jUgm56GUYRIKnmaGI=
github.com/bufferflies/kvproto v0.0.0-20220905065233-ee177f9c41e4/go.mod h1:OYtxs0786qojVTmkVeufx93xe+jUgm56GUYRIKnmaGI=
github.com/bufferflies/kvproto v0.0.0-20220905085223-a755556a1053 h1:44CC47lCnidk8LzO8a0iFO7je2HJR1w8cUdCwQzMuxE=
github.com/bufferflies/kvproto v0.0.0-20220905085223-a755556a1053/go.mod h1:OYtxs0786qojVTmkVeufx93xe+jUgm56GUYRIKnmaGI=
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5 h1:BjkPE3785EwPhhyuFkbINB+2a1xATwk8SNDWnJiD41g=
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5/go.mod h1:jtAfVaU/2cu1+wdSRPWE2c1N2qeAA3K4RH9pYgqwets=
20 changes: 10 additions & 10 deletions server/schedule/filter/filters.go
Original file line number Diff line number Diff line change
@@ -362,6 +362,15 @@ func (f *StoreStateFilter) slowStoreEvicted(opt *config.PersistOptions, store *c
return statusOK
}

func (f *StoreStateFilter) exceedRecvSnapLimit(_ *config.PersistOptions, store *core.StoreInfo) *plan.Status {
if !f.AllowTemporaryStates && !store.IsAvailableSnap(storelimit.RecvSnapShot) {
f.Reason = "exceed-recv-snapshot-limit"
return statusStoreSnapRemoveLimit
}
f.Reason = ""
return statusOK
}

func (f *StoreStateFilter) isDisconnected(opt *config.PersistOptions, store *core.StoreInfo) *plan.Status {
if !f.AllowTemporaryStates && store.IsDisconnected() {
f.Reason = "disconnected"
@@ -380,16 +389,7 @@ func (f *StoreStateFilter) isBusy(opt *config.PersistOptions, store *core.StoreI
return statusOK
}

func (f *StoreStateFilter) exceedRecvSnapLimit(_ *config.PersistOptions, store *core.StoreInfo) plan.Status {
if !f.AllowTemporaryStates && !store.IsAvailableSnap(storelimit.RecvSnapShot) {
f.Reason = "exceed-recv-snapshot-limit"
return statusStoreSnapRemoveLimit
}
f.Reason = ""
return statusOK
}

func (f *StoreStateFilter) exceedRemoveLimit(opt *config.PersistOptions, store *core.StoreInfo) plan.Status {
func (f *StoreStateFilter) exceedRemoveLimit(opt *config.PersistOptions, store *core.StoreInfo) *plan.Status {
if !f.AllowTemporaryStates && !store.IsAvailable(storelimit.RemovePeer) {
f.Reason = "exceed-remove-limit"
return statusStoreRemoveLimit
40 changes: 21 additions & 19 deletions server/schedule/filter/status.go
Original file line number Diff line number Diff line change
@@ -19,26 +19,28 @@ import "github.com/tikv/pd/server/schedule/plan"
var (
statusOK = plan.NewStatus(plan.StatusOK)

// store filter status
statusStoreDown = plan.NewStatus(plan.StatusStoreUnavailable, "store is lost for longer than 'max-store-down-time' setting")
statusStoreTombstone = plan.NewStatus(plan.StatusStoreUnavailable, "store is tombstone")
statusStoreDisconnected = plan.NewStatus(plan.StatusStoreUnavailable, "store is lost for more than 20s")
statusStoreBusy = plan.NewStatus(plan.StatusStoreUnavailable, "store is busy")
statusStoresOffline = plan.NewStatus(plan.StatusStoreDraining, "store is in the process of offline")
statusStoreLowSpace = plan.NewStatus(plan.StatusStoreLowSpace, "store space is not enough, please scale out or change 'low-space-ratio' setting")
statusStoreExcluded = plan.NewStatus(plan.StatusStoreExcluded, "there has already had a peer or the peer is unhealthy in the store")
statusStoreIsolation = plan.NewStatus(plan.StatusIsolationNotMatch)
statusStoreTooManySnapshot = plan.NewStatus(plan.StatusStoreThrottled, "store snapshot has been piled up, the related setting is 'max-snapshot-count'")
statusStoreTooManyPendingPeer = plan.NewStatus(plan.StatusStoreThrottled, "store has too many pending peers, the related setting is 'max-pending-peer-count'")
statusStoreAddLimit = plan.NewStatus(plan.StatusStoreThrottled, "store's add limit is exhausted, please check the setting of 'store limit'")
statusStoreRemoveLimit = plan.NewStatus(plan.StatusStoreThrottled, "store's remove limit is exhausted, please check the setting of 'store limit'")
statusStoreSnapRemoveLimit = plan.NewStatus(plan.StatusStoreThrottled, "store's snapshot remove limit is exhausted'")
statusStoreLabel = plan.NewStatus(plan.StatusLabelNotMatch)
statusStoreRule = plan.NewStatus(plan.StatusRuleNotMatch)
statusStorePauseLeader = plan.NewStatus(plan.StatusStoreBlocked, "the store is not allowed to transfer leader, there might be an evict-leader-scheduler")
statusStoreRejectLeader = plan.NewStatus(plan.StatusStoreBlocked, "the store is not allowed to transfer leader, please check 'label-property'")
statusStoreSlow = plan.NewStatus(plan.StatusStoreBlocked, "the store is slow and are evicting leaders, there might be an evict-slow-store-scheduler")
statusStoreScoreDisallowed = plan.NewStatus(plan.StatusStoreScoreDisallowed)
statusStoreAlreadyHasPeer = plan.NewStatus(plan.StatusStoreAlreadyHasPeer)

// store hard limitation
statusStoreDown = plan.NewStatus(plan.StatusStoreDown)
statusStoreRemoved = plan.NewStatus(plan.StatusStoreRemoved)
statusStoreDisconnected = plan.NewStatus(plan.StatusStoreDisconnected)
statusStoresRemoving = plan.NewStatus(plan.StatusStoreRemoving)
statusStoreLowSpace = plan.NewStatus(plan.StatusStoreLowSpace)
statusStoreBusy = plan.NewStatus(plan.StatusStoreBusy)

// store soft limitation
statusStoreSnapshotThrottled = plan.NewStatus(plan.StatusStoreSnapshotThrottled)
statusStorePendingPeerThrottled = plan.NewStatus(plan.StatusStorePendingPeerThrottled)
statusStoreAddLimit = plan.NewStatus(plan.StatusStoreAddLimitThrottled)
statusStoreRemoveLimit = plan.NewStatus(plan.StatusStoreRemoveLimitThrottled)
statusStoreSnapRemoveLimit = plan.NewStatus(plan.StatusStoreSendSnapShotLimitThrottled)
// store config limitation
statusStoreRejectLeader = plan.NewStatus(plan.StatusStoreRejectLeader)

statusStoreNotMatchRule = plan.NewStatus(plan.StatusStoreNotMatchRule)
statusStoreNotMatchIsolation = plan.NewStatus(plan.StatusStoreNotMatchIsolation)
// region filter status
statusRegionPendingPeer = plan.NewStatus(plan.StatusRegionUnhealthy)
statusRegionDownPeer = plan.NewStatus(plan.StatusRegionUnhealthy)
2 changes: 2 additions & 0 deletions server/schedule/plan/status.go
Original file line number Diff line number Diff line change
@@ -43,6 +43,8 @@ const (
StatusStoreAddLimitThrottled
// StatusStoreRemoveLimitThrottled represents the store cannot be selected due to the remove peer limitation.
StatusStoreRemoveLimitThrottled

StatusStoreSendSnapShotLimitThrottled
)

// config limitation
You are viewing a condensed version of this merge commit. You can view the full changes here.