rakeshadr commented on code in PR #3411:
URL: https://github.com/apache/ozone/pull/3411#discussion_r878096086
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerRequestHandler.java:
##########
@@ -796,6 +984,52 @@ public static OMResponse
disallowListStatusResponseWithECReplicationConfig(
return resp;
}
+ @RequestFeatureValidator(
+ conditions = ValidationCondition.OLDER_CLIENT_REQUESTS,
+ processingPhase = RequestProcessingPhase.POST_PROCESS,
+ requestType = Type.ListStatus
+ )
+ public static OMResponse disallowListStatusResponseWithBucketLayout(
+ OMRequest req, OMResponse resp, ValidationContext ctx)
+ throws ServiceException, IOException {
+ if (!resp.hasListStatusResponse()) {
+ return resp;
+ }
+
+ // Add the volume and bucket pairs to a set to avoid duplicate entries.
+ List<OzoneFileStatusProto> statuses =
+ resp.getListStatusResponse().getStatusesList();
+ HashSet<Pair<String, String>> volumeBucketSet = new HashSet<>();
+
+ for (OzoneFileStatusProto status : statuses) {
+ KeyInfo keyInfo = status.getKeyInfo();
+ if (keyInfo.hasVolumeName() && keyInfo.hasBucketName()) {
+ volumeBucketSet.add(
+ new ImmutablePair<>(keyInfo.getVolumeName(),
+ keyInfo.getBucketName()));
+ }
+ }
+
+ // If any of the keys are present in a bucket with a non LEGACY bucket
+ // layout, then the client needs to be upgraded before proceeding.
+ for (Pair<String, String> volumeBucket : volumeBucketSet) {
+ if (!ctx.getBucketLayout(volumeBucket.getLeft(),
+ volumeBucket.getRight()).isLegacy()) {
+ resp = resp.toBuilder()
+ .setStatus(Status.NOT_SUPPORTED_OPERATION)
+ .setMessage("The list of keys contains keys with Erasure Coded"
Review Comment:
Typo: It says EC. Please modify the message to reflect the bucket layout
feature.
--
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]