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: concurrency init stats #51403

Merged
merged 7 commits into from
Mar 28, 2024

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Feb 28, 2024

What problem does this PR solve?

Issue Number: close #52102

Problem Summary:

What changed and how does it work?

Now we init stats by single goroutine. it is slow. so that we create concurrency init stats to speed up.

Check List

Tests

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

before

[2024/03/26 08:08:59.917 +00:00] [INFO] [domain.go:2286] ["init stats info time"] [lite=true] ["take time"=797.217483ms]
[2024/03/26 08:42:35.866 +00:00] [INFO] [domain.go:2286] ["init stats info time"] [lite=false] ["take time"=1m17.384163872s]

after

[2024/03/26 08:25:43.158 +00:00] [INFO] [domain.go:2292] ["init stats info time"] [lite=true] ["take time"=646.48434ms]
[2024/03/26 08:39:04.435 +00:00] [INFO] [domain.go:2292] ["init stats info time"] [lite=false] ["take time"=28.20059188s]
  • 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 do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked 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 Feb 28, 2024
Copy link

codecov bot commented Feb 29, 2024

Codecov Report

Merging #51403 (00099f1) into master (1549ea6) will decrease coverage by 15.9190%.
Report is 16 commits behind head on master.
The diff coverage is 88.3116%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #51403         +/-   ##
=================================================
- Coverage   70.7412%   54.8222%   -15.9190%     
=================================================
  Files          1486       1602        +116     
  Lines        439485     611505     +172020     
=================================================
+ Hits         310897     335241      +24344     
- Misses       109161     253067     +143906     
- Partials      19427      23197       +3770     
Flag Coverage Δ
integration 36.7260% <50.6493%> (?)
unit 70.5249% <88.3116%> (-0.0336%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 51.6685% <ø> (+5.8260%) ⬆️

@hawkingrei hawkingrei force-pushed the page_lite_init_stats branch 2 times, most recently from 108e52b to 6dcf0f8 Compare March 13, 2024 15:57
@hawkingrei hawkingrei force-pushed the page_lite_init_stats branch from 6dcf0f8 to f0f18aa Compare March 25, 2024 03:10
@hawkingrei
Copy link
Member Author

/retest

@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 Mar 25, 2024
@hawkingrei hawkingrei force-pushed the page_lite_init_stats branch from ae6d76e to 84f07f2 Compare March 25, 2024 10:41
@hawkingrei hawkingrei changed the title statistics: paging load stats statistics: concurrency init stats Mar 26, 2024
@hawkingrei hawkingrei force-pushed the page_lite_init_stats branch from 65d4441 to 160ab06 Compare March 26, 2024 07:17
@hawkingrei
Copy link
Member Author

/retest

1 similar comment
@hawkingrei
Copy link
Member Author

/retest

@hawkingrei hawkingrei force-pushed the page_lite_init_stats branch from 160ab06 to f7c441b Compare March 26, 2024 10:16
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
@hawkingrei hawkingrei force-pushed the page_lite_init_stats branch from f7c441b to d2a8c22 Compare March 27, 2024 00:40
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
@hawkingrei
Copy link
Member Author

/retest

Signed-off-by: Weizhen Wang <[email protected]>
@hawkingrei hawkingrei requested a review from AilinKid March 27, 2024 07:01
@hawkingrei hawkingrei requested a review from elsa0520 March 27, 2024 07:01
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 27, 2024
Copy link

ti-chi-bot bot commented Mar 27, 2024

@AilinKid: Your lgtm message is repeated, so it is ignored.

In 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/test-infra repository.

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.

/cc

pkg/config/config.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot requested a review from Rustin170506 March 27, 2024 07:36
Signed-off-by: Weizhen Wang <[email protected]>
@hawkingrei hawkingrei requested a review from winoros March 27, 2024 09:15
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 27, 2024
Copy link

ti-chi-bot bot commented Mar 27, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-27 07:03:43.192465871 +0000 UTC m=+2051450.214712258: ☑️ agreed by AilinKid.
  • 2024-03-27 09:58:21.883643253 +0000 UTC m=+2061928.905889641: ☑️ agreed by winoros.

@easonn7
Copy link

easonn7 commented Mar 28, 2024

/approve

@ti-chi-bot ti-chi-bot bot added the approved label Mar 28, 2024
@hawkingrei
Copy link
Member Author

/retest

// Worker is used to load stats concurrently.
type Worker struct {
taskFunc func(ctx context.Context, req *chunk.Chunk) error
dealFunc func(is infoschema.InfoSchema, cache statstypes.StatsCache, iter *chunk.Iterator4Chunk)
Copy link
Member

Choose a reason for hiding this comment

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

How about creating a type alias to avoid copying this signature repeatedly?

Copy link

ti-chi-bot bot commented Mar 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AilinKid, easonn7, hi-rustin, 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 merged commit ce2cf92 into pingcap:master Mar 28, 2024
23 checks passed
@hawkingrei
Copy link
Member Author

/cherrypick release-7.5

@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-7.5: #52261.

In response to this:

/cherrypick release-7.5

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 ti-community-infra/tichi repository.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Mar 31, 2024
@hawkingrei hawkingrei deleted the page_lite_init_stats branch March 31, 2024 14:01
ti-chi-bot bot pushed a commit that referenced this pull request Apr 1, 2024
hawkingrei pushed a commit to hawkingrei/tidb that referenced this pull request Apr 1, 2024
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.

Optimize Initialization of Statistics for 10k+ Tables via Concurrent Loading
7 participants