[feat][broker] PIP-469: Legacy-aware topic policies backend routing and metadata-store topic policies#25707
Open
BewareMyPower wants to merge 18 commits intoapache:masterfrom
Open
[feat][broker] PIP-469: Legacy-aware topic policies backend routing and metadata-store topic policies#25707BewareMyPower wants to merge 18 commits intoapache:masterfrom
BewareMyPower wants to merge 18 commits intoapache:masterfrom
Conversation
…nd metadata-store topic policies
current: BUILD SUCCESSFUL in 2m 18s
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Implements PIP-469 topic-policies backend routing to preserve legacy __change_events behavior while enabling a new metadata-store-backed topic policies implementation, and refactors existing topic policies tests to run significantly faster.
Changes:
- Add
LegacyAwareTopicPoliciesServiceto route per-namespace operations to either legacy system-topic or configured backend. - Introduce
MetadataStoreTopicPoliciesServiceimplementation backed by metadata stores, with listener support. - Refactor
TopicPoliciesTestlifecycle to reduce repeated broker setup/teardown and add a derived test suite for the metadata-store backend.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pulsar-broker/src/test/java/org/apache/pulsar/broker/service/TopicPolicyTestUtils.java | Extends bypass-cache helper to work with legacy-aware routing and the metadata-store backend. |
| pulsar-broker/src/test/java/org/apache/pulsar/broker/service/LegacyAwareTopicPoliciesServiceTest.java | Adds upgrade/downgrade and listener behavior coverage for legacy-aware routing and metadata-store storage. |
| pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesTest.java | Refactors test lifecycle to reduce runtime and adapts tests to multiple policies backends. |
| pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/MetadataStoreTopicPoliciesTest.java | Reuses TopicPoliciesTest against the metadata-store backend, disabling inapplicable system-topic tests. |
| pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java | Loosens visibility on bundle-ownership cleanup to enable reuse/integration. |
| pulsar-broker/src/main/java/org/apache/pulsar/broker/service/MetadataStoreTopicPoliciesService.java | Adds new metadata-store-backed implementation for topic policies with store notifications and listeners. |
| pulsar-broker/src/main/java/org/apache/pulsar/broker/service/LegacyAwareTopicPoliciesService.java | Adds per-namespace routing layer between legacy system-topic backend and configured backend. |
| pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java | Wraps configured topic policies service with legacy-aware routing when system topics are enabled. |
| pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java | Updates configuration documentation to describe built-in topic policies service implementations and legacy behavior. |
Contributor
Author
|
We might need to consider whether to change the |
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.
pip: #25547
This PR reuses
TopicPoliciesTestto test most functionality of the new metadata store based implementation, so it also introduces improvements onTopicPoliciesTest, which requires too much time to run before (100+ tests, where each test callsinternalSetupandinternalCleanup).