lifepuzzlefun commented on code in PR #20970:
URL: https://github.com/apache/pulsar/pull/20970#discussion_r1290889402
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImpl.java:
##########
@@ -834,13 +845,30 @@ private void updateBundleSplitMetrics(int bundlesSplit) {
/**
* As the leader broker, find a suitable broker for the assignment of the
given bundle.
+ * If leader broker is inactive, decision will be made by the current
broker.
*
* @param serviceUnit
* ServiceUnitId for the bundle.
* @return The name of the selected broker, as it appears on metadata
store.
*/
@Override
public Optional<String> selectBrokerForAssignment(final ServiceUnitId
serviceUnit) {
+ if (oldFlag) {
+ log.info("LoadData is old, need to update loadData before make
decision");
+ updateAll();
Review Comment:
does this method protected by locks or oldFlag is less update to true ? I
think this change may cause lookup process time much longer, and we need to
ensure only one concurrent updateAll() call
--
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]