jackjlli commented on a change in pull request #4662: Add wait for condition 
for toggle test
URL: https://github.com/apache/incubator-pinot/pull/4662#discussion_r330389063
 
 

 ##########
 File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
 ##########
 @@ -268,44 +268,42 @@ private void addInstanceGroupTagIfNeeded() {
    */
 
   /**
-   * Get all instance Ids.
-   *
+   * Get all instance Ids. If it's related to segment operation like assigning 
segments to instances, cache accessor would be used.
+   * Otherwise, direct data accessor would be used.
+   * @param segmentRelatedOperation whether it's related to segment operation
    * @return List of instance Ids
    */
   @Nonnull
-  public List<String> getAllInstances() {
-    return _cacheInstanceConfigsDataAccessor.getChildNames("/", 
AccessOption.PERSISTENT);
+  public List<String> getAllInstances(boolean segmentRelatedOperation) {
+    if (segmentRelatedOperation) {
+      return _cacheInstanceConfigsDataAccessor.getChildNames("/", 
AccessOption.PERSISTENT);
+    } else {
+      return _helixAdmin.getInstancesInCluster(_helixClusterName);
+    }
   }
 
   /**
    * Returns the config for all the Helix instances in the cluster.
+   * All the callers are not for segment assignment. No need to use cached 
accessor.
    */
   public List<InstanceConfig> getAllHelixInstanceConfigs() {
 
 Review comment:
   This method is called by `assignInstance` method, which is where we 
add/update table config.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to