-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: support tidb_schema_cache_size reasonable range #54035
variable: support tidb_schema_cache_size reasonable range #54035
Conversation
Signed-off-by: lilinghai <lilinghai@pingcap.com>
Hi @lilinghai. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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 kubernetes-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #54035 +/- ##
=================================================
- Coverage 72.8706% 56.2965% -16.5742%
=================================================
Files 1521 1643 +122
Lines 435164 613659 +178495
=================================================
+ Hits 317107 345469 +28362
- Misses 98499 245061 +146562
- Partials 19558 23129 +3571
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: lilinghai <lilinghai@pingcap.com>
/retest |
@lilinghai: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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 kubernetes-sigs/prow repository. |
require.Equal(t, schemaCacheSize.Value, strconv.Itoa(DefTiDBSchemaCacheSize)) | ||
|
||
// MinValue is 512 MB | ||
err = mock.SetGlobalSysVar(context.Background(), TiDBSchemaCacheSize, strconv.FormatUint(100*mb, 10)) |
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.
Please test 512MB-1 and MaxValue + 1
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.
added
@@ -1595,7 +1596,8 @@ var ( | |||
IgnoreInlistPlanDigest = atomic.NewBool(DefTiDBIgnoreInlistPlanDigest) | |||
TxnEntrySizeLimit = atomic.NewUint64(DefTiDBTxnEntrySizeLimit) | |||
|
|||
SchemaCacheSize = atomic.NewInt64(DefTiDBSchemaCacheSize) | |||
SchemaCacheSize = atomic.NewUint64(DefTiDBSchemaCacheSize) | |||
SchemaCacheSizeOriginText = atomic.NewString(strconv.Itoa(DefTiDBSchemaCacheSize)) |
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.
We can get the text from SchemaCacheSize like we have done for TiDBServerMemoryLimitSessMinSize
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.
This value is used to store the content set by the user. For example, if the user sets 1GB, then the display for user queries will also be 1GB, not 1,073,741,824. However, the TiDBServerMemoryLimitSessMinSize
will display the value as an integer to the user.
mysql> set @@global.tidb_server_memory_limit_sess_min_size='1GB';
Query OK, 0 rows affected (0.01 sec)
mysql> select @@global.tidb_server_memory_limit_sess_min_size;
+-------------------------------------------------+
| @@global.tidb_server_memory_limit_sess_min_size |
+-------------------------------------------------+
| 1073741824 |
+-------------------------------------------------+
1 row in set (0.00 sec)
mysql> set @@global.tidb_schema_cache_size='1GB';
Query OK, 0 rows affected (0.00 sec)
mysql> select @@global.tidb_schema_cache_size;
+---------------------------------+
| @@global.tidb_schema_cache_size |
+---------------------------------+
| 1GB |
+---------------------------------+
1 row in set (0.00 sec)
simlar to tidb_server_memory_limit
mysql> set @@global.tidb_server_memory_limit='1GB';
Query OK, 0 rows affected (0.06 sec)
mysql> select @@global.tidb_server_memory_limit;
+-----------------------------------+
| @@global.tidb_server_memory_limit |
+-----------------------------------+
| 1GB |
+-----------------------------------+
1 row in set (0.00 sec)
Signed-off-by: lilinghai <lilinghai@pingcap.com>
/test unit-test |
@lilinghai: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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 kubernetes-sigs/prow repository. |
Signed-off-by: lilinghai <lilinghai@pingcap.com>
Signed-off-by: lilinghai <lilinghai@pingcap.com>
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.
rest lgtm
Signed-off-by: lilinghai <lilinghai@pingcap.com>
[LGTM Timeline notifier]Timeline:
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: easonn7, lance6716, wjhuang2016 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: close #54034
Problem Summary:
What changed and how does it work?
The value range is 0 and [536870912, 9223372036854775807] in bytes. The size format with the units "KB|MB|GB|TB" is supported.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.