-
Notifications
You must be signed in to change notification settings - Fork 21
support topic compaction #331
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
Conversation
|
@freeznet:Thanks for your contribution. For this PR, do we need to update docs? |
…ings - Added logging for creation and policy errors during topic application in `reconcile_topic.go`. - Increased timeout settings in tests for resource updates to ensure stability and reliability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for the compactionThreshold field on PulsarTopic, enabling automatic topic compaction based on size.
- Added
CompactionThresholdto the API types, CRD schema, deep-copy logic, and sample. - Integrated
CompactionThresholdin admin interface, reconciliation logic, and live tests. - Enabled topic-level policies in the CI cluster configuration.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/spec.go | Added MakePulsarTopicWithCompactionThreshold test helper |
| tests/operator/resources_test.go | New tests for create/update/remove of compaction threshold |
| pkg/connection/reconcile_topic.go | Include CompactionThreshold in TopicParams and log action |
| pkg/admin/interface.go | Exposed CompactionThreshold in TopicParams interface |
| pkg/admin/impl.go | Implemented SetCompactionThreshold policy call |
| config/samples/resource_v1alpha1_pulsartopic.yaml | Documented compactionThreshold in sample YAML |
| config/crd/bases/resource.streamnative.io_pulsartopics.yaml | Added CRD schema entry for compactionThreshold |
| api/v1alpha1/zz_generated.deepcopy.go | Generated deep-copy logic for CompactionThreshold |
| api/v1alpha1/pulsartopic_types.go | Defined optional CompactionThreshold field in spec |
| .ci/clusters/values.yaml | Enabled topicLevelPoliciesEnabled in broker config |
Comments suppressed due to low confidence (3)
tests/operator/resources_test.go:375
- The import alias
v1alphav1here is inconsistent with the rest of the code (which usesv1alpha1). Consider renaming tov1alpha1for clarity and consistency.
compactionTopic *v1alphav1.PulsarTopic
tests/operator/resources_test.go:412
- After updating the compaction threshold, add an assertion to verify
topic.Spec.CompactionThresholdequalsnewThresholdto ensure the field was persisted correctly.
topic.Spec.CompactionThreshold = &newThreshold
tests/operator/resources_test.go:431
- Add a test assertion after setting
CompactionThresholdtonilto confirm that the field has been removed from the spec.
topic.Spec.CompactionThreshold = nil
(If this PR fixes a github issue, please add
Fixes #<xyz>.)Fixes #56
(or if this PR is one task of a github issue, please add
Master Issue: #<xyz>to link to the master issue.)Master Issue: #
Motivation
Explain here the context, and why you're making that change. What is the problem you're trying to solve.
Modifications
Describe the modifications you've done.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Documentation
Check the box below.
Need to update docs?
doc-required(If you need help on updating docs, create a doc issue)
no-need-doc(Please explain why)
doc(If this PR contains doc changes)