You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "1Jack2 (via GitHub)" <gi...@apache.org> on 2023/08/03 06:13:03 UTC
[GitHub] [pulsar] 1Jack2 commented on issue #20871: [Bug] When bookie-rack is not configured, pulsar-admin bookies get-bookie-rack -b is throwing 'Bookie address not found' error
1Jack2 commented on issue #20871:
URL: https://github.com/apache/pulsar/issues/20871#issuecomment-1663348164
> Would you like to try to fix this?
I'd like to help. Here are my thoughts
change the following code
https://github.com/apache/pulsar/blob/69298da9f8bd009b72eb5533d31c8c7a696b2a63/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Bookies.java#L108-L121
like this
``` java
if (bi.isPresent()) {
asyncResponse.resume(bi.get());
} else {
Set<BookieId> bookieIds = getAllBookieIds();
if (bookieIds.contains(BookieId.parse(bookieAddress))) {
asyncResponse.resume((BookieInfo) null);
} else {
asyncResponse.resume(new RestException(Status.NOT_FOUND,
"Bookie address not found: " + bookieAddress));
}
}
```
The `getAllBookieIds()` method can be implemented by referring to the following methods
https://github.com/apache/pulsar/blob/69298da9f8bd009b72eb5533d31c8c7a696b2a63/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Bookies.java#L78-L97
I think `delete-bookie-rack` api has the same issue
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org