[fix] [broker] local metadata sync topic contains configuration events causing all operations stuck#22695
Open
poorbarcode wants to merge 3 commits intoapache:masterfrom
Open
[fix] [broker] local metadata sync topic contains configuration events causing all operations stuck#22695poorbarcode wants to merge 3 commits intoapache:masterfrom
poorbarcode wants to merge 3 commits intoapache:masterfrom
Conversation
|
@poorbarcode Please add the following content to your PR description and select a checkbox: |
| doc = "If you want to enable or disable the metadata synchronizer dynamically, this value should be true." | ||
| + "Enabled: Pulsar will initialize itself to update the metadata synchronizer dynamically." | ||
| ) | ||
| private boolean mayEnableMetadataSynchronizer = false; |
Member
There was a problem hiding this comment.
Maybe we can name the configuration as forceUseSeparatedConfigurationStore? Then we can use isConfigurationStoreSeparated to check the condition.
public boolean isConfigurationStoreSeparated() {
return !Objects.equals(getConfigurationMetadataStoreUrl(), getMetadataStoreUrl()) || forceUseSeparatedConfigurationStore;
}
Contributor
Author
There was a problem hiding this comment.
- Renamed
mayEnableMetadataSynchronizertoforceUseSeparatedConfigurationStoreInMemory - I did not change the method
isConfigurationStoreSeparated, because the original behavior of this method is whether the URLs is different between Configuration Metadata Store and Local Metadata Store, we should not to change it.
4 tasks
Member
|
@poorbarcode please resolve the merge conflict |
…s causing all operations stuck
0eb3c04 to
8a59c50
Compare
Contributor
Author
Done |
4 tasks
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.
Motivation
Background:
PIP-136: Sync Pulsar policies across multiple clouds defines two topics below:
metadataSyncEventTopic: monitors local metadata store changesconfigurationMetadataSyncEventTopic: monitors local metadata store changesLocal metadata store and Configuration metadata store share the same object in memory when their URLs are the same.
Issue 1
Since the event synchronizer is bound to the
metadata storeobject in memory, the synchronizer receives all the events about the Local metadata store and Configuration metadata store when the two metadata stores are the same object in memory, the data in the two topics got mixed up.Issue 2
The internal producer of the synchronizer relies on the
SyncEventTopic; this topic relies on the namespace local policies; the operation of writing namespace local policies to ZK relies on the internal producer. A deadlock occurs. See the following flow:metadataSyncEventTopicup.metadataSyncEventTopicbefore writing data to the Local Metadata Store.You can reproduce this issue by the test
SyncConfigStore1ZKPerClusterTest. testDynamicEnableConfigurationMetadataSyncEventTopic. This PR fixed the issue that the synchronizer got stuck due to two metadata stores relying on it. I will write a separate PR that skips syncing data that relies on the synchronizer itself.Modifications
metadataSyncEventTopiconly receives the event about the local metadata store andconfigurationMetadataSyncEventTopiconly receives the event about the configuration metadata store.mayEnableMetadataSynchronizerto let the Broker initialize itself with a separate configuration metadata store.Next PRs
Skip to sync events that rely on the synchronizer itself. For example:
metadataSyncEventTopicispublic/default/tppublic/default/tp, because the synchronizer relies on this topic 😂 , I will send a discussion for this change. See more details the Issue 2 in the section Motivation.Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: x