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

fix: Remove possible panic in metrics clean up. #13004

Merged
merged 2 commits into from
Oct 27, 2023
Merged

Conversation

liurenjie1024
Copy link
Contributor

@liurenjie1024 liurenjie1024 commented Oct 23, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Remove possible panic in metrics cleanup.

Close #12489

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@github-actions github-actions bot added the type/fix Bug fix label Oct 23, 2023
@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Merging #13004 (1305d4d) into main (12b3535) will increase coverage by 0.02%.
Report is 1 commits behind head on main.
The diff coverage is 64.10%.

@@            Coverage Diff             @@
##             main   #13004      +/-   ##
==========================================
+ Coverage   68.26%   68.28%   +0.02%     
==========================================
  Files        1498     1498              
  Lines      252740   252565     -175     
==========================================
- Hits       172524   172457      -67     
+ Misses      80216    80108     -108     
Flag Coverage Δ
rust 68.28% <64.10%> (+0.02%) ⬆️

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

Files Coverage Δ
src/batch/src/executor/group_top_n.rs 70.15% <100.00%> (ø)
src/batch/src/executor/hash_agg.rs 98.62% <100.00%> (ø)
src/batch/src/executor/join/hash_join.rs 98.49% <100.00%> (ø)
src/common/src/estimate_size/collections/heap.rs 82.10% <100.00%> (ø)
src/batch/src/task/context.rs 20.00% <0.00%> (ø)
src/common/src/memory/mem_context.rs 83.72% <54.54%> (-7.95%) ⬇️
src/batch/src/executor/row_seq_scan.rs 20.64% <0.00%> (-0.49%) ⬇️
src/batch/src/executor/generic_exchange.rs 40.80% <0.00%> (-1.01%) ⬇️
src/batch/src/monitor/stats.rs 80.11% <79.22%> (+29.54%) ⬆️

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@wenym1 wenym1 left a comment

Choose a reason for hiding this comment

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

Just introduce a label guarded metrics in #12882 that will automatically remove the label when the metrics variable is dropped. May consider porting these metrics to use the label guarded one?

@liurenjie1024
Copy link
Contributor Author

Just introduce a label guarded metrics in #12882 that will automatically remove the label when the metrics variable is dropped. May consider porting these metrics to use the label guarded one?

Done.

@liurenjie1024
Copy link
Contributor Author

cc @wenym1 Any other comments?

Copy link
Contributor

@wenym1 wenym1 left a comment

Choose a reason for hiding this comment

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

I just realize that the current label guarded metrics may drop the label before it is collected, which will cause a loss of metrics. I will have a new PR to fix this first.

src/batch/src/task/context.rs Outdated Show resolved Hide resolved
@wenym1
Copy link
Contributor

wenym1 commented Oct 26, 2023

I just realize that the current label guarded metrics may drop the label before it is collected, which will cause a loss of metrics. I will have a new PR to fix this first.

Can be fixed by #13080

@wenym1
Copy link
Contributor

wenym1 commented Oct 26, 2023

Support for label guarded Gauge is supported in #13080 by the way. Related code in this PR can be removed.

@liurenjie1024
Copy link
Contributor Author

Support for label guarded Gauge is supported in #13080 by the way. Related code in this PR can be removed.

I think it's already removed in this pr.

@liurenjie1024 liurenjie1024 added this pull request to the merge queue Oct 27, 2023
Copy link
Contributor

@wenym1 wenym1 left a comment

Choose a reason for hiding this comment

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

Rest LGTM!

src/common/src/memory/mem_context.rs Outdated Show resolved Hide resolved
@liurenjie1024 liurenjie1024 removed this pull request from the merge queue due to a manual request Oct 27, 2023
@liurenjie1024 liurenjie1024 added this pull request to the merge queue Oct 27, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Oct 27, 2023
@liurenjie1024 liurenjie1024 added this pull request to the merge queue Oct 27, 2023
Merged via the queue into main with commit 31d6dc0 Oct 27, 2023
6 of 7 checks passed
@liurenjie1024 liurenjie1024 deleted the renjie/issue-12489 branch October 27, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Duplicate remove in batch task metrics
2 participants