You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/03/14 14:56:24 UTC

[GitHub] [pulsar] Technoboy- opened a new pull request #14680: Set splitNamespaceBundle with `readonly=false`.

Technoboy- opened a new pull request #14680:
URL: https://github.com/apache/pulsar/pull/14680


   Master Issue: #14668
   
   ### Motivation
   
   When we split a not loaded namespace bundle, we will meet the below error:
   ```
   Failed to find ownership for ServiceUnit:tenant/namespace/0x00000000_0x10000000
   ```
   Because when validating namespace bundle ownership with `readonly=true` :
   https://github.com/apache/pulsar/blob/fe7e55d9f353925a559e88f8ceef2b47b59668e0/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java#L1145-L1151
   
   and if the bundle is not owned by any broker, it will return empty(line-392):
   https://github.com/apache/pulsar/blob/fe7e55d9f353925a559e88f8ceef2b47b59668e0/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java#L388-L400
   
   so throw the below exception :
   https://github.com/apache/pulsar/blob/fe7e55d9f353925a559e88f8ceef2b47b59668e0/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java#L576-L582
   
   ### Modification
   
   - Change readonly from `true` to `false` when validating namespace bundle ownership.
   
   ### Documentation
     
   - [x] `no-need-doc` 
   
   
   
   


-- 
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] BewareMyPower commented on pull request #14680: Set splitNamespaceBundle with `readonly=false`.

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on pull request #14680:
URL: https://github.com/apache/pulsar/pull/14680#issuecomment-1067620420


   As the difference I said in #14668, I'm still curious why standalone works while cluster doesn't work. See the following screenshot, even if `readOnly` is true, the `webUrl` is still retrieved successfully.
   
   <img width="1097" alt="image" src="https://user-images.githubusercontent.com/18204803/158320944-6c4deda1-dbb0-48e6-98b1-5019f30708c4.png">
   
   


-- 
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] BewareMyPower commented on pull request #14680: Set splitNamespaceBundle with `readonly=false`.

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on pull request #14680:
URL: https://github.com/apache/pulsar/pull/14680#issuecomment-1067622933


   I deleted my reply at this moment. I'll dig deeper into this 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



[GitHub] [pulsar] BewareMyPower commented on pull request #14680: Set splitNamespaceBundle with `readonly=false`.

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on pull request #14680:
URL: https://github.com/apache/pulsar/pull/14680#issuecomment-1067631468


   I think the difference is that when I ran a standalone, each bundle was owned by the broker because I've sent some messages to some partitions. See the original code snippet:
   
   ```java
               try (PulsarClient client = PulsarClient.builder().serviceUrl("pulsar://localhost:6650").build()) {
                   for (int i = 0; i < numPartitions; i++) {
                       client.newProducer().topic(topic + TopicName.PARTITIONED_TOPIC_SUFFIX + i)
                               .create().send("1".getBytes());
                   }
               }
   ```
   
   When I debugged in a standalone, i.e. the `nsData` returned by `ownershipCache.getOwnerAsync(bundle)` is not empty.
   
   <img width="925" alt="image" src="https://user-images.githubusercontent.com/18204803/158322936-b20233c4-b3ee-4eae-b2c6-0c22f8d68237.png">
   
   There is another weird thing I've described in #14668. I'm not sure if it's related.
   
   > The standard output is also weird:
   >
   > [0x00000000, 0x10000000, 0x20000000, 0x30000000, 0x40000000, 0x50000000, 0x60000000, 0x70000000, 0x80000000, 0x90000000, 0xa0000000, 0xb0000000, 0xc0000000, 0xd0000000, 0xe0000000, 0xf0000000, 0xffffffff]
   The defaultNumberOfNamespaceBundles is 4, but the initial number of bundles is 16.
   
   Maybe some bundles were not owned by the broker. I'll try to split all bundle ranges to see if there is any bundle range that can be split.


-- 
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] BewareMyPower removed a comment on pull request #14680: Set splitNamespaceBundle with `readonly=false`.

Posted by GitBox <gi...@apache.org>.
BewareMyPower removed a comment on pull request #14680:
URL: https://github.com/apache/pulsar/pull/14680#issuecomment-1067620420


   As the difference I said in #14668, I'm still curious why standalone works while cluster doesn't work. See the following screenshot, even if `readOnly` is true, the `webUrl` is still retrieved successfully.
   
   <img width="1097" alt="image" src="https://user-images.githubusercontent.com/18204803/158320944-6c4deda1-dbb0-48e6-98b1-5019f30708c4.png">
   
   


-- 
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] BewareMyPower merged pull request #14680: Set splitNamespaceBundle with `readonly=false`.

Posted by GitBox <gi...@apache.org>.
BewareMyPower merged pull request #14680:
URL: https://github.com/apache/pulsar/pull/14680


   


-- 
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 pull request #14680: Set splitNamespaceBundle with `readonly=false`.

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on pull request #14680:
URL: https://github.com/apache/pulsar/pull/14680#issuecomment-1067621852


   > As the difference I said in #14668, I'm still curious why standalone works while cluster doesn't work. See the following screenshot, even if `readOnly` is true, the `webUrl` is still retrieved successfully.
   > 
   > <img alt="image" width="1097" src="https://user-images.githubusercontent.com/18204803/158320944-6c4deda1-dbb0-48e6-98b1-5019f30708c4.png">
   
   This is not for cluster only, standalone is also not work. My test could reproduce.


-- 
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] BewareMyPower commented on pull request #14680: Set splitNamespaceBundle with `readonly=false`.

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on pull request #14680:
URL: https://github.com/apache/pulsar/pull/14680#issuecomment-1067659360


   It works now. 
   
   When I ran a standalone, there were 4 bundle ranges. However, when I ran a cluster, there were 16 bundle ranges and some bundle ranges were not owned.
   
   I think we need another issue to track the issue that `defaultNumberOfNamespaceBundles` doesn't work for cluster mode.
   


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