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: improve code to avoid data race #46309

Merged
merged 11 commits into from
Aug 23, 2023

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Aug 22, 2023

What problem does this PR solve?

Issue Number: ref #46158

Problem Summary:

What is changed and how it works?

  • copy cache item when to evict
  • clean code by merging some logic.

I have created a flowchart to facilitate everyone's understanding.

image

Check List

Tests

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

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 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. and removed do-not-merge/needs-linked-issue labels Aug 22, 2023
@hawkingrei hawkingrei changed the title *: improve code to avoid data race statistics: improve code to avoid data race Aug 22, 2023
@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Merging #46309 (485758d) into master (7e476a5) will decrease coverage by 0.3196%.
Report is 21 commits behind head on master.
The diff coverage is 70.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #46309        +/-   ##
================================================
- Coverage   73.3517%   73.0321%   -0.3196%     
================================================
  Files          1284       1313        +29     
  Lines        393256     403343     +10087     
================================================
+ Hits         288460     294570      +6110     
- Misses        86433      90224      +3791     
- Partials      18363      18549       +186     
Flag Coverage Δ
integration 26.0464% <0.0000%> (?)
unit 73.7055% <70.0000%> (+0.3538%) ⬆️

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

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 85.0633% <ø> (-0.0035%) ⬇️
br 47.9600% <ø> (-4.2802%) ⬇️

Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
@hawkingrei hawkingrei requested a review from qw4990 August 22, 2023 08:20
Signed-off-by: Weizhen Wang <[email protected]>
@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 Aug 22, 2023
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
@hawkingrei hawkingrei requested review from lance6716 and Rustin170506 and removed request for lance6716 August 22, 2023 09:49
Signed-off-by: Weizhen Wang <[email protected]>
@hawkingrei
Copy link
Member Author

/retest

6 similar comments
@hawkingrei
Copy link
Member Author

/retest

@hawkingrei
Copy link
Member Author

/retest

@purelind
Copy link
Contributor

/retest

@purelind
Copy link
Contributor

/retest

@hawkingrei
Copy link
Member Author

/retest

@purelind
Copy link
Contributor

/retest

@hawkingrei
Copy link
Member Author

/test all

Signed-off-by: Weizhen Wang <[email protected]>
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 23, 2023
@hawkingrei
Copy link
Member Author

/retest

Signed-off-by: Weizhen Wang <[email protected]>
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 23, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qw4990, time-and-fate

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:
  • OWNERS [qw4990,time-and-fate]

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 Aug 23, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 23, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-08-23 06:18:37.422697171 +0000 UTC m=+1303081.971713153: ☑️ agreed by qw4990.
  • 2023-08-23 09:32:23.908044564 +0000 UTC m=+1314708.457060548: ☑️ agreed by time-and-fate.

@hawkingrei
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit aadbb7e into pingcap:master Aug 23, 2023
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.

4 participants