maoling commented on a change in pull request #934: ZOOKEEPER-3301:Enforce the 
quota limit
URL: https://github.com/apache/zookeeper/pull/934#discussion_r383629785
 
 

 ##########
 File path: 
zookeeper-server/src/main/java/org/apache/zookeeper/server/PrepRequestProcessor.java
 ##########
 @@ -424,8 +516,25 @@ protected void pRequest2Txn(int type, long zxid, Request 
request,
                 validatePath(path, request.sessionId);
                 nodeRecord = getRecordForPath(path);
                 checkACL(zks, request.cnxn, nodeRecord.acl, 
ZooDefs.Perms.WRITE, request.authInfo, path, null);
+
+                // first do a quota check if the path is in a quota subtree.
+                ZKDatabase zkDatabase = zks.getZKDatabase();
+                byte[] lastdata;
+                DataNode n = zkDatabase.getNode(path);
+                byte[] data = setDataRequest.getData();
+                if (n != null) {
+                    String lastPrefix = 
zkDatabase.getDataTree().getMaxPrefixWithQuota(path);
 
 Review comment:
   > if there any way to not run this code if enforceQuota is not enabled ?
   
   if enforceQuota is not enabled, this code will not been run. But if enabled, 
that's inevitable
   
   
   
   

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

Reply via email to