Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: tidb v6.1.0 tidb_gc_life_time问题
[TiDB Usage Environment] Production
[TiDB Version] v6.1.0
The new version’s GC setting time cannot exceed 24 hours.
There shouldn’t be. Did you write the format incorrectly?
I’ve also seen this. Modifications in the lower version 5.4.1 are fine, but in version 6.1.0, it doesn’t work. It works for 24h, but if adjusted to 25h, it doesn’t work. I really don’t know why.
Adjusting it to 48 hours still doesn’t work?
No, it won’t work as long as it exceeds 24 hours. Anything under 24 hours is fine.
The default value of the tidb_gc_life_time
parameter is 10m, which means that the data will be retained for 10 minutes before being garbage collected.
Tried 6.1.0, didn’t work.
6.3.0 works.
I guess the new version fixed it.
Try using this method.
UPDATE mysql.tidb SET VARIABLE_VALUE="48h" WHERE VARIABLE_NAME="tikv_gc_life_time";
It should be this issue. This version has a time check restriction, which was fixed in 6.1.1.
opened 02:31AM - 15 Jun 22 UTC
closed 10:18AM - 16 Jun 22 UTC
type/bug
sig/transaction
severity/moderate
affects-6.1
## Bug Report
Please answer these questions before submitting your issue. Tha… nks!
### 1. Minimal reproduce step (Required)
1. tiup playground v6.1.0
2. use mysql client to connect to tidb server
3. SET GLOBAL TIDB_GC_LIFE_TIME= '72h';
4. ERROR 1231 (42000): Variable 'tidb_gc_life_time' can't be set to the value of '72h0m0s'
### 2. What did you expect to see? (Required)
Query OK
### 3. What did you see instead (Required)
ERROR 1231 (42000): Variable 'tidb_gc_life_time' can't be set to the value of '72h0m0s'
### 4. What is your TiDB version? (Required)
```shell
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v6.1.0
Edition: Community
Git Commit Hash: 1a89decdb192cbdce6a7b0020d71128bc964d30f
Git Branch: heads/refs/tags/v6.1.0
UTC Build Time: 2022-06-05 05:09:33
GoVersion: go1.18.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
My 6.1.2 doesn’t have this issue
TiDB root@10.18.13.224:test> show variables like '%tidb_gc%'
+------------------------+--------+
| Variable_name | Value |
+------------------------+--------+
| tidb_gc_concurrency | -1 |
| tidb_gc_enable | ON |
| tidb_gc_life_time | 10m0s |
| tidb_gc_max_wait_time | 86400 |
| tidb_gc_run_interval | 10m0s |
| tidb_gc_scan_lock_mode | LEGACY |
+------------------------+--------+
6 rows in set
Time: 0.039s
TiDB root@10.18.13.224:test> set global tidb_gc_life_time='48h';
Query OK, 0 rows affected
Time: 0.082s
TiDB root@10.18.13.224:test> show variables like '%tidb_gc_life_time%'
+-------------------+---------+
| Variable_name | Value |
+-------------------+---------+
| tidb_gc_life_time | 48h0m0s |
+-------------------+---------+
1 row in set
Time: 0.023s
TiDB root@10.18.13.224:test>
The default value of 10 minutes feels a bit small, and it can be configured according to the specific query duration requirements. I have only set it to 24 hours; I haven’t set it for more than a day. – Adjust GC to retain data within the last day update mysql.tidb set VARIABLE_VALUE=“24h” where VARIABLE_NAME=“tikv_gc_life_time”;
I always change it like this: UPDATE mysql.tidb SET variable_value=‘25h’ WHERE variable_name=‘tikv_gc_life_time’; No problem.
Well, I’ll give this method a try.
This method is feasible, normal modification.
Is “show variables like ‘%tikv_gc_life_time%’;” effective as well?
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.