bharatviswa504 commented on pull request #2703:
URL: https://github.com/apache/ozone/pull/2703#issuecomment-933806827


   > In commitKey OmRequest, a key is first written to the keyTableCache and 
then to the keyTable when the double buffer is flushed.
   > 
   > If OZONE_OM_ENABLE_FILESYSTEM_PATHS is enabled, and the key has a 
superdirectory, thesuperdirectory's are added to cache during the openKey 
OmRequest
   > 
   > If OZONE_OM_ENABLE_FILESYSTEM_PATHS is not enabled, the superdirectories 
are not added in the openkey request. In addition, the cache search method in 
listStatus() is written to skip any keys with an embedded "/" here
   > 
   > So, if OZONE_OM_ENABLE_FILESYSTEM_PATHS is disabled, and a key with an 
embedded "/" is commited, and it is still in the cache, listStatus() won't see 
it or it's superdirectory.
   > 
   
   I think if filesystem path is disabled, then it is Object store kind of 
bucket. On ObjectStore kind of buckets, we donot need to support FS API's like 
listStatus. And from reading code I think to skip after Stripping "/" at end is 
as recursive false, We donot need to print 2 level deeper child. As the issue 
here is for OBS, we donot create intermediate dirs that is the reason this 
logic of search with the below code is failing to find in cache (As in cache we 
donot find any intermediate dirs). If we want to fix this for OBS buckets, we 
should have similar logic getChild like 
here(https://github.com/apache/ozone/blob/master/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java#L2411)
   
   Or another way to fix the test is listKeys. Which is an Object Store API.
   
   
   ```
               String remainingKey = StringUtils.stripEnd(cacheKey.substring(
                   startCacheKey.length()), OZONE_URI_DELIMITER);
               // For non-recursive, the remaining part of key can't have '/'
               if (remainingKey.contains(OZONE_URI_DELIMITER)) {
                 continue;
   ```
   
   cc @rakeshadr @smengcl for any comments.
   


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

Reply via email to