This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
pd: disable location replacement #555
Merged
ti-srebot
merged 23 commits into
pingcap:master
from
YuJuncen:disable-location-replacement
Oct 22, 2020
Merged
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
c188582
pd: disable location replacement
YuJuncen 7d3e70c
pd: fix
YuJuncen 500004b
pd: fix bool type to string
b7cf556
pd: fix restore-config after restore
142d7b1
testing: add some debug info
df23c4c
testing: add more debug info
298a945
testing: disable testing for config restore
f851159
testing: use kill instead of pkill
51760e5
Merge branch 'master' of https://github.com/pingcap/br into disable-l…
YuJuncen 97ec4a1
pd: fix name
YuJuncen 1ad142e
tests: fix test
ce5940f
tests: wait tiflash sync
7def25a
tests: add more time for waiting tiflash sync
6734867
tests: read from tikv
4e90fb8
Merge branch 'master' into disable-location-replacement
YuJuncen 9342ee0
*: remove mis-uploaded file
YuJuncen c80f73a
Update tests/br_other/run.sh
YuJuncen 48e1e49
tests: set a timeout for tiflash syncing
YuJuncen 41edf3e
tests: waiting for tiflash syncing by another way
YuJuncen 49080f8
Merge branch 'master' into disable-location-replacement
3pointer cd4dd7a
tests: fix tiflash testing
YuJuncen 73bc29a
Merge branch 'disable-location-replacement' of https://github.com/yuj…
YuJuncen 415745c
tests: back to use the origin waiting way
YuJuncen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -73,11 +73,12 @@ var ( | |||||||||||||||||||||||||
|
||||||||||||||||||||||||||
// DefaultPDCfg find by https://github.com/tikv/pd/blob/master/conf/config.toml. | ||||||||||||||||||||||||||
DefaultPDCfg = map[string]interface{}{ | ||||||||||||||||||||||||||
"max-merge-region-keys": 200000, | ||||||||||||||||||||||||||
"max-merge-region-size": 20, | ||||||||||||||||||||||||||
"leader-schedule-limit": 4, | ||||||||||||||||||||||||||
"region-schedule-limit": 2048, | ||||||||||||||||||||||||||
"max-snapshot-count": 3, | ||||||||||||||||||||||||||
"max-merge-region-keys": 200000, | ||||||||||||||||||||||||||
"max-merge-region-size": 20, | ||||||||||||||||||||||||||
"leader-schedule-limit": 4, | ||||||||||||||||||||||||||
"region-schedule-limit": 2048, | ||||||||||||||||||||||||||
"max-snapshot-count": 3, | ||||||||||||||||||||||||||
"enable-location-replacement": "true", | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
|
@@ -410,6 +411,7 @@ func (p *PdController) UpdatePDScheduleConfig( | |||||||||||||||||||||||||
if e == nil { | ||||||||||||||||||||||||||
return nil | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
log.Warn("failed to update PD config, will try next", zap.Error(e), zap.String("pd", addr)) | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
return errors.Annotate(berrors.ErrPDUpdateFailed, "failed to update PD schedule config") | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
@@ -444,6 +446,12 @@ func restoreSchedulers(ctx context.Context, pd *PdController, clusterCfg cluster | |||||||||||||||||||||||||
if err := pd.UpdatePDScheduleConfig(ctx, scheduleLimitCfg); err != nil { | ||||||||||||||||||||||||||
return errors.Annotate(err, "fail to update PD schedule config") | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
if locationPlacement, ok := clusterCfg.scheduleCfg["enable-location-replacement"]; ok { | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The map See here: Lines 511 to 522 in 6734867
|
||||||||||||||||||||||||||
log.Debug("restoring config enable-location-replacement", zap.Any("enable-location-placement", locationPlacement)) | ||||||||||||||||||||||||||
if err := pd.UpdatePDScheduleConfig(ctx, map[string]interface{}{"enable-location-replacement": locationPlacement}); err != nil { | ||||||||||||||||||||||||||
return err | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
return nil | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
|
@@ -485,6 +493,7 @@ func (p *PdController) RemoveSchedulers(ctx context.Context) (undo utils.UndoFun | |||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
undo = p.makeUndoFunctionByConfig(clusterConfig{scheduler: removedSchedulers, scheduleCfg: scheduleCfg}) | ||||||||||||||||||||||||||
log.Debug("saved PD config", zap.Any("config", scheduleCfg)) | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
disableMergeCfg := make(map[string]interface{}) | ||||||||||||||||||||||||||
for _, cfgKey := range pdRegionMergeCfg { | ||||||||||||||||||||||||||
|
@@ -515,7 +524,10 @@ func (p *PdController) RemoveSchedulers(ctx context.Context) (undo utils.UndoFun | |||||||||||||||||||||||||
limit := int(value.(float64)) | ||||||||||||||||||||||||||
scheduleLimitCfg[cfgKey] = math.Min(40, float64(limit*len(stores))) | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
return undo, p.UpdatePDScheduleConfig(ctx, scheduleLimitCfg) | ||||||||||||||||||||||||||
if err := p.UpdatePDScheduleConfig(ctx, scheduleLimitCfg); err != nil { | ||||||||||||||||||||||||||
return undo, err | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
return undo, p.UpdatePDScheduleConfig(ctx, map[string]interface{}{"enable-location-replacement": "false"}) | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
// Close close the connection to pd. | ||||||||||||||||||||||||||
|
This file was deleted.
Oops, something went wrong.
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
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
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.
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.
According to @Yisaer, these two configs "leader-schedule-limit" and "region-schedule-limit" don't help the schedule speed. should we remove it in this PR?
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.
I think we could leave a TODO here and try to merge this firstly... I'm afraid that if any error occurs during editing, we cannot merge this in the current unstable CI environment...
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.
currently
leader-schedule-limit
andregion-schedule-limit
is not supported in temporary configuration tikv/pd#3088