-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve][pip] PIP-449: Improve metadata sync to have exclusions in syncing specific config matching regex pattern across onprem and cloud clusters #25035
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
Open
vraulji567
wants to merge
6
commits into
apache:branch-3.3
Choose a base branch
from
vraulji567:add_metadata_sync_exclusions
base: branch-3.3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+441
−5
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
544fa35
Enhance pulsar metadata to have exclusions in syncing specific config…
vraulji567 9522ad6
Enhance pulsar metadata to have exclusions in syncing specific config…
vraulji567 dbfa839
Fix test
vraulji567 ef8cad6
Fix review comments and add pip
vraulji567 d3e11bf
Update pip
vraulji567 a7aabcb
Update pip with mailing list discussion thread
vraulji567 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # PIP-449: Improve metadata sync to have exclusions in syncing config across clusters in different environments (on-prem and cloud) | ||
|
|
||
| Implementation: https://github.com/apache/pulsar/pull/25035 | ||
|
|
||
| # Background knowledge | ||
|
|
||
| Apache Pulsar is a cloud-native, distributed messaging framework which natively provides geo-replication. Many organizations deploy pulsar instances on-prem and on multiple different cloud providers and at the same time they would like to enable replication between multiple clusters deployed in different cloud providers. Pulsar already provides various proxy options (Pulsar proxy/ enterprise proxy solutions on SNI) to fulfill security requirements when brokers are deployed on different security zones connected with each other. | ||
|
|
||
| However, sometimes it's not possible to share metadata-store (global zookeeper) between pulsar clusters deployed on separate cloud provider platforms, and synchronizing configuration metadata (policies) can be a critical path to share tenant/namespace/topic policies between clusters and administrate pulsar policies uniformly across all clusters. Pulsar has metadata sync feature that syncs configurations across clusters in different environments. | ||
|
|
||
| The metadata sync feature syncs all the configuration metadata cluster/tenant/namespace/topic policies and has no way to exclude specific config sync. This is needed as a cluster can have different config in on-prem vs cloud and synchronizing such config breaks the geo-replication. This PIP is to enhance metadata sync to exclude cluster config from syncing across clusters in on-prem and cloud. | ||
|
|
||
|
|
||
| # Motivation | ||
| The pulsar metadata sync feature syncs all the configuration metadata cluster/tenant/namespace/topic policies and has no way to exclude specific config (eg. cluster configuration) from synchronization across clusters. This is crucial for pulsar multi-environment cluster set up where a cluster can have different configuration in on-prem and cloud and synchronizing this configuration can break geo replication across clusters in different environments on-prem and cloud. Also in pulsar set up where there is separate cluster for a high value tenant in on-prem vs a common cluster for all other tenants, this exclusion in metadata sync becomes crucial in synchronizing tenant/namespace/topic policies across onprem and cloud clusters. | ||
|
|
||
|  | ||
| # Goals | ||
|
|
||
| ## In Scope | ||
|
|
||
| Pulsar metadata sync should exclude synchronization of configuration metadata cluster/tenant/namespace/topic policies across clusters based on the exclusion regex pattern set in the broker config. This helps the cluster admin to set up desired cluster configuration to achieve geo replication across multi-environment cluster in on-prem and cloud while still achieving synchronization of tenant/namespace/topic policies across clusters. | ||
|
|
||
| ## Out of Scope | ||
| None as part of the metadata sync feature. | ||
|
|
||
| # High Level Design | ||
|
|
||
| Configure regex pattern in `metadataSyncEventExclusions` as part of the broker config on cluster to exclude metadata sync events from synchronizing on the cluster. The destination cluster will receive the event from the source cluster on the metadata sync topic but would not update/delete config from the metadata store if the metadata sync event matches the regex pattern configured as exclusion. A destination cluster would receive all the metadata sync events but ignore them if they match the regex pattern configured as exclusion in the broker config. Multiple comma separated regex patterns can be provided and sync event would be excluded if it matches any of the pattern. IF no exclusions are provided, configuration metadata will sync as before without any exclusions. | ||
|
|
||
| # Detailed Design | ||
|
|
||
| ## Design & Implementation Details | ||
|
|
||
| - Add a config `metadataSyncEventExclusions` in the broker config to capture exclusion patterns for the cluster. | ||
| - Add a method `private boolean isMetadataEventExcluded(MetadataEvent metadataEvent)` to PulsarMetadataEventSynchronizer.java to match the regex pattern. Return true if the pattern matches the path in the MetadataEvent, false otherwise. | ||
| - Update the message listener for the consumer on metadata sync topic to acknowledge the event without processing it if the event is excluded. | ||
|
|
||
| ### Configuration | ||
| - Add a broker config `metadataSyncEventExclusions` | ||
| ``` | ||
| # Exclusions for metadata sync between separate clusters on different cloud platforms | ||
| # multiple configurations are separated by comma eg. /admin/clusters/.*,/admin/test/.* | ||
| metadataSyncEventExclusions= | ||
| ``` | ||
|
|
||
| # General Notes | ||
|
|
||
| # Links | ||
| - Mailing List Discussion Thread - https://lists.apache.org/thread/kbkgy0q6fgt2hfyrqync2gvxsordzv0d | ||
| - Mailing List Voting Thread - | ||
|
|
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.