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

Logging related to SELECT... FOR UPDATE NOWAIT is too verbose #26842

Closed
dveeden opened this issue Aug 3, 2021 · 2 comments · Fixed by #26845
Closed

Logging related to SELECT... FOR UPDATE NOWAIT is too verbose #26842

dveeden opened this issue Aug 3, 2021 · 2 comments · Fixed by #26845
Labels
severity/minor sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.

Comments

@dveeden
Copy link
Contributor

dveeden commented Aug 3, 2021

Bug Report

1. Minimal reproduce step (Required)

T1:

CREATE TABLE t (id int primary key);
INSERT INTO t VALUES(1),(2),(3);
START TRANSACTION;
SELECT * FROM t FOR UPDATE NOWAIT;

T2:

START TRANSACTION;
SELECT * FROM t FOR UPDATE NOWAIT;

2. What did you expect to see? (Required)

The second transaction should fail with:

ERROR: 3572 (HY000): Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.

This is expected and should not result in much logging.

3. What did you see instead (Required)

ERROR: 3572 (HY000): Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.
[2021/08/03 10:04:28.124 +02:00] [WARN] [session.go:1653] ["run statement failed"] [conn=9] [schemaVersion=31] [error="[tikv:3572]Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set."] [session="{\n  \"currDBName\": \"test\",\n  \"id\": 9,\n  \"status\": 3,\n  \"strictMode\": true,\n  \"txn\": \"426764559465316355\",\n  \"user\": {\n    \"Username\": \"root\",\n    \"Hostname\": \"127.0.0.1\",\n    \"CurrentUser\": false,\n    \"AuthUsername\": \"root\",\n    \"AuthHostname\": \"%\"\n  }\n}"]
[2021/08/03 10:04:28.124 +02:00] [INFO] [conn.go:995] ["command dispatched failed"] [conn=9] [connInfo="id:9, addr:127.0.0.1:38182 status:11, collation:utf8mb4_0900_ai_ci, user:root"] [command=Query] [status="inTxn:1, autocommit:1"] [sql="select * from t FOR UPDATE NOWAIT"] [txn_mode=PESSIMISTIC] [err="[tikv:3572]Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set."]

4. What is your TiDB version? (Required)

5.7.25-TiDB-v5.2.0-alpha-455-gcb65b7a2f 127.0.0.1:4000  test  SQL  select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.2.0-alpha-455-gcb65b7a2f
Edition: Community
Git Commit Hash: cb65b7a2f752c0bc19c2d8587b1f9782b076b655
Git Branch: master
UTC Build Time: 2021-08-02 09:58:24
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.0011 sec)
@dveeden dveeden added the type/bug The issue is confirmed as a bug. label Aug 3, 2021
@dveeden
Copy link
Contributor Author

dveeden commented Aug 3, 2021

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'backport-x.y.z',
and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants