315157973 commented on a change in pull request #12025:
URL: https://github.com/apache/pulsar/pull/12025#discussion_r715559815



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
##########
@@ -1336,22 +1339,54 @@ public void openLedgerFailed(ManagedLedgerException 
exception, Object ctx) {
                         );
                     }
 
-
                     ManagedLedgerConfig managedLedgerConfig = new 
ManagedLedgerConfig();
                     
managedLedgerConfig.setEnsembleSize(persistencePolicies.getBookkeeperEnsemble());
                     
managedLedgerConfig.setWriteQuorumSize(persistencePolicies.getBookkeeperWriteQuorum());
                     
managedLedgerConfig.setAckQuorumSize(persistencePolicies.getBookkeeperAckQuorum());
-                    if (localPolicies.isPresent() && 
localPolicies.get().bookieAffinityGroup != null) {
-                        managedLedgerConfig
-                                .setBookKeeperEnsemblePlacementPolicyClassName(
-                                        
ZkIsolatedBookieEnsemblePlacementPolicy.class);
-                        Map<String, Object> properties = Maps.newHashMap();
-                        
properties.put(ZkIsolatedBookieEnsemblePlacementPolicy.ISOLATION_BOOKIE_GROUPS,
-                                
localPolicies.get().bookieAffinityGroup.getBookkeeperAffinityGroupPrimary());
-                        
properties.put(ZkIsolatedBookieEnsemblePlacementPolicy.SECONDARY_ISOLATION_BOOKIE_GROUPS,
-                                
localPolicies.get().bookieAffinityGroup.getBookkeeperAffinityGroupSecondary());
-                        
managedLedgerConfig.setBookKeeperEnsemblePlacementPolicyProperties(properties);
-                    }
+                    
this.pulsar.getLocalMetadataStore().get(ZkBookieRackAffinityMapping.BOOKIE_INFO_ROOT_PATH)

Review comment:
       The current affinity is soft affinity. If it is directly changed to 
forced affinity, the upgrade will have compatibility issues, which may cause 
`not enough bookies` . If there is a need for forced affinity, I think at least 
one switch needs to be added




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