-
Notifications
You must be signed in to change notification settings - Fork 6k
disttask: add local disk space to node resource managed by DXF #59607
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
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 #59607 +/- ##
================================================
+ Coverage 73.0112% 74.6811% +1.6698%
================================================
Files 1694 1742 +48
Lines 468361 479073 +10712
================================================
+ Hits 341956 357777 +15821
+ Misses 105382 98726 -6656
- Partials 21023 22570 +1547
Flags with carried forward coverage won't be shown. Click here to find out more.
|
} | ||
|
||
// GetTaskDiskResource gets available disk for a task. | ||
func (nr *NodeResource) GetTaskDiskResource(concurrency int, quotaHint uint64) uint64 { |
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.
is quotaHint
used to allocate less resource for some task? why do we need it if we cannot allow some task to alloc more resource?
and it should be part of StepResource
, no need a special 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.
StepResource
is only used by the step executor. We need to know the resource in the scheduler before splitting subtasks.
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.
is quotaHint used to allocate less resource for some task?
Yes.
why do we need it if we cannot allow some task to alloc more resource?
Because other factors may affect the resource allocation, for example, @@tidb_ddl_disk_quota
can change dynamically.
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 resource per slot for a subtask is always <= the mount of disk per slot
= D
, seems ok to just use D
, no need to adjust
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't determine which one is larger, tidb_ddl_disk_quota
or actual disk capacity. For example, a user has a 2TB node, but only wants to use 500GB for DXF, then the user can set tidb_ddl_disk_quota
to 500GB
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.
no need to consider tidb_ddl_disk_quota
, we can always use the total_disk
we got by inspecting disk stat.
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
nodeRes := proto.NewNodeResource(16, 32*units.GiB) | ||
exeMgr, err := taskexecutor.NewManager(c.Ctx, id, c.TaskMgr, nodeRes) |
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.
in TestDXFContext
, the cpu count is a input param that's passed to github.com/pingcap/tidb/pkg/util/cpu/mockNumCpu",
, the new node need also conform to this
see newTestDXFContext
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CbcWestwolf, D3Hunter 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 |
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
Issue Number: ref #49008
Problem Summary:
We didn't consider disk space for each subtask when implementing DXF. In the following enhancement, we may utilize the local storage for global sort, it requires managing the disk usage resource.
What changed and how does it work?
NodeResource
.NodeResource
from packagetaskexecutor
toproto
.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.