gc: expose per-pdev backlog and pressure metrics - #462
Open
xiaoxichen wants to merge 1 commit into
Open
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## stable/v4.x #462 +/- ##
==============================================
Coverage ? 54.03%
==============================================
Files ? 39
Lines ? 6888
Branches ? 943
==============================================
Hits ? 3722
Misses ? 2767
Partials ? 399 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add five per-pdev gauges to pdev_gc_metrics for operator visibility into the GC backlog: - pending_gc_bytes reclaimable bytes in PG-owned chunks - eligible_gc_bytes bytes GC would pick up under current policy - eligible_gc_chunk_count count for the above - pending_normal_gc_task_count normal-priority queue depth - pending_gc_chunks_ratio 10-series labeled gauge over (0,10]% .. (90,100]% The bucket metric emits as a single Prometheus family with a 'bucket' label, differentiated by direct m_impl_ptr->register_gauge() calls (the compile-time-name macro cannot express label-differentiated series). Descriptions embed the bucket label so the sisl JSON dump does not collapse the 10 entries to one. Values are refreshed once per gc_scan_interval by scan_chunks_for_gc, using a new private GCManager::get_chunk_gc_snapshot helper that folds the four ExtendedVChunk field reads into a single lookup per chunk; get_chunk_gc_ratio is retained as a thin wrapper for backward compatibility.
| LOGINFOMOD(gcmgr, | ||
| "pdev_id={} already has {}/{} pending normal gc tasks, skipping submission this scan cycle", | ||
| pdev_id, already_pending, max_task_num); | ||
| continue; |
Member
There was a problem hiding this comment.
when reaching here, it means some gc tasks are backloged. it is valuable for us to report eligible_gc_bytes/eligible_gc_chunk_count/pending_gc_chunks_ratio , etc. to metrics now to show us the gc pressure.
if we just continue and skip publish_scan_snapshot, we can not get those information timely.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add five per-pdev gauges to pdev_gc_metrics for operator visibility into the GC backlog:
The bucket metric emits as a single Prometheus family with a 'bucket' label, differentiated by direct m_impl_ptr->register_gauge() calls (the compile-time-name macro cannot express label-differentiated series). Descriptions embed the bucket label so the sisl JSON dump does not collapse the 10 entries to one.
Values are refreshed once per gc_scan_interval by scan_chunks_for_gc, using a new private GCManager::get_chunk_gc_snapshot helper that folds the four ExtendedVChunk field reads into a single lookup per chunk; get_chunk_gc_ratio is retained as a thin wrapper for backward compatibility.