You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "armanjupriya-er (via GitHub)" <gi...@apache.org> on 2023/07/25 10:07:52 UTC

[GitHub] [pulsar] armanjupriya-er opened a new issue, #20871: [Bug] When bookie-rack is not configured, pulsar-admin bookies get-bookie-rack -b is throwing 'Bookie address not found' error

armanjupriya-er opened a new issue, #20871:
URL: https://github.com/apache/pulsar/issues/20871

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Version
   
   Pulsar 2.10.3 on K8s container
   
   ### Minimal reproduce step
   
   1. Ensure that bookie-rack policy is NOT configured
   2. Lis the bookies using "pulsar-admin bookies list-bookies"
   3. Get the bookie rack using the address displayed in step 2 (list-bookies command) [pulsar-admin bookies get-bookie-rack -b "proper-bookie-id.:3181"]   . The get-bookie-rack throws error "Bookie address not found: proper-bookie-id.:3181"   
   
   
   ### What did you expect to see?
   
   If the bookie-rack is not set, proper error message should be displayed [ Example : null as bookie as rack]
   
   ### What did you see instead?
   
   Bookie address not found: <Bookie Id>.:3181
   Example: Bookie address not found: proper-bookie-id.:3181
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] Technoboy- closed issue #20871: [Bug] When bookie-rack is not configured, pulsar-admin bookies get-bookie-rack -b is throwing 'Bookie address not found' error

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- closed issue #20871: [Bug] When bookie-rack is not configured, pulsar-admin bookies get-bookie-rack -b <correct-bookie-address> is throwing 'Bookie address not found' error
URL: https://github.com/apache/pulsar/issues/20871


-- 
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


[GitHub] [pulsar] sindhushreem 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

Posted by "sindhushreem (via GitHub)" <gi...@apache.org>.
sindhushreem commented on issue #20871:
URL: https://github.com/apache/pulsar/issues/20871#issuecomment-1677074585

   @Technoboy-  can this be cherrypicked to 2.10 branch


-- 
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


[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

Posted by "1Jack2 (via GitHub)" <gi...@apache.org>.
1Jack2 commented on issue #20871:
URL: https://github.com/apache/pulsar/issues/20871#issuecomment-1668258326

   I've changed it according to your instructions. Could you please review #20949 ? @Technoboy- 


-- 
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


[GitHub] [pulsar] Technoboy- 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

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- commented on issue #20871:
URL: https://github.com/apache/pulsar/issues/20871#issuecomment-1667087905

   > > > > 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
   > > > @Technoboy-
   > > 
   > > 
   > > Ah, how about simplifying and changing the promote message more clear ?
   > 
   > could you explain more clearly?
   
   Like fixing the promote message "Bookie rack mapping info not found"


-- 
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


[GitHub] [pulsar] Technoboy- 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

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- commented on issue #20871:
URL: https://github.com/apache/pulsar/issues/20871#issuecomment-1664968674

   > > 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
   > 
   > @Technoboy-
   
   Ah, how about simplifying and changing the promote message more clear ?


-- 
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


[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

Posted by "1Jack2 (via GitHub)" <gi...@apache.org>.
1Jack2 commented on issue #20871:
URL: https://github.com/apache/pulsar/issues/20871#issuecomment-1665064792

   > > > 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
   > > @Technoboy-
   > 
   > Ah, how about simplifying and changing the promote message more clear ?
   
   could you explain more clearly?


-- 
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


[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

Posted by "1Jack2 (via GitHub)" <gi...@apache.org>.
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