NealSun96 commented on a change in pull request #1415:
URL: https://github.com/apache/helix/pull/1415#discussion_r504125298



##########
File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixDataAccessor.java
##########
@@ -143,6 +147,7 @@ public boolean createMaintenance(MaintenanceSignal 
maintenanceSignal) {
     case EXTERNALVIEW:
       // check if bucketized
       if (value.getBucketSize() > 0) {
+        validateBucketizedEnabled(path, false /*isRead*/);

Review comment:
       I agree with @pkuwm that this may not be scalable and adding it to 
baseDataAccessor. Future developers might not be aware of this function and 
nothing enforces them to add it, then there could be unprotected bucketized 
read/write.

##########
File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixDataAccessor.java
##########
@@ -600,4 +611,13 @@ private int constructOptions(PropertyType type) {
       List<DataUpdater<ZNRecord>> updaters, int options) {
     return _baseDataAccessor.updateChildren(paths, updaters, options);
   }
+
+  private void validateBucketizedEnabled(String path, boolean isRead) {
+    if (!ZNRECORD_BUCKETIZE_ENABLED) {
+      throw new HelixMetaDataAccessException(
+          "Can't " + (isRead ? "read" : "write") + " bucktized ZNode " + path
+              + " because Bucktize feature is not enabled. Please check ZK 
system property: "

Review comment:
       *Bucketized (2 occasions here) 




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



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

Reply via email to