Nicklee007 opened a new pull request, #19260: URL: https://github.com/apache/pulsar/pull/19260
### Motivation Some pulsar client concurrent lookup request may get different broker for assignment when we set bundle affinity broker and unload the bundle. The `loadManager.setNamespaceBundleAffinity` only can make sure return the correct bundle affinity broker to the first be handled request, and other request will invoke `selectBrokerForAssignment` to choice another broker as candidate broker for the bundle. In the concurrent time, we can not always make sure the first look up client which get the correct bundle affinity broker can completed the redirect look up request, which will cause the bundle unload to affinity broker as our exception. https://github.com/apache/pulsar/blob/299bd70fdfa023768e94a8ee4347d39337b6cbd4/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerWrapper.java#L68-L76 So, we should set the affinity broker to `preallocatedBundleToBroker` to permit the look up request can get the same broker on the time. ### Modifications 1. Set the bundle affinity broker to `preallocatedBundleToBroker`; 2. add some unit test; ### Documentation - [X] `doc-not-needed` <!-- Your PR changes do not impact docs --> ### Matching PR in forked repository PR in forked repository: https://github.com/Nicklee007/pulsar/pull/8 -- 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]
