-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: init capacity and check concurrency using cpu count of managed node #49875
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. |
for _, node := range newNodes { | ||
nodeIDs = append(nodeIDs, node.ID) | ||
if node.CPUCount > 0 { | ||
cpuCount = node.CPUCount | ||
} | ||
} |
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 cpuCount will be set equal to the last node, is it expected?
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 assume them isomorphic, first/last makes no difference
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.
can add a comment~
taskMgr, err := storage.GetTaskManager() | ||
if err != nil { | ||
return err | ||
} | ||
return taskMgr.StartManagerSession(ctx, e.Ctx(), serverID, valStr) |
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 the sysvar is not set, the node won't be used for disttask.
Is it exepected?
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.
why? i just replace it from explicit sql to task_table api
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.
Okay, I missunderstood the code
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #49875 +/- ##
================================================
- Coverage 72.0575% 71.1462% -0.9114%
================================================
Files 1437 1433 -4
Lines 345628 417141 +71513
================================================
+ Hits 249051 296780 +47729
- Misses 76506 101578 +25072
+ Partials 20071 18783 -1288
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -37,6 +39,16 @@ func TestMain(m *testing.M) { | |||
goleak.VerifyTestMain(m, opts...) | |||
} | |||
|
|||
func GetCPUCountOfManagedNodes(ctx context.Context, taskMgr *TaskManager) (int, 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.
move to util?
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.
let's do it when it's needed
taskMgr, err := storage.GetTaskManager() | ||
if err != nil { | ||
return err | ||
} | ||
return taskMgr.StartManagerSession(ctx, e.Ctx(), serverID, valStr) |
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.
Okay, I missunderstood the code
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
// TODO: we assume that all nodes managed by dist framework are isomorphic, | ||
// but dist owner might run on normal node where the capacity might not be | ||
// able to run any task. |
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.
Add some comments of isomorphic
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.
see comments in slotManager
rs, err := ExecSQL(ctx, se, ` | ||
select host, role, cpu_count | ||
from mysql.dist_framework_meta | ||
where role = 'background' or role = '' |
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 removing this?
/approve |
/hold ci fail |
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
ci fail issue, will fix it later, #49950 |
/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/test-infra 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.
LGTM for now, but @Benjamin2037 please consider the version rollback design.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bb7133, D3Hunter, okJiang, yudongusa, 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 |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: ref #49008
Problem Summary:
What changed and how does it work?
Check List
Tests
create new and upgrade cluster, make sure new schema works
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.