-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
rc: add resource group name to ddl #46756
Conversation
/test ? |
@wuhuizuo: The following commands are available to trigger required jobs:
The following commands are available to trigger optional jobs:
Use
In response to this:
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/test-infra repository. |
@wuhuizuo: The following commands are available to trigger required jobs:
Use In response to this:
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/test-infra repository. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #46756 +/- ##
================================================
- Coverage 73.3573% 73.2564% -0.1009%
================================================
Files 1324 1349 +25
Lines 396657 406569 +9912
================================================
+ Hits 290977 297838 +6861
- Misses 87119 90266 +3147
+ Partials 18561 18465 -96
Flags with carried forward coverage won't be shown. Click here to find out more.
|
ddl/ddl_worker.go
Outdated
if tagger := w.getResourceGroupTaggerForTopSQL(job.ID); tagger != nil { | ||
txn.SetOption(kv.ResourceGroupTagger, tagger) | ||
} | ||
if job.ReorgMeta != nil { |
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.
Could we remove this logical? It seems we do it in the funcion of
jobContext
on the line767(https://github.com/pingcap/tidb/pull/46756/files#diff-a185df836b8926c4afe351d4def1b56d1e282c65aabe6677c2fa2c54590cc4b2R477)
/ok-to-test |
ddl/backfilling.go
Outdated
@@ -684,7 +684,7 @@ func (dc *ddlCtx) writePhysicalTableRecord(sessPool *sess.Pool, t table.Physical | |||
} | |||
}) | |||
|
|||
jc := dc.jobContext(job.ID) | |||
jc := dc.jobContext(job.ID, job.ReorgMeta) |
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.
Why not use reorgInfo.NewJobContext()
instead of this? In addition, how to determine whether to use 'reorgInfo.NewJobContext()' or 'dc.jobContext(job.ID, job.ReorgMeta)'
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.
reorgInfo
is a concept at the higher level of DDL job, in this function, we can only get DDL job. If we can get reorgInfo
, we prefer to call NewJobContext
first, because this function does not need to pass additional parameters. Otherwise, call jobContext()
.
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.
But this function has the argument of reorgInfo *reorgInfo
, so why not just use 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.
fixed in 390b696
/retest |
ddl/ddl_api.go
Outdated
Warnings: make(map[errors.ErrorID]*terror.Error), | ||
WarningsCount: make(map[errors.ErrorID]int64), | ||
Location: &model.TimeZoneLocation{Name: tzName, Offset: tzOffset}, | ||
ResourceGroupName: ctx.GetSessionVars().ResourceGroupName, |
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.
Do we need to add it to MultiSchemaChange
's ReorgMeta
?
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.
Besides, could we add a NewReorgMeta
to unify the assignment? This helps reduce the possibility of missing parameter assignments later on
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.
Besides, could we add a NewReorgMeta to unify the assignment? This helps reduce the possibility of missing parameter assignments later on
lgtm
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 all in d3ad2bf
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.
LGTM
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.
LGTM
} else { | ||
ctx = NewJobContext() | ||
} | ||
if reorgMeta != nil && len(ctx.resourceGroupName) == 0 { |
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.
if reorgMeta != nil && len(ctx.resourceGroupName) == 0 { | |
if reorgMeta != nil { |
No need to check ctx's resource-group, it may be the default value default
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.
Is default
necessary? If it is, we need add a lock for it. Otherwise, it will occur data race.
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.
Is there any case that depend on the ctx.resourceGroupName here? otherwise, should always override with reorgMeta's
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: glorv, zimulala 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 |
/retest |
What problem does this PR solve?
Issue Number: ref #46656
Problem Summary:
What is changed and how it works?
as title
Check List
Tests
add index
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.