You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/06/04 09:42:43 UTC

[GitHub] [ozone] adoroszlai commented on a change in pull request #2303: HDDS-5283. getStorageSize cast to int can cause issue

adoroszlai commented on a change in pull request #2303:
URL: https://github.com/apache/ozone/pull/2303#discussion_r645438265



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java
##########
@@ -164,13 +164,13 @@ public ContainerStateMachine(RaftGroupId gid, ContainerDispatcher dispatcher,
     int numPendingRequests = conf
         .getObject(DatanodeRatisServerConfig.class)
         .getLeaderNumPendingRequests();
-    int pendingRequestsByteLimit = (int) conf.getStorageSize(
+    int pendingRequestsMegaBytesLimit = (int) conf.getStorageSize(
         OzoneConfigKeys.DFS_CONTAINER_RATIS_LEADER_PENDING_BYTES_LIMIT,
         OzoneConfigKeys.DFS_CONTAINER_RATIS_LEADER_PENDING_BYTES_LIMIT_DEFAULT,
-        StorageUnit.BYTES);
+        StorageUnit.MB);
     stateMachineDataCache = new ResourceLimitCache<>(new ConcurrentHashMap<>(),
         (index, data) -> new int[] {1, data.size()}, numPendingRequests,

Review comment:
       @sadanand48 I think acceptance test failure is caused by this change.  1KB keys can be created, but anything beyond that fails.
   
   Limit is in megabytes, `data.size()` needs to be converted.
   
   ```suggestion
           (i, data) -> new int[] {1, (int) StorageUnit.MB.fromBytes(data.size())},
           numPendingRequests,
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org