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

planner, workload-based learning: The setup process framework of workload-based learning #58132

Merged
merged 11 commits into from
Dec 16, 2024

Conversation

elsa0520
Copy link
Contributor

@elsa0520 elsa0520 commented Dec 10, 2024

What problem does this PR solve?

Issue Number: ref #58131

Problem Summary:

What changed and how does it work?

The setup process framework of workload-based learning.
When tidb setup, the workload-based learnng worker such as read tablecost worker will setup at the same time.
It will start a new go routine to execute workers periodically. All workload-based learning related workers will be started in this function SetupWorkloadBasedLearningWorker"

Two new configurations (TODO set value)

  1. EnableWorkloadBasedLearning: Control whether enable all workload-based analyze workers. Default is false before this feature is ready
  2. WorkloadBasedLearningInterval: Control the time interval between each round of analysis task. Default is 1 days.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    Now, we can only disable it before the feature is not ready. So I manual test the setup worker.
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 10, 2024
Copy link

tiprow bot commented Dec 10, 2024

Hi @elsa0520. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

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.

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 10, 2024
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 86.79245% with 7 lines in your changes missing coverage. Please review.

Project coverage is 75.2435%. Comparing base (68ac9ec) to head (82ea518).
Report is 71 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #58132        +/-   ##
================================================
+ Coverage   73.1841%   75.2435%   +2.0594%     
================================================
  Files          1675       1724        +49     
  Lines        461917     474491     +12574     
================================================
+ Hits         338050     357024     +18974     
+ Misses       103127      95262      -7865     
- Partials      20740      22205      +1465     
Flag Coverage Δ
integration 49.2410% <56.6037%> (?)
unit 72.6734% <86.7924%> (+0.3586%) ⬆️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 61.9710% <ø> (+16.0102%) ⬆️

@ghazalfamilyusa
Copy link
Contributor

ghazalfamilyusa commented Dec 10, 2024

Two points:

  • Do you actually mean that this PR close the corresponding 58131 issue?
  • Need unit test for the initial functionality.

pkg/domain/domain.go Outdated Show resolved Hide resolved
pkg/domain/domain.go Show resolved Hide resolved
}

func (do *Domain) readTableCostWorker(wbLearningHandle *workloadbasedlearning.Handle) {
defer util.Recover(metrics.LabelDomain, "readTableCostWorker", nil, false)
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DONE

Copy link
Member

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

Thanks! :shipit:

Some nits.


package workloadbasedlearning

/*
Copy link
Member

Choose a reason for hiding this comment

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

In Go, we rarely use /* */ comments. See more at https://go.dev/doc/comment to check the package comment style.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 11, 2024
@elsa0520
Copy link
Contributor Author

Two points:

  • Do you actually mean that this PR close the corresponding 58131 issue?
  • Need unit test for the initial functionality.
  1. No, I changed the comment to ref 58131
  2. I will add unit test in the future pr link. Only test the tidb setup is a little bit difficult in unit test

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 12, 2024
Copy link

ti-chi-bot bot commented Dec 12, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-10 23:29:11.977138879 +0000 UTC m=+394742.065941417: ✖️🔁 reset by ghazalfamilyusa.
  • 2024-12-11 09:06:36.422704571 +0000 UTC m=+429386.511507310: ☑️ agreed by Rustin170506.
  • 2024-12-12 03:28:09.165968061 +0000 UTC m=+495479.254770604: ☑️ agreed by ghazalfamilyusa.

Copy link

ti-chi-bot bot commented Dec 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benmeadowcroft, ghazalfamilyusa, qw4990, Rustin170506, wjhuang2016

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Dec 12, 2024
@elsa0520
Copy link
Contributor Author

/test unit-test

Copy link

tiprow bot commented Dec 13, 2024

@elsa0520: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

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.

@qw4990
Copy link
Contributor

qw4990 commented Dec 13, 2024

/retest

Copy link

tiprow bot commented Dec 13, 2024

@qw4990: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@elsa0520
Copy link
Contributor Author

/test pull-br-integration-test

Copy link

tiprow bot commented Dec 15, 2024

@elsa0520: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test pull-br-integration-test

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.

@ti-chi-bot ti-chi-bot bot merged commit 59dff48 into pingcap:master Dec 16, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants