-
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: support referring objects in runningJobs #54110
Conversation
Signed-off-by: lance6716 <[email protected]>
Hi @lance6716. 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 #54110 +/- ##
=================================================
- Coverage 72.8518% 56.0921% -16.7597%
=================================================
Files 1516 1639 +123
Lines 434806 607452 +172646
=================================================
+ Hits 316764 340733 +23969
- Misses 98460 243420 +144960
- Partials 19582 23299 +3717
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
/retest |
@lance6716: 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. |
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
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.
9/14
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.
11/14
@@ -235,6 +240,7 @@ func (s *jobScheduler) getJob(se *sess.Session, tp jobType) (*model.Job, error) | |||
"[ddl] handle ddl job failed: mark job is processing meet error", | |||
zap.Error(err), | |||
zap.Stringer("job", &job)) | |||
s.runningJobs.addPending(involving) |
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.
we can remove this markJobProcessing
completely later, memory check is enough, i will record a task item
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.
Need more reviewers to careful think about that, if it's essential to persist the result of which job is chosen as running.
@@ -184,7 +184,10 @@ func (s *jobScheduler) close() { | |||
} | |||
} | |||
|
|||
// getJob reads tidb_ddl_job and returns the first runnable DDL job. | |||
func (s *jobScheduler) getJob(se *sess.Session, tp jobType) (*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.
we need merge 2 loadDDLJobAndRun
into 1 to hand a 'fair' case below:
- job 1: add column to test.t
- job 2: truncate test.t: skipped scan since job 1 is running
- job 3: add index to test.t: before we check it, job 1 finished, so it can be run, but it should be run after job 2
since it's already a large pr, i add a task item to track and we can change it later, and can do it together with remove the sub-query inside getJobSQL to speedup.
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
/retest |
@lance6716: 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 |
@lance6716: 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. |
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.
11/13
Signed-off-by: lance6716 <[email protected]>
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
Signed-off-by: lance6716 <[email protected]>
ping @tangenta |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, 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: close #52795, ref #53246
Problem Summary:
What changed and how does it work?
a DDL job will modify and refer to multiple objects (database, table, placement policy, resource group). Treat it like the job will lock these objects, in exclusive or shared lock mode. If the job finished all locking, then it can run now. In other words, the job has no dependency on other running jobs. This PR implements this lock-like behaviour.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.