elek commented on pull request #2151:
URL: https://github.com/apache/ozone/pull/2151#issuecomment-822340863


   > Simple answer is, during cluster startup the validation logic will check 
all the existing buckets, if any and then will fail the OM startup if there are 
any older buckets[simple layout].
   
   Fix me if I am wrong, but the current check doesn't handle case when 
bucketMetadata is empty (old data). For example if I set layout prefix to 
`simple` explicitly (because I have old data) the cluster will be failed even 
if it's a valid scenario. 
   
   ```
   +  public static boolean isFSOptimizedBucket(
   +      Map<String, String> bucketMetadata) {
   +    // layout 'PREFIX' represents optimized FS path
   +    boolean metadataLayoutEnabled =
   +        org.apache.commons.lang3.StringUtils.equalsIgnoreCase(
   +            OMConfigKeys.OZONE_OM_METADATA_LAYOUT_PREFIX,
   +            bucketMetadata
   +                .get(OMConfigKeys.OZONE_OM_METADATA_LAYOUT));
   +
   +    boolean fsEnabled =
   +        Boolean.parseBoolean(bucketMetadata
   +            .get(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS));
   +
   +    return metadataLayoutEnabled && fsEnabled;
   +  }
   ```
   
   > Please refer isFSOptimizedBucket logic. Here it checks both the properties 
and FSO requires both to be set(ozone.om.metadata.layout=PREFIX and 
ozone.om.enable.filesystem.paths=true).
   
   Thanks, will check it. For your information: during my test I was able to 
create buckets with `layout=PREFIX` and `paths=false`. Will try to reproduce 
the problem.


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to