-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[improve][broker] PIP-192: Support delete namespace bundle admin API #19851
[improve][broker] PIP-192: Support delete namespace bundle admin API #19851
Conversation
ade32bd
to
bb0998f
Compare
bb0998f
to
1638aae
Compare
public CompletableFuture<Boolean> checkOwnershipPresentAsync(NamespaceBundle bundle) { | ||
if (ExtensibleLoadManagerImpl.isLoadManagerExtensionEnabled(config)) { | ||
ExtensibleLoadManagerImpl extensibleLoadManager = ExtensibleLoadManagerImpl.get(loadManager.get()); | ||
return extensibleLoadManager.getOwnershipAsync(Optional.empty(), bundle) |
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.
can we pass Optional.empty()
for system topics like bsc?
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.
Can you explain in detail?
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.
If we don't pass the Optional<ServiceUnitId> topic
, I think the ownership cannot be found for the load manager system topics (like bsc, broker-load, top-bundles-load topics). If this checkOwnershipPresentAsync is not used to check the load manager system topics, we are good here.
// example how we use Optional<ServiceUnitId> topic
private CompletableFuture<Optional<String>> getOwnershipAsync(Optional<ServiceUnitId> topic,
ServiceUnitId bundleUnit) {
final String bundle = bundleUnit.toString();
CompletableFuture<Optional<String>> owner;
if (topic.isPresent() && isInternalTopic(topic.get().toString())) {
owner = serviceUnitStateChannel.getChannelOwnerAsync();
} else {
owner = serviceUnitStateChannel.getOwnerAsync(bundle);
}
return owner;
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.
I don't think when using checkOwnershipPresentAsync
method, we can get the topic info.
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.
I think we can remove Optional<ServiceUnitId> topic
and pass just bundleUnit
only to getOwnershipAsync, like the one below. Let the leader own all system namespace topics, and we don't auto-unload system topics.
private CompletableFuture<Optional<String>> getOwnershipAsync(ServiceUnitId bundleUnit) {
final String bundle = bundleUnit.toString();
CompletableFuture<Optional<String>> owner;
if (isSystemNamespace(bundleUnit.toString())) {
owner = serviceUnitStateChannel.getChannelOwnerAsync();
} else {
owner = serviceUnitStateChannel.getOwnerAsync(bundle);
}
return owner;
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.
Yes, adding another namespace will be better. Also, we shouldn't let users delete the system namespace, right?
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.
I dont think users need to delete system topics.
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.
Ok, then checkOwnershipPresentAsync
will not be used for the system topics.
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.
Plz throw NotSupportedOperationException if the input bundle's namespace is the system namespace .
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.
Updated.
PIP: #16691
Motivation
Raising a PR to implement #16691.
We need to support delete namespace bundle admin API.
Modifications
Documentation
doc
doc-required
doc-not-needed
doc-complete