[
https://issues.apache.org/jira/browse/HDFS-15810?focusedWorklogId=591949&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-591949
]
ASF GitHub Bot logged work on HDFS-15810:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 02/May/21 01:13
Start Date: 02/May/21 01:13
Worklog Time Spent: 10m
Work Description: aajisaka commented on a change in pull request #2910:
URL: https://github.com/apache/hadoop/pull/2910#discussion_r624590984
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/metrics/TestRBFMetrics.java
##########
@@ -348,4 +352,34 @@ private void validateClusterStatsRouterBean(RouterMBean
bean) {
assertTrue(bean.getHostAndPort().length() > 0);
assertFalse(bean.isSecurityEnabled());
}
+
+ private void testCapacity(FederationMBean bean) throws IOException {
+ List<MembershipState> memberships = getActiveMemberships();
+ assertTrue(memberships.size() > 1);
+
+ BigInteger availableCapacity = BigInteger.valueOf(0);
+ BigInteger totalCapacity = BigInteger.valueOf(0);
+ BigInteger unitCapacity = BigInteger.valueOf(Long.MAX_VALUE);
+ for (MembershipState mock : memberships) {
+ MembershipStats stats = mock.getStats();
+ stats.setTotalSpace(Long.MAX_VALUE);
+ stats.setAvailableSpace(Long.MAX_VALUE);
+ // reset stats to make the new value persistent
+ mock.setStats(stats);
+ // write back the new namenode information to state store
+ assertTrue(refreshNamenodeRegistration(
+ NamenodeHeartbeatRequest.newInstance(mock)));
+ totalCapacity = totalCapacity.add(unitCapacity);
+ availableCapacity = availableCapacity.add(unitCapacity);
+ }
+
+ // for local cache update
+ assertEquals(bean.getTotalCapacityBigInt(), totalCapacity);
+ // not equal since overflow happened.
+ assertNotEquals(BigInteger.valueOf(bean.getTotalCapacity()),
totalCapacity);
+ assertEquals(bean.getRemainingCapacityBigInt(), availableCapacity);
+ // not equal since overflow happened.
+ assertNotEquals(
+ BigInteger.valueOf(bean.getRemainingCapacity()), availableCapacity);
Review comment:
The order of the arguments is "expected, actual". Would you reverse the
order? I'm +1 if that is addressed.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 591949)
Time Spent: 3.5h (was: 3h 20m)
> RBF: RBFMetrics's TotalCapacity out of bounds
> ---------------------------------------------
>
> Key: HDFS-15810
> URL: https://issues.apache.org/jira/browse/HDFS-15810
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: Xiaoxing Wei
> Assignee: Fengnan Li
> Priority: Major
> Labels: pull-request-available
> Attachments: Screen Shot 2021-04-26 at 5.25.12 PM.png,
> image-2021-02-02-10-59-17-113.png
>
> Time Spent: 3.5h
> Remaining Estimate: 0h
>
> The Long type fields TotalCapacity,UsedCapacity and RemainingCapacity in
> RBFMetrics maybe ** out of bounds.
> !image-2021-02-02-10-59-17-113.png!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]