-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Enhancement
TiDB advances gc safepoint every tidb_gc_run_interval time with step tidb_gc_life_time. If there is a long time transaction from user client lives more than tidb_gc_life_time, the safpoint can't be advanced until the long transaction is finished or lives than 24h. This mechanism ensures the continuous advancement of gc safepoint and ensures that the data that active transactions need to access will not be cleared.
However, Internal transactions run in TiDB don't comply with the mechanism above. If the internal transaction lives more than tidb_gc_life_time, maybe failed because the data it needs to access was cleared.
Here is an example that an auto analyze task run failed when it lived more than 20 minutes because the data was cleared. The TiDB log printed [tikv:9006]GC life time is shorter than transaction duration, transaction starts at 2021-11-17 14:09:54.756 +0800 CST, GC safe point is 2021-11-17 14:11:54.755 +0800 CST