-
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: schedule as many jobs as possible in one round, simplify sql to query jobs #54438
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 #54438 +/- ##
=================================================
- Coverage 74.7851% 56.3967% -18.3884%
=================================================
Files 1536 1666 +130
Lines 361822 614408 +252586
=================================================
+ Hits 270589 346506 +75917
- Misses 71592 244564 +172972
- Partials 19641 23338 +3697
Flags with carried forward coverage won't be shown. Click here to find out more.
|
pkg/ddl/ddl_worker_test.go
Outdated
@@ -75,7 +73,7 @@ func TestAddBatchJobError(t *testing.T) { | |||
} | |||
|
|||
func TestParallelDDL(t *testing.T) { | |||
store, dom := testkit.CreateMockStoreAndDomainWithSchemaLease(t, testLease) | |||
store, _ := testkit.CreateMockStoreAndDomainWithSchemaLease(t, testLease) |
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.
store, _ := testkit.CreateMockStoreAndDomainWithSchemaLease(t, testLease) | |
store := testkit.CreateMockStoreWithSchemaLease(t, testLease) |
pkg/ddl/job_table.go
Outdated
if wk == nil { | ||
// should not happen, we have checked available() before, and we are | ||
// the only routine consumes worker. | ||
logutil.DDLLogger().Info("no %v worker available now", zap.Stringer("type", targetPool.tp())) |
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.
no need to use %v
pkg/ddl/job_table.go
Outdated
failpoint.InjectCall("beforeRunJobWithWorker") | ||
// runOneJobStep runs one step of the DDL job. we are using online-schema-change, | ||
// one job might go through multiple steps, each step is one job state change such | ||
// as from 'done' -> 'synced, or one schema state change such as 'delete only' -> 'write only'. |
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.
// as from 'done' -> 'synced, or one schema state change such as 'delete only' -> 'write only'. | |
// as from 'done' -> 'synced', or one schema state change such as 'delete only' -> 'write only'. |
@@ -641,14 +633,6 @@ func (s *jobScheduler) runJobWithWorker(wk *worker, job *model.Job) error { | |||
return nil | |||
} | |||
|
|||
func (*jobScheduler) markJobProcessing(se *sess.Session, job *model.Job) error { |
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 involve another DDL dev to think about that we don't persist it.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hawkingrei, 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 |
/hold |
/unhold |
/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. |
What problem does this PR solve?
Issue Number: ref #54436
Problem Summary:
What changed and how does it work?
Check List
Tests
before this pr: create 100K tables under same database on owner on 1pd/3tidb/3tikv using 10 threads, run 2 time, takes 31m16/29m5. avg cpu about [335, 400]
after: run 3 times, takes 32m8/22m56/25m29, avg cpu about [200, 280]. the test result is not stable as expected, seems there are other components interfering DDL process, will check it later. but overall it it's better, both in time and resource usage
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.