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

unexpected warning when inserting, schemaLeaseChecker is not set for this transaction #22783

Open
wjhuang2016 opened this issue Feb 18, 2021 · 3 comments
Assignees
Labels
severity/minor sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.

Comments

@wjhuang2016
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t(a bigint PRIMARY KEY auto_random);

cat 1.sql
INSERT INTO t VALUES ();

mysqlslap --query=1.sql -uroot -h127.0.0.1 -P4000 -c 100 --number-of-queries=10000000 --create-schema=test --commit=1

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

No warning in tidb log.

3. What did you see instead (Required)

[2021/02/18 14:29:30.746 +08:00] [WARN] [2pc.go:1505] ["schemaLeaseChecker is not set for this transaction"] [conn=675] [sessionID=675] [startTS=423003362622177286] [commitTS=423003362622439424]

4. What is your TiDB version? (Required)

master

@wjhuang2016 wjhuang2016 added type/bug The issue is confirmed as a bug. sig/transaction SIG:Transaction labels Feb 18, 2021
@wjhuang2016
Copy link
Member Author

Introduced by #22371

@cfzjywxk
Copy link
Contributor

After the #22371 change, for innner transactions using RunInNewTxn function calls, the context from upper scope will be inherited and reused. The connection id will not be zero initializing the two phase committers, and the warn log is printted as the schema lease checker is not set yet.
Maybe we should keep it consistent for the RunInNewTxn interface and ExecRestrictedSQL, the storing of connection id need some refactor.

@cfzjywxk
Copy link
Contributor

Besides, we need to more clearly define the unexpected path fetching the schema lease checker during commit, return error and prevent such transactions from committing successfully.

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.

6 participants