disttask: collect metering data to subtask's real time summary#63431
Conversation
Signed-off-by: tangenta <tangenta@126.com>
|
Hi @tangenta. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions 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. |
| tools/bin/mockgen -package mock github.com/pingcap/tidb/pkg/lightning/backend Backend,EngineWriter,TargetInfoGetter > br/pkg/mock/backend.go | ||
| tools/bin/mockgen -package mock github.com/pingcap/tidb/pkg/lightning/common ChunkFlushStatus > br/pkg/mock/common.go |
There was a problem hiding this comment.
ChunkFlushStatus is moved from package backend to common to avoid package circular dependency between external and backend.
This PR adds the dependency backend --(depends on)-> external because I added OnReaderClose to the external engine configuration, which is used to collect reading related information.
| github.com/stretchr/testify v1.10.0 | ||
| github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2 | ||
| github.com/tikv/client-go/v2 v2.0.8-0.20250828075934-b794d681774f | ||
| github.com/tikv/client-go/v2 v2.0.8-0.20250905073636-469a7adf7ae8 |
There was a problem hiding this comment.
Update client-go for bug-fix tikv/client-go#1752
Signed-off-by: tangenta <tangenta@126.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #63431 +/- ##
================================================
+ Coverage 72.7588% 74.8373% +2.0784%
================================================
Files 1835 1886 +51
Lines 496690 512660 +15970
================================================
+ Hits 361386 383661 +22275
+ Misses 113324 105409 -7915
- Partials 21980 23590 +1610
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
|
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn 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. |
Signed-off-by: tangenta <tangenta@126.com>
| if err != nil { | ||
| return "", "", "", err | ||
| } | ||
| w.putReqCnt++ |
There was a problem hiding this comment.
Does the write count equals to "S3 put request count", since we use a buffered writer.
Lines 1232 to 1237 in d022959
There was a problem hiding this comment.
and we are using multi part upload, does this counted as 1 PUT, or each part is one PUT?
|
/hold |
Signed-off-by: tangenta <tangenta@126.com>
Signed-off-by: tangenta <tangenta@126.com>
Signed-off-by: tangenta <tangenta@126.com>
Signed-off-by: tangenta <tangenta@126.com>
Signed-off-by: tangenta <tangenta@126.com>
Signed-off-by: tangenta <tangenta@126.com>
Signed-off-by: tangenta <tangenta@126.com>
|
/retest |
|
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn 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. |
| if option != nil { | ||
| onFlush = option.OnUpload | ||
| if onFlush != nil { | ||
| onFlush() // Initiate: PUT |
There was a problem hiding this comment.
can you also paste the link to how AWS cal API count of the multi part upload in the comment?
There was a problem hiding this comment.
check whether we are using multi-part-upload?
There was a problem hiding this comment.
check whether we are using multi-part-upload?
Do you mean the case option.Concurrency <= 1? Both of the ways use s3.CreateMultipartUploadInput.
There was a problem hiding this comment.
Do we really need to care about these 2 requests? If so, what if we meet an error and don't call complete?
| m.mu.Unlock() | ||
| } | ||
| onReaderClose := func(summary *external.ReaderSummary) { | ||
| m.summary.GetReqCnt.Add(summary.GetRequestCount) |
There was a problem hiding this comment.
what about PUT req count?
There was a problem hiding this comment.
Updated. Let me add an integration test for the merge-sort step.
Signed-off-by: tangenta <tangenta@126.com>
| return errors.Trace(err) | ||
| return totalKVBytes, errors.Trace(err) | ||
| } | ||
| totalKVBytes += len(key) + len(idxVal) |
There was a problem hiding this comment.
external writer will calculate the written file size, can we directly use that?
tidb/pkg/lightning/backend/external/writer.go
Line 529 in 9b964af
There was a problem hiding this comment.
This size is only updated when the writer is flushed or closed. But we collect them during the write.
Let me change to this way in the next PR?
There was a problem hiding this comment.
please also add some tests for import into
Signed-off-by: tangenta <tangenta@126.com>
Signed-off-by: tangenta <tangenta@126.com>
Signed-off-by: tangenta <tangenta@126.com>
cfzjywxk
left a comment
There was a problem hiding this comment.
For the client-go update
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bb7133, cfzjywxk, D3Hunter, joechenrh, Leavrth The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: tangenta <tangenta@126.com>
|
/hold |
Signed-off-by: tangenta <tangenta@126.com>
Signed-off-by: tangenta <tangenta@126.com>
|
The test is insufficient. |
|
/retest |
|
@tangenta: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn 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 |
|
@tangenta: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn 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. |
What problem does this PR solve?
Issue Number: ref #61702
Problem Summary:
What changed and how does it work?
Since DXF subtasks are executed by system keyspace TiDB instances that scaled out automatically, we need to meter the resource usage for billing. This PR collects four metrics for adding index using DXF :
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.