xyuanlu commented on code in PR #2106:
URL: https://github.com/apache/helix/pull/2106#discussion_r881944639


##########
helix-core/src/main/java/org/apache/helix/controller/dataproviders/BaseControllerDataProvider.java:
##########
@@ -241,13 +244,87 @@ private void refreshClusterConfig(final HelixDataAccessor 
accessor,
     if 
(_propertyDataChangedMap.get(HelixConstants.ChangeType.CLUSTER_CONFIG).getAndSet(false))
 {
       _clusterConfig = 
accessor.getProperty(accessor.keyBuilder().clusterConfig());
       refreshedType.add(HelixConstants.ChangeType.CLUSTER_CONFIG);
+      // TODO: This is a temp function to clean up incompatible batched 
disabled instances format.
+      // Remove in later version.
+      if (checkBatchedDisabledInstanceFormat(_clusterConfig) && 
updateBatchDisableFormat(
+          accessor)) {
+        // read from zkz one more time
+        LogUtil.logInfo(logger, getClusterEventId(), String
+            .format("Clean ClusterConfig change for cluster %s, pipeline %s", 
_clusterName,
+                getPipelineName()));
+        _clusterConfig = 
accessor.getProperty(accessor.keyBuilder().clusterConfig());

Review Comment:
   In my understanding, whatever in cache should be the same as ZNode or older 
version. If we failed to update ZNode and the format causing pipeline fail, 
then the pipeline fail and we try again.  
   Assume to begin with, ZNode is on version X has unsanitized format, we try 
to update to version X+1 and failed. The cache should not keep X+1 data since 
it is never written to ZNode.
   If we have succeeded to update ZNode with new data on version X+1, it is 
acceptable for cache to have version X or X+1. (and I prefer to have new 
version to avoid pipeline failure)
   
   I am open to discussion. 



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


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

Reply via email to