xyuanlu commented on code in PR #3044: URL: https://github.com/apache/helix/pull/3044#discussion_r2096088382
########## helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java: ########## @@ -948,8 +948,14 @@ public void enableMaintenanceMode(String clusterName, boolean enabled) { public boolean isInMaintenanceMode(String clusterName) { HelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, _baseDataAccessor); PropertyKey.Builder keyBuilder = accessor.keyBuilder(); - return accessor.getBaseDataAccessor() - .exists(keyBuilder.maintenance().getPath(), AccessOption.PERSISTENT); + + MaintenanceSignal signal = accessor.getProperty(keyBuilder.maintenance()); + + if (signal == null) { + return false; + } + + return signal.hasMaintenanceReasons(); Review Comment: This can be dangerous. What if the new version read an old ZNode. -- 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: reviews-unsubscr...@helix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org For additional commands, e-mail: reviews-h...@helix.apache.org