heesung-sn commented on code in PR #21866:
URL: https://github.com/apache/pulsar/pull/21866#discussion_r1446512404


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -2689,6 +2689,15 @@ The delayed message index time step(in seconds) in per 
bucket snapshot segment,
     )
     private long loadBalancerServiceUnitStateMonitorIntervalInSeconds = 60;
 
+    @FieldContext(
+            category = CATEGORY_LOAD_BALANCER,
+            dynamic = true,
+            doc = "Enables the fast unloading of bundles. Set to true, 
forwards destination broker information to "
+                    + "consumers and producers during bundle unload, allowing 
them to quickly reconnect to the broker "
+                    + "without performing an additional topic lookup."
+    )
+    private boolean loadBalancerOptimizeBundleUnload = true;

Review Comment:
   nit: could we make this config name more elaborative? "Optimize" sounds a 
little too ambiguous.  
   I think we can rename it to one of the following.
   
   1. loadBalancerMultiPhasePhaseBundleUnload
   2. loadBalancerDelayClientDisconnectionDuringBundleUnload



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:
##########
@@ -804,7 +804,9 @@ private void handleReleaseEvent(String serviceUnit, 
ServiceUnitStateData data) {
             if (isTransferCommand(data)) {
                 next = new ServiceUnitStateData(
                         Assigning, data.dstBroker(), data.sourceBroker(), 
getNextVersionId(data));
-                unloadFuture = closeServiceUnit(serviceUnit, false);
+                // If the optimized bundle unload is disabled, disconnect the 
clients at time of RELEASE.
+                var disconnectClients = 
!pulsar.getConfig().isLoadBalancerOptimizeBundleUnload();

Review Comment:
   Don't we need to skip `closeServiceUnit ` at `handleOwnEvent` when 
isLoadBalancerOptimizeBundleUnload = false?



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

Reply via email to