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

*: always convert sysvar values when out of range #25686

Merged
merged 7 commits into from
Oct 13, 2021

Conversation

morgo
Copy link
Contributor

@morgo morgo commented Jun 23, 2021

What problem does this PR solve?

Issue Number: close #25397

Problem Summary:

In MySQL sysvars that are of the correct type but out of range return a warning and not an error.

Previously TiDB returned an error unless AutoConvertOutOfRange = true. Now AutoConvertOutOfRange = true is permanently set, and the field has become meaningless and removed.

The error that TiDB returned was also not helpful (incorrect argument type).

What is changed and how it works?

What's Changed:

When setting a system variable, TiDB now attempts to convert out of range values to the closest approximate value. For example, a value of 501 might be adjusted to the maximum value of 500. This behavior is more compatible with how MySQL accepts system variable values.

Related changes

  • None (not suitable for cherry pick)

Check List

Tests

  • Unit test

Side effects

  • Behavior change (but less strict, so unlikely to cause compatibility issues).

Release note

  • When setting a system variable, TiDB now attempts to convert out of range values to the closest approximate value. For example, a value of 501 might be adjusted to the maximum value of 500. This behavior is more compatible with how MySQL accepts system variable values.

@morgo morgo requested a review from a team as a code owner June 23, 2021 01:26
@morgo morgo requested review from wshwsh12 and removed request for a team June 23, 2021 01:26
@ti-chi-bot ti-chi-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 23, 2021
@morgo morgo added the sig/sql-infra SIG: SQL Infra label Jun 23, 2021
@github-actions github-actions bot added the sig/execution SIG execution label Jun 23, 2021
@morgo morgo requested a review from a team as a code owner June 23, 2021 01:55
@morgo morgo requested review from winoros and removed request for a team June 23, 2021 01:55
@wshwsh12 wshwsh12 removed their request for review June 24, 2021 02:41
@morgo morgo requested review from a team and removed request for winoros July 5, 2021 21:02
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 16, 2021
Copy link
Contributor

@xhebox xhebox 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 should we consider this PR a compatibility breaker? Not every variable is autoconvert=true before, right?

@morgo
Copy link
Contributor Author

morgo commented Jul 18, 2021

Rest LGTM
But should we consider this PR a compatibility breaker? Not every variable is autoconvert=true before, right?

I actually don't think it is compatibility breaking since it changes the server to be less strict (versus more strict; which usually is an issue). But it is easy to ague either way.

@morgo morgo force-pushed the fix-sysvar-autovalue branch from 52fc485 to 73114d9 Compare July 19, 2021 00:05
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 19, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 19, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • dveeden
  • xhebox

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 19, 2021
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 9, 2021
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 6, 2021
@morgo morgo requested review from mjonss and dveeden October 6, 2021 18:15
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 12, 2021
@morgo morgo requested a review from a team October 12, 2021 06:08
@bb7133
Copy link
Member

bb7133 commented Oct 12, 2021

/merge

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 12, 2021
@ti-chi-bot
Copy link
Member

@morgo: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@morgo
Copy link
Contributor Author

morgo commented Oct 12, 2021

/merge cancel

Needs approval first or it will block other merges

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Oct 12, 2021
@morgo
Copy link
Contributor Author

morgo commented Oct 12, 2021

/run-check_dev_2

@bb7133 bb7133 added the compatibility-breaker Violation of forwards/backwards compatibility in a design-time piece. label Oct 13, 2021
@bb7133
Copy link
Member

bb7133 commented Oct 13, 2021

It doesn't 'break' the compatibility but may lead to some changed behaviors(though the chance is little). I tagged 'compatibility breaker' so that it will be noticed.

@bb7133
Copy link
Member

bb7133 commented Oct 13, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: e600b6c

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 13, 2021
@ti-chi-bot ti-chi-bot merged commit e6c600a into pingcap:master Oct 13, 2021
@morgo morgo deleted the fix-sysvar-autovalue branch October 13, 2021 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility-breaker Violation of forwards/backwards compatibility in a design-time piece. sig/execution SIG execution sig/sql-infra SIG: SQL Infra size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Always convert out of range numeric sysvars to upper/lower bounds
5 participants