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

Refine the behavior of @@txn_scope value and Local Txn #25479

Closed
JmPotato opened this issue Jun 16, 2021 · 3 comments · Fixed by #25559
Closed

Refine the behavior of @@txn_scope value and Local Txn #25479

JmPotato opened this issue Jun 16, 2021 · 3 comments · Fixed by #25559
Assignees
Labels
type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@JmPotato
Copy link
Member

Feature Request

Now, if we configure the zone label for a TiDB instance, then the default value of @@txn_scope will be "local", which is not quite reasonable. Because:

  • User may only want to use the zone label to make sure the stale read could read the nearest data without enabling the Local TSO feature for the PD.
  • Labeling a TiDB instance with a zone label without configuring the PD to enable Local TSO will get a PD timeout error because @@txn_scope is "local" by default, which is confusing.

So I suggest setting the default value of @@txn_scope to "global".

@JmPotato JmPotato added the type/feature-request Categorizes issue or PR as related to a new feature. label Jun 16, 2021
@JmPotato JmPotato changed the title Set the default value of @@txn_scope to "global". Set the default value of @@txn_scope to "global" Jun 16, 2021
@JmPotato
Copy link
Member Author

/assign @JmPotato

@nolouch
Copy link
Member

nolouch commented Jun 16, 2021

@JmPotato I think the main reason is that @@txn_scope at the session level. It is unreasonable to set the @@txn_scope for each connection in the application if the local transaction is used, so we directly use local in default if exists label configuration in TiDB. At that time, only local transactions could be used with label configuration. I think maybe we need a global variable to control the default value of local/global transaction's txn scope. cc @Yisaer

@JmPotato JmPotato changed the title Set the default value of @@txn_scope to "global" Refine the behvior of @@txn_scope value and Local Txn Jun 22, 2021
@JmPotato JmPotato changed the title Refine the behvior of @@txn_scope value and Local Txn Refine the behavior of @@txn_scope value and Local Txn Jun 22, 2021
@tisonkun
Copy link
Contributor

Is this issue part of #21094?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants