massakam opened a new pull request #2348: Fix NPE when splitting and unloading 
bundle
URL: https://github.com/apache/incubator-pulsar/pull/2348
 
 
   ### Motivation
   
   In v1.22.1 or later, NPE often occurs when a bundle is splitted and unloaded.
   https://gist.github.com/massakam/39b10ab273771924e8ccc458fa83b7e0
   
   NPE occurs in the following line. It means that the bundle is not included 
in `ownershipCache`.
   
https://github.com/apache/incubator-pulsar/blob/e548aa28505c3e0d40944751c85fbc9360cfcb7d/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java#L506
   
   I think that what we should pass to `updateFuture` is not the left element 
of `splittedBundles` but the right one.
   
https://github.com/apache/incubator-pulsar/blob/e548aa28505c3e0d40944751c85fbc9360cfcb7d/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java#L625
   
   The left element seems to be all bundles under the namespace. Some of them 
are not owned by the broker and not included in `ownershipCache`.
   
   cf. https://github.com/apache/incubator-pulsar/pull/1428
   
   ### Modifications
   
   Fixed `NamespaceService` to pass the left element of `splittedBundles` (list 
of bundles owened by the broker) to `updateFuture`.
   
   ### Result
   
   NPE will no longer occur and the splitted bundle will be unloaded properly.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to