-
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
disttask: fix failed step is taken as success #49971
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/test-infra repository. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #49971 +/- ##
================================================
- Coverage 71.9101% 68.7876% -3.1226%
================================================
Files 1437 1439 +2
Lines 345691 407989 +62298
================================================
+ Hits 248587 280646 +32059
- Misses 76894 108352 +31458
+ Partials 20210 18991 -1219
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -52,6 +53,8 @@ func TestHandle(t *testing.T) { | |||
mgr := storage.NewTaskManager(pool) | |||
storage.SetTaskManager(mgr) | |||
|
|||
testutil.WaitNodeRegistered(t, ctx) |
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.
also in planner_test
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
@@ -0,0 +1,40 @@ | |||
// Copyright 2023 PingCAP, Inc. |
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.
// Copyright 2023 PingCAP, Inc. | |
// Copyright 2024 PingCAP, Inc. |
@@ -59,7 +59,7 @@ type TaskManager interface { | |||
// we only consider pending/running subtasks, subtasks related to revert are | |||
// not considered. | |||
GetUsedSlotsOnNodes(ctx context.Context) (map[string]int, error) | |||
GetSubtaskInStatesCnt(ctx context.Context, taskID int64, states ...proto.SubtaskState) (int64, error) | |||
GetSubtaskCntByStates(ctx context.Context, taskID int64, step proto.Step) (map[proto.SubtaskState]int64, 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.
GetSubtaskCntByStates(ctx context.Context, taskID int64, step proto.Step) (map[proto.SubtaskState]int64, error) | |
GetSubtaskCntByStep(ctx context.Context, taskID int64, step proto.Step) (map[proto.SubtaskState]int64, 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.
the ByStates
means group by state. will change to OfStates to avoid conflict with normal , will leave it, ByStates/OfStates/InStates makes no differenceByXXX
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.
Indeed exist confusion
conflict with normal ByXXX
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.
GetSubtaskCntGroupByStates?
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.
@@ -240,12 +240,13 @@ func (s *BaseScheduler) onCancelling() error { | |||
// handle task in pausing state, cancel all running subtasks. | |||
func (s *BaseScheduler) onPausing() error { | |||
logutil.Logger(s.logCtx).Info("on pausing state", zap.Stringer("state", s.Task.State), zap.Int64("step", int64(s.Task.Step))) | |||
cnt, err := s.taskMgr.GetSubtaskInStatesCnt(s.ctx, s.Task.ID, proto.SubtaskStateRunning, proto.SubtaskStatePending) | |||
cntByStates, err := s.taskMgr.GetSubtaskCntByStates(s.ctx, s.Task.ID, s.Task.Step) |
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.
cntByStates, err := s.taskMgr.GetSubtaskCntByStates(s.ctx, s.Task.ID, s.Task.Step) | |
state2Cnt, err := s.taskMgr.GetSubtaskCntByStep(s.ctx, s.Task.ID, s.Task.Step) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: okJiang, tangenta, ywqzzy 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 |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
This reverts commit c6b9828.
What problem does this PR solve?
Issue Number: close #49950
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.