-
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
dxf: handle modifying task concurrency in scheduler #57673
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 #57673 +/- ##
================================================
+ Coverage 72.8318% 73.2910% +0.4592%
================================================
Files 1677 1679 +2
Lines 463944 475826 +11882
================================================
+ Hits 337899 348738 +10839
- Misses 105169 106306 +1137
+ Partials 20876 20782 -94
Flags with carried forward coverage won't be shown. Click here to find out 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.
will review unit test files later
PausedTask(ctx context.Context, taskID int64) error | ||
// ResumedTask updated task state from resuming to running. | ||
ResumedTask(ctx context.Context, taskID int64) error | ||
// ModifiedTask tries to update task concurrency and meta, and update state |
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 reading it I'm not clear about
- Seems configurations other than concurrency, meta and state can't be modified? When we want to support more modification like
Priority
, we will update this comment? - What's the
prev_state
? Now by checking the code I see it's a field ofModifyParam
. I think it's better to mention how we can use fields of the parametertask *proto.Task
to modify. - What's the meaning of "update state back to prev-state" Back meaning there's a checking that
prev-state
must be a state that happened in history?
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.
state
is not a param, it's for changing state back to the state before modify, see this state machine https://github.com/pingcap/tidb/pull/57557/files#diff-9cbb4aa7310f95ed10a52e14e392efa29e0356b179e85efec38db8fde5dca9f3R57-R67. for priority, yes
for 2/3. see above link
// subtask might have different concurrency later, see TaskExecInfo, we | ||
// need to handle it too, but ok for now. | ||
_, err = sqlexec.ExecSQL(ctx, se.GetSQLExecutor(), ` | ||
update mysql.tidb_background_subtask |
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 learning, how do we let subtask executor know the concurrency is changed?
}) | ||
}) | ||
|
||
t.Run("modify pending task concurrency, but other owner already done it", func(t *testing.T) { |
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.
The test purpose is "..but other owner already done it". Should we trigger ModifiedTask after WaitTaskDone and check the concurrency is not changed?
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.
Should we trigger ModifiedTask after WaitTaskDone
the scenario is
- task change to
modifying
state - owner A tried to do modify work, but before it start, another owner B finished the modify
- owner A does nothing
check the concurrency is not changed?
on owner A, we check by AffectedRows() == 0
[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 |
@D3Hunter: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: ref #57497
Problem Summary:
What changed and how does it work?
handle modify task concurrency in scheduler
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.