Skip to content
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

dm: add TCP connection IO traffic statistics to sync stage status in OpenAPI response #11742

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

River2000i
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #11741

What is changed and how it works?

  1. add filed in dm/proto/dmworker.proto and regenerate by make generate-protobuf
  2. update openapi define and regenerate by make dm_generate_openapi
  3. init IO counter and uuid for the task created by openapi

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

Please refer to [Release Notes Language Style Guide](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.

If you don't think this PR needs a release note then fill it with `None`.

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. area/dm Issues or PRs related to DM. area/engine Issues or PRs related to Dataflow Engine. labels Nov 13, 2024
Copy link
Contributor

ti-chi-bot bot commented Nov 13, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign gmhdbjd for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added contribution This PR is from a community contributor. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Nov 13, 2024
Copy link
Contributor

ti-chi-bot bot commented Nov 13, 2024

Hi @River2000i. Thanks for your PR.

I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@ti-chi-bot ti-chi-bot bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 13, 2024
@River2000i River2000i changed the title dm: add IO traffic statistics to sync stage status in OpenAPI response dm: add TCP connection IO traffic statistics to sync stage status in OpenAPI response Nov 13, 2024
@@ -182,13 +182,13 @@ type SubTaskConfig struct {
// one go runtime.
// IOTotalBytes is used build TCPConnWithIOCounter and UUID is used to as a
// key to let MySQL driver to find the right TCPConnWithIOCounter.
UUID string `toml:"-" json:"-"`
IOTotalBytes *atomic.Uint64 `toml:"-" json:"-"`
UUID string `toml:"uuid" json:"uuid"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember toml is used for passing task content, and json is used for logging. We don't need to log them?

Also please add unit tests to ensure atomic types has implemented these marshall functions without race

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember toml is used for passing task content, and json is used for logging. We don't need to log them?

Indeed, we don't need to add json tag for both uuid. json tag used for log and openapi response

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please add unit tests to ensure atomic types has implemented these marshall functions without race

nice catch! The atomic.Uint64 values can't be properly serialized to TOML format. How about we manually copy atomic value like:b094cb4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since atomic.Uint64 is not support marshall functions for toml like https://github.com/pingcap/tiflow/blob/master/dm/master/scheduler/worker.go#L282

we need to avoid (nil pointer)/(zero value) after covert subtaskconfig to toml... @lance6716 Any suggestion for that?🤔

@lance6716
Copy link
Contributor

/ok-to-test

@ti-chi-bot ti-chi-bot bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Nov 14, 2024
@River2000i
Copy link
Contributor Author

/retest

@River2000i
Copy link
Contributor Author

/retest-required

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 72.41379% with 8 lines in your changes missing coverage. Please review.

Project coverage is 55.1634%. Comparing base (68c22f3) to head (98a610a).

Additional details and impacted files
Components Coverage Δ
cdc 59.5888% <ø> (∅)
dm 50.0471% <72.4137%> (∅)
engine 53.2618% <ø> (+0.0395%) ⬆️
Flag Coverage Δ
unit 55.1634% <72.4137%> (+1.9410%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@@               Coverage Diff                @@
##             master     #11742        +/-   ##
================================================
+ Coverage   53.2223%   55.1634%   +1.9410%     
================================================
  Files           213       1002       +789     
  Lines         17720     137428    +119708     
================================================
+ Hits           9431      75810     +66379     
- Misses         7686      56069     +48383     
- Partials        603       5549      +4946     

Copy link
Contributor

ti-chi-bot bot commented Nov 14, 2024

@River2000i: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-engine-integration-test 98a610a link true /test engine-integration-test
pull-cdc-integration-pulsar-test 98a610a link true /test cdc-integration-pulsar-test

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/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dm Issues or PRs related to DM. area/engine Issues or PRs related to Dataflow Engine. contribution This PR is from a community contributor. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dm: add TCP connect IO traffic statistics at sync stage status in OpenAPI response
2 participants