ArafatKhan2198 commented on code in PR #12169:
URL: https://github.com/apache/ozone/pull/12169#discussion_r4750258706
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/diskUsage/diskUsage.tsx:
##########
@@ -268,7 +268,9 @@ export class DiskUsage extends
React.Component<Record<string, object>, IDUState>
return;
}
- const path = (curPath === '/') ? `${curPath}${subPath}` :
`${curPath}/${subPath}`;
+ const duResponse = this.state.duResponse as unknown as IDUResponse;
+ const path = duResponse.subPaths?.[e.dataIndex]?.path
Review Comment:
Now that we are using the complete key path for navigation, have we checked
the back button for OBS keys containing slashes? For a key in an OBS bucket,
goBack() would remove only the last segment instead of returning to the bucket.
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/OBSBucketHandler.java:
##########
@@ -133,7 +133,7 @@ public long handleDirectKeys(long parentId, boolean
withReplica,
if (keyInfo != null) {
DUResponse.DiskUsage diskUsage = new DUResponse.DiskUsage();
String objectName = keyInfo.getKeyName();
- diskUsage.setSubpath(objectName);
+ diskUsage.setSubpath(buildSubpath(normalizedPath, objectName));
Review Comment:
This API is also consumed by `DiskUsageSubCommand`, where we apply the
prefix filter directly on the returned subpath. Since we are changing the OBS
response from a key name to a full path, could this break the existing CLI
prefix filtering? Can we verify this behaviour as well?
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/diskUsage/diskUsage.tsx:
##########
@@ -268,7 +268,9 @@ export class DiskUsage extends
React.Component<Record<string, object>, IDUState>
return;
}
- const path = (curPath === '/') ? `${curPath}${subPath}` :
`${curPath}/${subPath}`;
+ const duResponse = this.state.duResponse as unknown as IDUResponse;
+ const path = duResponse.subPaths?.[e.dataIndex]?.path
+ ?? ((curPath === '/') ? `${curPath}${subPath}` :
`${curPath}/${subPath}`);
Review Comment:
The fallback still uses the old path construction logic that caused the
original problem.
Can we store the actual subpath directly in the pie chart data instead of
looking it up through dataIndex? This would also allow us to remove the
fallback path construction that caused the original issue.
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/OBSBucketHandler.java:
##########
@@ -133,7 +133,7 @@ public long handleDirectKeys(long parentId, boolean
withReplica,
if (keyInfo != null) {
DUResponse.DiskUsage diskUsage = new DUResponse.DiskUsage();
String objectName = keyInfo.getKeyName();
- diskUsage.setSubpath(objectName);
+ diskUsage.setSubpath(buildSubpath(normalizedPath, objectName));
Review Comment:
The existing `assertFlatBucketDiskUsage`() test checks the count and size
but does not validate the returned subpaths.
We could extend this test to verify that the returned paths preserve the
exact key names and can be used to retrieve the corresponding key's disk usage.
Can we add an automated regression test for this?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]