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

SET GLOBAL tidb_skip_isolation_level_check=1 doesn't work as expected #27897

Closed
sunxiaoguang opened this issue Sep 8, 2021 · 10 comments · Fixed by #27898
Closed

SET GLOBAL tidb_skip_isolation_level_check=1 doesn't work as expected #27897

sunxiaoguang opened this issue Sep 8, 2021 · 10 comments · Fixed by #27898
Labels
affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. type/bug The issue is confirmed as a bug.

Comments

@sunxiaoguang
Copy link
Contributor

sunxiaoguang commented Sep 8, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> SET GLOBAL tidb_skip_isolation_level_check=1;
Query OK, 0 rows affected (0.02 sec)

Disconnect and reconnect to TiDB

mysql> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
ERROR 8048 (HY000): The isolation level 'SERIALIZABLE' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error

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

mysql> SET GLOBAL tidb_skip_isolation_level_check=1;
Query OK, 0 rows affected (0.03 sec)

Disconnect and reconnect to TiDB

mysql> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
Query OK, 0 rows affected, 1 warning (0.00 sec)

3. What did you see instead (Required)

mysql> SET GLOBAL tidb_skip_isolation_level_check=1;
Query OK, 0 rows affected (0.02 sec)

Disconnect and reconnect to TiDB

mysql> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
ERROR 8048 (HY000): The isolation level 'SERIALIZABLE' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error

4. What is your TiDB version? (Required)

5.1.0 and all the new versions

@sunxiaoguang sunxiaoguang added the type/bug The issue is confirmed as a bug. label Sep 8, 2021
@morgo
Copy link
Contributor

morgo commented Sep 8, 2021

I commented on the PR, but I'm not sure this is a bug. GLOBAL scoped changes are not supposed to apply to the current session yet. They only apply to new sessions.

@sunxiaoguang
Copy link
Contributor Author

I commented on the PR, but I'm not sure this is a bug. GLOBAL scoped changes are not supposed to apply to the current session yet. They only apply to new sessions.

Oops, you are right. I agree that global changes should not affect current session. However I saw something strange that there might be some other issue as well.

image

The first time I restart client to check global variables and change isolation level to SERIALIZABLE without having trouble. However the second time it stopped working again with tidb_skip_isolation_level_check=1 configured.

I will take another look to this.

@sunxiaoguang
Copy link
Contributor Author

sunxiaoguang commented Sep 9, 2021

I commented on the PR, but I'm not sure this is a bug. GLOBAL scoped changes are not supposed to apply to the current session yet. They only apply to new sessions.

After checking comments in PR, I realized that you already pointed out the root cause. My last experiment failed because I didn't read variable to force reload from global before changing isolation level. Simply remove skipInit from TiDBSkipIsolationLevelCheck definition works well. Thanks! @morgo

@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.

@sunxiaoguang
Copy link
Contributor Author

/label affects-5.1

@ti-chi-bot
Copy link
Member

@sunxiaoguang: The label(s) affects-5.1 cannot be applied. These labels are supported: CHANGELOG, challenge-program, compatibility-breaker, contribution, correctness, first-time-contributor, good-first-issue, hacktoberfest, high-performance, hptc, need-more-info, needs-cherry-pick-3.0, needs-cherry-pick-3.1, needs-cherry-pick-4.0, needs-cherry-pick-5.0, needs-cherry-pick-5.1, needs-cherry-pick-5.2, proposal, release-note, require-LGT3, security, tools.

In response to this:

/label affects-5.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@sunxiaoguang
Copy link
Contributor Author

/label affects-5.2

@ti-chi-bot
Copy link
Member

@sunxiaoguang: The label(s) affects-5.2 cannot be applied. These labels are supported: CHANGELOG, challenge-program, compatibility-breaker, contribution, correctness, first-time-contributor, good-first-issue, hacktoberfest, high-performance, hptc, need-more-info, needs-cherry-pick-3.0, needs-cherry-pick-3.1, needs-cherry-pick-4.0, needs-cherry-pick-5.0, needs-cherry-pick-5.1, needs-cherry-pick-5.2, proposal, release-note, require-LGT3, security, tools.

In response to this:

/label affects-5.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@sunxiaoguang
Copy link
Contributor Author

/label needs-cherry-pick-5.1

@sunxiaoguang
Copy link
Contributor Author

/label needs-cherry-pick-5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants