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

dead loop in acquire pessimistic lock when secondary keys exceed TTL #14063

Closed
sticnarf opened this issue Dec 16, 2019 · 0 comments · Fixed by #14066
Closed

dead loop in acquire pessimistic lock when secondary keys exceed TTL #14063

sticnarf opened this issue Dec 16, 2019 · 0 comments · Fixed by #14066
Labels
type/bug The issue is confirmed as a bug.

Comments

@sticnarf
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
MySQL [test]> desc t;
+-------+---------+------+------+---------+-------+
| Field | Type    | Null | Key  | Default | Extra |
+-------+---------+------+------+---------+-------+
| id    | int(11) | NO   | PRI  | NULL    |       |
| v     | int(11) | YES  |      | NULL    |       |
+-------+---------+------+------+---------+-------+
2 rows in set (0.000 sec)
Client 1 Client 2
BEGIN
SELECT * FROM t WHERE id = 1 FOR UPDATE
SELECT * FROM t WHERE id = 2 FOR UPDATE
wait 20s
BEGIN
SELECT * FROM t WHERE id = 2 FOR UPDATE NOWAIT
  1. What did you expect to see?
ERROR 3572 (HY000): Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.
  1. What did you see instead?

Client 2 blocks. TiDB and TiKV CPU usage increase greatly.

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
+---------------------------------------------+
| Release Version: v4.0.0-alpha-1162-g3ee6bc8a2-dirty
Git Commit Hash: 3ee6bc8a2130cae75393ac4177e3769b002be7a4
Git Branch: master
UTC Build Time: 2019-12-15 01:52:54
GoVersion: go1.13.5
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant