-
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
ddl: part 1 of add-index integrating dxf dynamic modify param #59046
ddl: part 1 of add-index integrating dxf dynamic modify param #59046
Conversation
Hi @D3Hunter. 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #59046 +/- ##
================================================
+ Coverage 73.0574% 75.7585% +2.7010%
================================================
Files 1689 1743 +54
Lines 466990 485676 +18686
================================================
+ Hits 341171 367941 +26770
+ Misses 104844 95371 -9473
- Partials 20975 22364 +1389
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/retest |
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an 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-sigs/prow repository. |
/retest |
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an 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-sigs/prow repository. |
…te-dxf-dynamic-param
/retest |
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an 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-sigs/prow repository. |
…te-dxf-dynamic-param
…te-dxf-dynamic-param
…te-dxf-dynamic-param
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.
7 / 19 files viewed
@lance6716 ptal |
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
err = g.Wait() | ||
return err | ||
} | ||
|
||
// Note: we can achieve the same effect by calling ModifyTaskByID directly inside |
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.
I didn't review most of DXF codes so I'm not sure what's the meaning od this function comment. Just to check:
it says we only allow some functions to write to the system table of DXF, especially, we don't allow ADMIN ALTER DDL JOB to write because it's heavier to rollback on conflict?
Can you explain in this design, which functions are allowed to write the system table? I want to check if they still can conflict with each other.
zap.String("state", currTask.State.String())) | ||
continue | ||
} | ||
if err = taskManager.ModifyTaskByID(ctx, taskID, &proto.ModifyParam{ |
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.
when checking the implementation of ModifyTaskByID
I see the "old values" are not added to the UPDATE .. WHERE clause. So double check that it is expected for two concurrent call of ModifyTaskByID
, the final task arguments can be updated as any of the call?
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.
ModifyTaskByID will transit the task into modifying
state if it's in the prev state, so only 1 will success for concurrent calls
if err != nil { | ||
return 0, err | ||
} | ||
return min(workerCnt, cpuCount), 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.
Can you explain the reason why we limit the concurrency? If the work is not a pure compute workload, increase the concurrency to more that CPU count can make use of IO time.
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 abstract logic in here https://github.com/pingcap/tidb/pull/59046/files#diff-45ad039a8b87835b475a52615355c444538d3a1f31a84d7b3ac94e15b1ce8721L2550-L2554
valid range of tidb_ddl_reorg_worker_cnt
is [1, 256], but for a DXF task, valid range of task concurrency or slots is [1, cpuCount]
ping @lance6716 |
jobID, taskID int64, | ||
lastConcurrency, lastBatchSize, lastMaxWriteSpeed int, | ||
) { | ||
logger := logutil.DDLLogger().With(zap.Int64("jobId", jobID), zap.Int64("taskId", taskID)) |
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.
logger := logutil.DDLLogger().With(zap.Int64("jobId", jobID), zap.Int64("taskId", taskID)) | |
logger := logutil.DDLLogger().With(zap.Int64("jobID", jobID), zap.Int64("taskID", taskID)) |
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.
see #59343
taskManager storage.Manager, | ||
done chan struct{}, | ||
jobID, taskID int64, | ||
lastConcurrency, lastBatchSize, lastMaxWriteSpeed int, |
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.
Maybe use "old" / "new" to replace "last" / "latest"?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lance6716, tangenta 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 |
What problem does this PR solve?
Issue Number: ref #57497, ref #57229
Problem Summary:
What changed and how does it work?
This is the first part, will add integrate test later
executeDistTask
to detect whether there are param mismatch between DDL job and DXF task, and we callModifyTaskByID
to let DXF handle the rest param modify work if detectedskipWriteBinlog
errors.New
of golang to avoid stack overhead ofpingcap/errors
and replace error equal check withgoerrors.Is
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.