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: shard needsStatsMap #52183

Merged
merged 8 commits into from
Mar 28, 2024

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Mar 28, 2024

What problem does this PR solve?

Issue Number: ref #51853

Problem Summary:

What changed and how does it work?

there is a global lock, and although there are plenty of write/read paths, by sharding, I can increase the granularity of the locks.

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

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-tests-checked size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked labels Mar 28, 2024
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Merging #52183 (2a701d4) into master (ce2cf92) will increase coverage by 3.4127%.
Report is 4 commits behind head on master.
The diff coverage is 81.0810%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52183        +/-   ##
================================================
+ Coverage   69.2555%   72.6682%   +3.4127%     
================================================
  Files          1490       1490                
  Lines        420134     440202     +20068     
================================================
+ Hits         290966     319887     +28921     
+ Misses       109658     100114      -9544     
- Partials      19510      20201       +691     
Flag Coverage Δ
integration 48.4229% <81.0810%> (?)
unit 70.4475% <81.0810%> (+1.4163%) ⬆️

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

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 51.2959% <ø> (+4.9190%) ⬆️

@hawkingrei
Copy link
Member Author

/retest

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
}

func getIdx(tbl model.TableItemID) int64 {
result := tbl.ID % shardCnt
Copy link
Contributor

Choose a reason for hiding this comment

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

you can just tbl.ID's negativeness before mod

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@hawkingrei
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Mar 28, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Mar 28, 2024
Copy link

ti-chi-bot bot commented Mar 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AilinKid, 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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 28, 2024
Copy link

ti-chi-bot bot commented Mar 28, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-28 10:05:26.882424747 +0000 UTC m=+2148753.904671135: ☑️ agreed by winoros.
  • 2024-03-28 10:36:45.170337534 +0000 UTC m=+2150632.192583924: ☑️ agreed by AilinKid.

@ti-chi-bot ti-chi-bot bot merged commit c0fc3ba into pingcap:master Mar 28, 2024
23 checks passed
@hawkingrei hawkingrei deleted the shard_needed_stats_map branch March 28, 2024 10:41
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants