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

Simplify scheduler codes #62

Merged
merged 24 commits into from
Feb 20, 2020

Conversation

YangKeao
Copy link
Collaborator

  • remove persistent config
  • remove label and related score
  • remove leveldb_kv
  • remove extra filters:
    • snapshotcount
    • pending peer count
    • storage
  • simplify balance region score calculation

And fix related tests.

Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
@YangKeao YangKeao mentioned this pull request Feb 17, 2020
8 tasks

// GenRangeCluster gets a range cluster by specifying start key and end key.
// The cluster can only know the regions within [startKey, endKey].
func GenRangeCluster(cluster opt.Cluster, startKey, endKey []byte) *RangeCluster {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove RangeCluster totally?

// balanceLeaderRetryLimit is the limit to retry schedule for selected source store and target store.
const balanceLeaderRetryLimit = 10

type balanceLeaderScheduler struct {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please keep balanceLeaderScheduler though it's not included in the course outline.

@@ -556,76 +536,17 @@ func (s *Server) SetReplicationConfig(cfg config.ReplicationConfig) error {
func (s *Server) SetPDServerConfig(cfg config.PDServerConfig) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove these API too, we don't need to change configs dynamically.

func (s *Server) GetLabelProperty() config.LabelPropertyConfig {
return s.scheduleOpt.LoadLabelPropertyConfig().Clone()
}

// SetClusterVersion sets the version of cluster.
func (s *Server) SetClusterVersion(v string) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please clean all things related with cluster version

Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Copy link
Collaborator

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM

@@ -1143,34 +1068,6 @@ func (s *testClusterInfoSuite) TestRegionHeartbeat(c *C) {
}
}

func heartbeatRegions(c *C, cluster *RaftCluster, regions []*core.RegionInfo) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this?

@@ -90,42 +88,3 @@ func (s *testClusterWorkerSuite) TestValidRequestRegion(c *C) {
c.Assert(cluster.validRequestRegion(r5), IsNil)
cluster.stop()
}

func (s *testClusterWorkerSuite) TestAskSplit(c *C) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please keep it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! forget to restore it.

Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
@@ -419,6 +419,8 @@ func (c *Config) configFromFile(path string) (*toml.MetaData, error) {

// ScheduleConfig is the schedule configuration.
type ScheduleConfig struct {
// SplitMergeInterval is the minimum interval time to permit merge after split.
SplitMergeInterval typeutil.Duration `toml:"split-merge-interval,omitempty" json:"split-merge-interval"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be deleted

Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Copy link
Collaborator

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Connor1996 Connor1996 merged commit 3744254 into talent-plan:master Feb 20, 2020
Connor1996 pushed a commit that referenced this pull request Apr 30, 2020
* remove persistent config

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove label property

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove label & location related score

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove unused codes

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove leveldb_kv

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove snapshotcount filter and peer count filter

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove unused code

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove unused cache

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* change Schedule function signature

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* simplify balance region source calc

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove unused code

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove dynamic config setting

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove push driver

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove range_cluster

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove cluster_version

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove unused function and variable

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove unused config

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* format

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove unused functions

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* restore some tests

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* format

Signed-off-by: Yang Keao <keao.yang@yahoo.com>

* remove SplitMergeInterval

Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants