gaozhangmin commented on a change in pull request #12957:
URL: https://github.com/apache/pulsar/pull/12957#discussion_r763722847
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundleFactory.java
##########
@@ -212,16 +212,18 @@ public NamespaceBundle
getBundleWithHighestThroughput(NamespaceName nsName) {
if (loadManager instanceof ModularLoadManagerWrapper) {
NamespaceBundles bundles = getBundles(nsName);
double maxMsgThroughput = -1;
- NamespaceBundle bundleWithHighestThroughpit = null;
+ NamespaceBundle bundleWithHighestThroughput = null;
for (NamespaceBundle bundle : bundles.getBundles()) {
- BundleData budnleData = ((ModularLoadManagerWrapper)
loadManager).getLoadManager()
- .getBundleDataOrDefault(bundle.getBundleRange());
- if (budnleData.getLongTermData().totalMsgThroughput() >
maxMsgThroughput) {
- maxMsgThroughput =
budnleData.getLongTermData().totalMsgThroughput();
- bundleWithHighestThroughpit = bundle;
+ BundleData bundleData = ((ModularLoadManagerWrapper)
loadManager).getLoadManager()
+
.getBundleDataOrDefault(NamespaceBundle.getKey(bundle.getNamespaceObject(),
+ bundle.getKeyRange()));
+ if (bundleData.getTopics() > 0
Review comment:
there are two situation that getBundleWithHighestThroughput would return
a bundle which is owned by none of broker.
1、no topics existed in namespace.
2、msgThroughput of topics is smaller than default value 50000.
--
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]