How is the lock information data (locking, deleting locks) written in Lock cf cleaned up or expired?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 写入Lock cf中的锁信息数据(加锁、删锁)是怎么清理或过期的呢?

| username: xiaohetao

How is the lock information data (locking, deleting locks) written in the Lock cf cleaned up or expired?

| username: alfred | Original post link

It should be cleaned up by GC after the transaction ends.

| username: ddhe9527 | Original post link

When locking, there is a TTL (Time To Live). The TiDB instance that initiates the transaction will maintain this TTL to prevent it from expiring. If the transaction terminates abnormally, the TTL will expire because it is not maintained. During a snapshot read, if it is found that the lock’s TTL has expired, the transaction will be rolled back and the lock will be cleaned up. Additionally, during the GC (Garbage Collection) Resolve Locks phase, regions will be scanned to clean up expired locks.

| username: wuxiangdong | Original post link

It should be the TTL mechanism of RocksDB itself.

| username: xiaohetao | Original post link

Thank you :handshake::+1:

| username: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.