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

config: fix configs cannot set to zero values #1334

Merged
merged 4 commits into from
Nov 22, 2018
Merged

Conversation

disksing
Copy link
Contributor

@disksing disksing commented Nov 20, 2018

What problem does this PR solve?

Currently we use adjustXxx functions to set configurations to default values when they are zero values. It cannot distinguish between unset and the explicitly set to 0.

Fix #1323

It should be merged after pingcap/tidb-ansible#605

What is changed and how it works?

For configurations that zero values are valid, only adjust to the default values when they are unset.

Check List

Tests

  • Unit test

Code changes

  • Has configuration change

Side effects

  • Breaking backward compatibility: For configurations that zero values are valid, xxx = 0 will be adjust to default value before, after this PR it will be 0.

Related changes

  • Need to update the tidb-ansible repository
  • Need to be included in the release notes

Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
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.

LGTM

Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: disksing <i@disksing.com>
@disksing disksing removed the DNM label Nov 22, 2018
@disksing
Copy link
Contributor Author

/run-unit-test

@disksing disksing merged commit 13a50b0 into tikv:master Nov 22, 2018
@disksing disksing deleted the config branch November 22, 2018 09:43
Connor1996 pushed a commit to Connor1996/pd that referenced this pull request Dec 12, 2018
* config: fix configs cannot set to zero values

Signed-off-by: disksing <i@disksing.com>

* update default config to keep behaivour consistent

Signed-off-by: disksing <i@disksing.com>
Connor1996 pushed a commit to Connor1996/pd that referenced this pull request Dec 12, 2018
* config: fix configs cannot set to zero values

Signed-off-by: disksing <i@disksing.com>

* update default config to keep behaivour consistent

Signed-off-by: disksing <i@disksing.com>
disksing pushed a commit that referenced this pull request Dec 12, 2018
* config: fix configs cannot set to zero values

Signed-off-by: disksing <i@disksing.com>

* update default config to keep behaivour consistent

Signed-off-by: disksing <i@disksing.com>
@disksing disksing added the needs-cherry-pick-release-2.1 The PR needs to cherry pick to release-2.1 branch. label Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-2.1 The PR needs to cherry pick to release-2.1 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants