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

statistics: add AnalysisPriorityQueueV2 #56335

Merged
merged 10 commits into from
Sep 27, 2024

Conversation

Rustin170506
Copy link
Member

What problem does this PR solve?

Issue Number: ref #55906

Problem Summary:

What changed and how does it work?

This PR split from #55889.

In this PR:

  1. Introduced the basic structure for the new priority queue.
  2. Supported refreshing the last analysis duration of jobs.
  3. Added some basic heap API to the new priority queue.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/planner SIG: Planner labels Sep 26, 2024
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 63.87097% with 56 lines in your changes missing coverage. Please review.

Project coverage is 76.1639%. Comparing base (448d569) to head (097f657).
Report is 11 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #56335        +/-   ##
================================================
+ Coverage   73.3965%   76.1639%   +2.7673%     
================================================
  Files          1624       1644        +20     
  Lines        447375     455998      +8623     
================================================
+ Hits         328358     347306     +18948     
+ Misses        98875      87138     -11737     
- Partials      20142      21554      +1412     
Flag Coverage Δ
integration 51.9816% <0.0000%> (?)
unit 72.5229% <63.8709%> (+0.0159%) ⬆️

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

Components Coverage Δ
dumpling 52.9478% <ø> (ø)
parser ∅ <ø> (∅)
br 63.0368% <ø> (+17.5075%) ⬆️

@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 26, 2024
Copy link
Member Author

@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.

🔢 Self-check (PR reviewed by myself and ready for feedback.)

return nil
}

// TODO: Add the jobs to the priority queue.
Copy link
Member Author

Choose a reason for hiding this comment

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

Block by #56251

@Rustin170506
Copy link
Member Author

/retest

Copy link
Member Author

@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.

🔢 Self-check (PR reviewed by myself and ready for feedback.)

@Rustin170506
Copy link
Member Author

/retest

@winoros
Copy link
Member

winoros commented Sep 26, 2024

The main code changes LGTM.

const (
lastAnalysisDurationRefreshInterval = time.Minute * 10
)

Copy link
Contributor

@qw4990 qw4990 Sep 27, 2024

Choose a reason for hiding this comment

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

How about creating a new interface for AnalysisPriorityQueue instead of using *structure directly? This might help define the API more clear.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. I will do that in my following PR.

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 27, 2024
Copy link

ti-chi-bot bot commented Sep 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qw4990, winoros

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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 27, 2024
Copy link

ti-chi-bot bot commented Sep 27, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-27 07:18:26.886133173 +0000 UTC m=+1809576.626557104: ☑️ agreed by qw4990.
  • 2024-09-27 08:08:28.52311943 +0000 UTC m=+1812578.263543369: ☑️ agreed by winoros.

@Rustin170506
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit f7eba7e into pingcap:master Sep 27, 2024
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved component/statistics lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants