Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

pdutil: use temp pause config #592

Merged
merged 25 commits into from
Nov 16, 2020
Merged

Conversation

3pointer
Copy link
Collaborator

@3pointer 3pointer commented Nov 10, 2020

What problem does this PR solve?

After tikv/pd#3088 pd support set temporary config with ttlSecond. so BR can improve the behavior of pd config setting.

What is changed and how it works?

  1. refactor pdutil: merge all configs together
  2. add pauseConfig for 4.0.8.

Check List

Tests

  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has exported function/method change

Related changes

  • Need to cherry-pick to the release branch

Release Note

  • No release note.

Copy link
Member

@overvenus overvenus 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

pkg/pdutil/pd.go Outdated
if failure == nil {
break
}
}
if failure != nil {
return nil, errors.Annotatef(failure, "pd address (%s) not available, please check network", pdAddrs)
}
version, err := semver.NewVersion(string(versionBytes))
if err != nil {
return nil, errors.Annotatef(err, "transform pd version failed", string(versionBytes))
Copy link
Member

Choose a reason for hiding this comment

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

Could you choose an error in pkg/errors?

@3pointer 3pointer force-pushed the pd_temp_config branch 2 times, most recently from 8ac48a5 to 668a2c9 Compare November 10, 2020 09:39
@3pointer
Copy link
Collaborator Author

/rebuild

pkg/pdutil/pd.go Outdated Show resolved Hide resolved
@3pointer 3pointer marked this pull request as ready for review November 11, 2020 05:46
@3pointer
Copy link
Collaborator Author

/run-integration-test

pkg/pdutil/pd.go Outdated
expectPDCfg = map[string]interface{}{
"max-merge-region-keys": 0,
"max-merge-region-size": 0,
// TODO remove this schedule-limits, see https://github.com/pingcap/br/pull/555#discussion_r509855972
Copy link
Collaborator

Choose a reason for hiding this comment

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

as the rationale keeping the two -limits in #555 was

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...

do we still need to keep them here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are some misunderstanding.

  1. leader-schedule-limit and region-schedule-limit does need in previous and current version to reduce the schedule. I'll update the comment later.
  2. Before Persist temporary setting to etcd  tikv/pd#3131 leader-schedule-limit and region-schedule-limit doesn't support ttl second. I think we should wait PD merge 3131 then test.

I want to make sure this PR is compatible with the old BR version and easy to support set pd ttl config. I'll file another PR to update config when 3131 merged.

pkg/pdutil/pd.go Outdated Show resolved Hide resolved
pkg/pdutil/pd.go Outdated Show resolved Hide resolved
pkg/pdutil/pd.go Outdated Show resolved Hide resolved
pkg/pdutil/pd.go Outdated Show resolved Hide resolved
@3pointer
Copy link
Collaborator Author

/rebuild

@3pointer
Copy link
Collaborator Author

/rebuild

@3pointer
Copy link
Collaborator Author

/rebuild

1 similar comment
@3pointer
Copy link
Collaborator Author

/rebuild

Copy link
Collaborator

@kennytm kennytm 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 but that's a big rest.

pkg/pdutil/pd.go Outdated Show resolved Hide resolved
@kennytm kennytm removed the status/LGT1 LGTM1 label Nov 16, 2020
@kennytm kennytm added the status/LGT1 LGTM1 label Nov 16, 2020
@3pointer
Copy link
Collaborator Author

/rebuild

@3pointer
Copy link
Collaborator Author

/run-integration-test

3 similar comments
@3pointer
Copy link
Collaborator Author

/run-integration-test

@3pointer
Copy link
Collaborator Author

/run-integration-test

@glorv
Copy link
Collaborator

glorv commented Nov 16, 2020

/run-integration-test

@3pointer
Copy link
Collaborator Author

/rebuild

@3pointer
Copy link
Collaborator Author

/run-integration-test

@glorv
Copy link
Collaborator

glorv commented Nov 16, 2020

LGTM

@ti-srebot ti-srebot removed the status/LGT1 LGTM1 label Nov 16, 2020
@ti-srebot ti-srebot added the status/LGT2 LGTM2 label Nov 16, 2020
@3pointer 3pointer merged commit e3faf51 into pingcap:master Nov 16, 2020
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #596

3pointer added a commit that referenced this pull request Nov 25, 2020
* pdutil: use temp pause config

* refactor pdutil

* fix ci

* add pd version fail back

* fix ci

* fix ci

* fix unmarshal bool

* address comment

* fi

* add test case

* Apply suggestions from code review

Co-authored-by: kennytm <kennytm@gmail.com>

* address comment

* fix ci

* update comment

* update comment

* Update pkg/pdutil/pd.go

Co-authored-by: kennytm <kennytm@gmail.com>

* address comment

* change convoluted logic

* resume config by set ttlSecond to 0

* test pause config

* fix failpoint

* update test

* fix test

Co-authored-by: luancheng <luancheng@pingcap.com>
Co-authored-by: kennytm <kennytm@gmail.com>
@3pointer 3pointer mentioned this pull request Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants