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

checker, statistic: avoid leak in label statistic #8703

Merged
merged 5 commits into from
Oct 16, 2024

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Oct 14, 2024

What problem does this PR solve?

Issue Number: Close #8700

What is changed and how does it work?

Check List

Tests

  • Unit test

Release note

None.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 14, 2024
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.71%. Comparing base (48e72f1) to head (1324449).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8703      +/-   ##
==========================================
+ Coverage   71.70%   71.71%   +0.01%     
==========================================
  Files         517      517              
  Lines       67450    67466      +16     
==========================================
+ Hits        48364    48383      +19     
+ Misses      15521    15512       -9     
- Partials     3565     3571       +6     
Flag Coverage Δ
unittests 71.71% <100.00%> (+0.01%) ⬆️

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

Signed-off-by: lhy1024 <[email protected]>

// ClearDefunctRegions is used to handle the overlap region.
// It is used to remove the defunct regions from the label statistics.
func (l *LabelStatistics) ClearDefunctRegions() {
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 adding a unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I have added a unit test, which can pass in this pr and is failed in master branch.

Signed-off-by: lhy1024 <[email protected]>
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 15, 2024
@lhy1024 lhy1024 requested a review from rleungx October 16, 2024 06:47
@ti-chi-bot ti-chi-bot bot added the lgtm label Oct 16, 2024
Copy link
Contributor

ti-chi-bot bot commented Oct 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: okJiang, rleungx

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

ti-chi-bot bot commented Oct 16, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-10-15 10:13:14.052296332 +0000 UTC m=+352391.201206161: ☑️ agreed by okJiang.
  • 2024-10-16 07:13:42.726059788 +0000 UTC m=+428019.874969620: ☑️ agreed by rleungx.

@lhy1024
Copy link
Contributor Author

lhy1024 commented Oct 16, 2024

/check-issue-triage-complete

1 similar comment
@lhy1024
Copy link
Contributor Author

lhy1024 commented Oct 16, 2024

/check-issue-triage-complete

@ti-chi-bot ti-chi-bot bot merged commit 26123dc into tikv:master Oct 16, 2024
24 of 25 checks passed
@lhy1024
Copy link
Contributor Author

lhy1024 commented Oct 22, 2024

/cherry-pick release-8.4

@lhy1024 lhy1024 deleted the fix-label-leak branch October 22, 2024 03:50
@ti-chi-bot
Copy link
Member

@lhy1024: new pull request created to branch release-8.4: #8735.

In response to this:

/cherry-pick release-8.4

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 bot pushed a commit that referenced this pull request Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. 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.

labelLevelStats may leak when merging regions
4 participants