Technoboy- commented on code in PR #14153:
URL: https://github.com/apache/pulsar/pull/14153#discussion_r865601142
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -546,27 +548,46 @@ private CompletableFuture<Void>
updatePartitionInOtherCluster(int numPartitions,
protected PartitionedTopicMetadata internalGetPartitionedMetadata(boolean
authoritative,
boolean
checkAllowAutoCreation) {
- PartitionedTopicMetadata metadata =
getPartitionedTopicMetadata(topicName,
- authoritative, checkAllowAutoCreation);
- if (metadata.partitions == 0 && !checkAllowAutoCreation) {
- // The topic may be a non-partitioned topic, so check if it exists
here.
- // However, when checkAllowAutoCreation is true, the client will
create the topic if it doesn't exist.
- // In this case, `partitions == 0` means the automatically created
topic is a non-partitioned topic so we
- // shouldn't check if the topic exists.
- try {
- if
(!pulsar().getNamespaceService().checkTopicExists(topicName).get()) {
- throw new RestException(Status.NOT_FOUND,
- new PulsarClientException.NotFoundException("Topic
not exist"));
- }
- } catch (InterruptedException | ExecutionException e) {
- log.error("Failed to check if topic '{}' exists", topicName,
e);
- throw new RestException(Status.INTERNAL_SERVER_ERROR, "Failed
to get topic metadata");
+ try {
+ return internalGetPartitionedMetadataAsync(authoritative,
checkAllowAutoCreation)
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]