-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
It seems that the lock acquired with GET_LOCK is being released after 1 hour. #58625
Comments
https://docs.pingcap.com/tidb/stable/locking-functions#mysql-compatibility yes it's 3600 seconds |
@lance6716 That is the waiting time to acquire the lock, and the correct behavior should be that the acquired lock is not released until the session ends, right? |
I'm not sure what's the behaviour of |
@lance6716 How about this? The following is a method to verify using the MySQL client. step 1Preparation [console 1]
[console 2]
[console 3]
step 2The session in Console 2 acquires the lock. [console 3]
[console 2]
[console 3]
※The connection ID is different from what was expected (it is supposed to be the connection ID of the session in Console 2). step 3(Execute 61 minutes after step 2)The session in Console 2 still holds the lock, but it cannot be verified from the session in Console 3, and the lock can be acquired there.
[console 3]
|
/cc @morgo PTAL |
/cc @bb7133 |
The implemementation of GET_LOCK is to use a transaction underneath, so it will be limited to 1hr by default. I agree that there are actually two separate issues:
I checked the pessimistic transactions page to make sure it is documented there too. It is (see point #7). |
@morgo I see. While deployments occur daily under normal circumstances, the system may run continuously during long holidays or similar periods. So, migration options would include: Setting max-txn-ttl to 25,920,000 (30 days) |
Yes that's right. Someone from PingCAP may have comments on what the performance downsides you need to consider of a long |
1. Minimal reproduce step (Required)
The timeout specified for GET_LOCK is the waiting time to acquire the lock, and there is no timeout for the acquired lock itself, is there?
step 1. [console 1]
step 2. [console 2]
get_lock_test.rb
2. What did you expect to see? (Required)
[console 2]
3. What did you see instead (Required)
The acquired lock is not released based on time.
[console 2]
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: