-
Notifications
You must be signed in to change notification settings - Fork 6k
ddl: get scatter variable from executor session context #61331
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
Conversation
Hi @River2000i. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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 kubernetes-sigs/prow repository. |
Hi @River2000i. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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 kubernetes-sigs/prow repository. |
Please make sure to add testcases to check that the system variable can be set and gets the correct value。 |
func getScatterScopeFromSessionctx(sctx sessionctx.Context) string { | ||
var scatterScope string | ||
val, ok := sctx.GetSessionVars().GetSystemVar(vardef.TiDBScatterRegion) | ||
if !ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What situation will cause !ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I think there should not output Warn("get system variable met problem, won't scatter region"), Just one info, the system var did not be set, use the default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix in dc069d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we use global setting if not set in session level?
// FullMode is a flag identify it should be run in full mode. | ||
// In full mode, the test will run all the cases. | ||
var FullMode = flag.Bool("full-mode", false, "whether tests run in full mode") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// FullMode is a flag identify it should be run in full mode. | |
// In full mode, the test will run all the cases. | |
var FullMode = flag.Bool("full-mode", false, "whether tests run in full mode") |
No usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #61331 +/- ##
================================================
+ Coverage 73.1772% 74.8800% +1.7027%
================================================
Files 1726 1748 +22
Lines 478575 491660 +13085
================================================
+ Hits 350208 368155 +17947
+ Misses 106896 100497 -6399
- Partials 21471 23008 +1537
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: tangenta <[email protected]>
/retest |
What if user set global variable,but not set session level,then get session level variable will get global level value, right? |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest lgtm
pkg/ddl/executor.go
Outdated
var scatterScope string | ||
if val, ok := jobW.GetSessionVars(vardef.TiDBScatterRegion); ok { | ||
scatterScope = val | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only need get once
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Benjamin2037, D3Hunter The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/unhold |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
…context (pingcap#61331)"" because it has multiple dependent commits. This reverts commit 885f1ef.
What problem does this PR solve?
Issue Number: close #61321
Problem Summary: truncate table\truncate partition\add partition use incorrect session context
What changed and how does it work?
get
tidb_scatter_region
from executor session contextCheck List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.