-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
variable: set max duration of gc interval/lifetime to 365 days #25396
Conversation
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.
5.7.25-TiDB-v5.2.0-alpha-14-g75388187f 127.0.0.1:4000 SQL set global tidb_gc_life_time='9m';
ERROR: 1232 (42000): Incorrect argument type to variable 'tidb_gc_life_time'
Not that this should be part of this PR, but this error is both unhelpful and wrong.
- The type is not wrong, the value is.
- Would be nice to have it report the range.
Just and idea:
5.7.25-TiDB-v5.2.0-alpha-14-g75388187f 127.0.0.1:4000 SQL set global tidb_gc_life_time='9m';
ERROR: 1232 (42000): Out of range value for variable 'tidb_gc_life_time'. Allowed range: 10m0s - 1y
This is easy to fix: tidb/sessionctx/variable/sysvar.go Lines 344 to 349 in a45b3aa
I don't think it will break many tests to fix this case, but the functions that validate integer values also return 'wrong type'. Fixing these might break a fair amount of tests. |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: f1fd49d
|
@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. |
What problem does this PR solve?
Problem Summary:
In pingcap/docs#5752 I am working through a PR to document min/max, scope etc of system variables by generating it from the TiDB server source. This has revealed that the max values for gc interval/lifetime are quite large (292 years).
It is a very minor issue, but in this PR I propose we change it to 365 days. It is inspired by similar "time based" values in MySQL such as https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lock_wait_timeout (1 year). The rationale for the change is that Golang doesn't print 292 years in a user-friendly way.
What is changed and how it works?
What's Changed:
The maximum duration for gc interval/lifetime changes from 292 years to 365 days. This is not expected to cause issues for users, since the typical range is specified in minutes to hours.
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note