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

varaible: fix the new session can't see the instance-level variable store-limit #26649

Merged
merged 10 commits into from
Aug 2, 2021

Conversation

AilinKid
Copy link
Contributor

@AilinKid AilinKid commented Jul 27, 2021

Signed-off-by: ailinkid 314806019@qq.com

What problem does this PR solve?

Issue Number: close #26648

What is changed and how it works?

What's Changed: Thanks to Morgan's new framework of variable, the instance variable is more elegant to implement

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
1: start a cluster with 3 tidb nodes
2: set the instance storelimit in node1, node1 can see it while node2 & node3 can't see it
3: set the global storelimit in node1, all the nodes can see it.

Release note

varaible: fix the new session can't see the instance-level variable store-limit

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 27, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • morgo
  • tangenta

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 27, 2021
@AilinKid AilinKid requested review from wshwsh12 and morgo July 27, 2021 09:03
Comment on lines +205 to +211
case variable.TiDBStoreLimit:
var val int64
val, err = strconv.ParseInt(sVal, 10, 64)
if err != nil {
break
}
storekv.StoreLimit.Store(val)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This switch for if you change a global var, and you want to run code on other TiDB servers. I just wanted to confirm this is the case here?

(I had thought we would not need to add items to this switch, but that's turned out to be wrong. We may need to change SetGlobal() so that it fires on all TiDB servers).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we need this. the case is that:

statement Node1 instance Node2 instance
set global yes(apply local instance) yes(propagated to instance2)
set session yes(apply local instance) no

I investigate for a while, maybe this code is actually what I want.

Signed-off-by: ailinkid <314806019@qq.com>
@AilinKid
Copy link
Contributor Author

manual test:

1: start a cluster with 3 tidb nodes
2: set the instance storelimit in node1, node1 can see it while node2 & node3 can't see it
3: set the global storelimit in node1, all the nodes can see it.

@AilinKid
Copy link
Contributor Author

/run-all-tests

@morgo morgo self-requested a review July 30, 2021 02:48
Copy link
Contributor

@morgo morgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 30, 2021
AilinKid and others added 3 commits August 2, 2021 16:37
Co-authored-by: tangenta <tangenta@126.com>
Co-authored-by: tangenta <tangenta@126.com>
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 2, 2021
Co-authored-by: tangenta <tangenta@126.com>
@AilinKid
Copy link
Contributor Author

AilinKid commented Aug 2, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 4ccb061

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 2, 2021
@ti-chi-bot
Copy link
Member

@AilinKid: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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.

@ti-chi-bot ti-chi-bot merged commit 0bcf830 into pingcap:master Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/execution SIG execution sig/sql-infra SIG: SQL Infra size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new session can't see instance-level variable store-limit
5 participants