-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix] [broker] local metadata sync topic contains configuration events causing all operations stuck #22695
base: master
Are you sure you want to change the base?
[fix] [broker] local metadata sync topic contains configuration events causing all operations stuck #22695
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; |
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.
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;
}
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.
- Renamed
mayEnableMetadataSynchronizer
toforceUseSeparatedConfigurationStoreInMemory
- 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.
@poorbarcode please resolve the merge conflict |
…s causing all operations stuck
0eb3c04
to
8a59c50
Compare
Done |
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 store
object 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:metadataSyncEventTopic
up.metadataSyncEventTopic
before 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
metadataSyncEventTopic
only receives the event about the local metadata store andconfigurationMetadataSyncEventTopic
only receives the event about the configuration metadata store.mayEnableMetadataSynchronizer
to 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:
metadataSyncEventTopic
ispublic/default/tp
public/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
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x