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

Implement partition compaction planner #6469

Merged

Conversation

alexqyle
Copy link
Contributor

@alexqyle alexqyle commented Dec 31, 2024

What this PR does:

PartitionCompactionPlanner is generally similar as ShuffleShardingPlanner. It checks visit marker for the partition is about to be compacted. If the visit marker is legit, PartitionCompactionPlanner would validate all blocks in the partition then pass it onto compaction.

Which issue(s) this PR fixes:
NA

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@CharlieTLe
Copy link
Member

@danielblando, could you help review?

Copy link
Contributor

@danielblando danielblando left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. Forgot to come back to the PR

pkg/compactor/compactor.go Outdated Show resolved Hide resolved
pkg/compactor/partition_compaction_planner.go Outdated Show resolved Hide resolved
pkg/compactor/partition_compaction_planner.go Show resolved Hide resolved
pkg/compactor/partition_compaction_planner.go Show resolved Hide resolved
Signed-off-by: Alex Le <[email protected]>
@@ -174,6 +175,10 @@ func newCompactorMetricsWithLabels(reg prometheus.Registerer, commonLabels []str
Name: "cortex_compactor_group_partition_count",
Help: "Number of partitions for each compaction group.",
}, compactionLabels)
m.compactionsNotPlanned = promauto.With(reg).NewCounterVec(prometheus.CounterOpts{
Name: "cortex_compactor_group_compactions_not_planned",
Help: "Total number of group compaction not planned due to non-critical error (ie. group is currently visited by other compactor).",
Copy link
Contributor

Choose a reason for hiding this comment

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

This metric is a bit confusing to me. Non-critical error... Is it recommended for users to alarm on this metric?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated description and use this metric for not planned case due to error

Copy link
Contributor

@danielblando danielblando left a comment

Choose a reason for hiding this comment

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

Thanks

@danielblando danielblando merged commit 68a2993 into cortexproject:master Jan 14, 2025
17 checks passed
@alexqyle alexqyle deleted the partition-compaction-planner branch January 14, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants