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(storage): Distinguish between unssigned_task and tivival_move_task in the metrics report #7742

Merged
merged 3 commits into from
Feb 7, 2023

Conversation

Li0k
Copy link
Contributor

@Li0k Li0k commented Feb 7, 2023

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

What's changed and what's your intention?

In the existing code, if the assignee_context_id is not found, the corresponding task will be reported to the unassigned label, which is confusing.

In this pr, it will distinguish trivival_move_task from unassigned more precisely so that they can be better distinguished in the metrics.

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).
    - [ ] I have demonstrated that backward compatibility is not broken by breaking changes and created issues to track deprecated features to be removed in the future. (Please refer the issue)
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

If your pull request contains user-facing changes, please specify the types of the changes, and create a release note. Otherwise, please feel free to remove this section.

Types of user-facing changes

Please keep the types that apply to your changes, and remove those that do not apply.

  • Installation and deployment
  • Connector (sources & sinks)
  • SQL commands, functions, and operators
  • RisingWave cluster configuration changes
  • Other (please specify in the release note below)

Release note

Please create a release note for your changes. In the release note, focus on the impact on users, and mention the environment or conditions where the impact may occur.

Refer to a related PR or issue link (optional)

@Li0k
Copy link
Contributor Author

Li0k commented Feb 7, 2023

image

@github-actions github-actions bot added the type/fix Bug fix label Feb 7, 2023
Comment on lines 1225 to 1246
if CompactStatus::is_trivial_move_task(compact_task) {
// TODO: only support can_trivial_move in DynamicLevelCompcation, will check
// task_type next PR
self.metrics
.compact_frequency
.with_label_values(&[
"trivial-move",
&compact_task.compaction_group_id.to_string(),
task_status_label,
])
.inc();
} else {
// Update compaction task count. The task will be marked as `unassigned`.
self.metrics
.compact_frequency
.with_label_values(&[
"unassigned",
&compact_task.compaction_group_id.to_string(),
task_status_label,
])
.inc();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: may simplify to

let label = if CompactStatus::is_trivial_move_task(compact_task) {
    "trivial-move"
} else {
    "unassigned"
};
self.metrics.compact_frequency.with_label_values(...).inc();

@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Merging #7742 (73643a7) into main (ed27ecd) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #7742      +/-   ##
==========================================
- Coverage   71.68%   71.67%   -0.01%     
==========================================
  Files        1098     1098              
  Lines      174553   174558       +5     
==========================================
- Hits       125133   125121      -12     
- Misses      49420    49437      +17     
Flag Coverage Δ
rust 71.67% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
src/meta/src/hummock/manager/mod.rs 78.23% <100.00%> (+<0.01%) ⬆️
src/batch/src/executor/group_top_n.rs 68.23% <0.00%> (-6.48%) ⬇️
src/object_store/src/object/mem.rs 86.48% <0.00%> (-0.78%) ⬇️
src/meta/src/hummock/mock_hummock_meta_client.rs 65.26% <0.00%> (-0.53%) ⬇️
src/storage/src/hummock/sstable_store.rs 64.57% <0.00%> (-0.32%) ⬇️
src/storage/src/hummock/compactor/iterator.rs 97.95% <0.00%> (-0.30%) ⬇️
src/object_store/src/object/mod.rs 51.30% <0.00%> (-0.22%) ⬇️
src/storage/src/hummock/compactor/mod.rs 80.76% <0.00%> (-0.20%) ⬇️
src/stream/src/executor/aggregation/minput.rs 96.24% <0.00%> (-0.11%) ⬇️
... and 3 more

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

@mergify mergify bot merged commit c8535a6 into main Feb 7, 2023
@mergify mergify bot deleted the li0k/storage_fix_report_unassigned_task branch February 7, 2023 16:31
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.

3 participants