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

tidb_store_limit INSTANCE scope is broken #30515

Closed
morgo opened this issue Dec 8, 2021 · 2 comments · Fixed by #30522
Closed

tidb_store_limit INSTANCE scope is broken #30515

morgo opened this issue Dec 8, 2021 · 2 comments · Fixed by #30522
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@morgo
Copy link
Contributor

morgo commented Dec 8, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Deploy a cluster which uses tikv and PD (mocktikv without PD won't work).

SET tidb_store_limit = 5; SELECT @@tidb_store_limit; SELECT SLEEP(31); SELECT @@tidb_store_limit;

2. What did you expect to see? (Required)

The value of tidb_store_limit should persist.

3. What did you see instead (Required)

It gets overwritten by the global value every 30 seconds because of the sysvar cache refreshing. This is because there is currently no good way to do both instance scope and global scope in the server.

tidb> SET tidb_store_limit = 5; SELECT @@tidb_store_limit; SELECT SLEEP(31); SELECT @@tidb_store_limit;
Query OK, 0 rows affected (0.00 sec)

+--------------------+
| @@tidb_store_limit |
+--------------------+
| 5                  |
+--------------------+
1 row in set (0.00 sec)

+-----------+
| SLEEP(31) |
+-----------+
|         0 |
+-----------+
1 row in set (31.00 sec)

+--------------------+
| @@tidb_store_limit |
+--------------------+
| 0                  |
+--------------------+
1 row in set (0.00 sec)

Because it is broken I suggest we remove the INSTANCE (session) scope. If all sysvars are either GLOBAL or INSTANCE, then we can implement an easier design for proper INSTANCE scope.

4. What is your TiDB version? (Required)

master

@morgo morgo added the type/bug The issue is confirmed as a bug. label Dec 8, 2021
@morgo
Copy link
Contributor Author

morgo commented Dec 8, 2021

Introduced in #26649 (although previously was likely broken as well)

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants