-
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: consider paused job when check runnable #54419
Conversation
Hi @tangenta. 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 #54419 +/- ##
=================================================
- Coverage 72.8839% 56.3686% -16.5153%
=================================================
Files 1533 1657 +124
Lines 436132 614397 +178265
=================================================
+ Hits 317870 346327 +28457
- Misses 98667 244560 +145893
- Partials 19595 23510 +3915
Flags with carried forward coverage won't be shown. Click here to find out more.
|
pkg/ddl/job_table.go
Outdated
failpoint.InjectCall("afterDelivery2Worker", job) | ||
s.runningJobs.removeRunning(jobID, involvedSchemaInfos) | ||
moveRunningJobsToPending := r != nil || (job != nil && job.IsPaused()) |
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.
how about when delivery2Worker
exits, if the job is not in finished states (which means job is paused, worker panicked, and other unexpected conditions), we move it to pending.
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.
if not panic/owner change, pause is the only state if we exit here actually, see job.InFinalState()
branch
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.
just in case we will have more states in future (for example, somehow we revert to the old way to handle job, to let this function only forward one schema state). I think checking "not finished" is more correct.
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
more correct
you mean 'more robust'?
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.
yes, more robust.
pkg/ddl/ddl_running_jobs.go
Outdated
@@ -233,11 +233,23 @@ func (j *runningJobs) addRunning(jobID int64, involves []model.InvolvingSchemaIn | |||
} | |||
} | |||
|
|||
func (j *runningJobs) removeRunningOrPending(jobID int64, involves []model.InvolvingSchemaInfo, moveToPending bool) { |
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 FinishOrPendJob
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.
/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. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, 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 |
/retest |
@tangenta: 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. |
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #54383, ref #53246
Problem Summary:
As the table shown above, we run
add column
when the previous jobmodify column
is not finished. This is unexpected because they reference the same table.What changed and how does it work?
This PR moves the unfinished jobs to pending jobs after
delivery2Worker()
complete, in order to preventgetJob()
obtaining new jobs that affect the same table.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.