ayushtkn commented on code in PR #3928:
URL: https://github.com/apache/ozone/pull/3928#discussion_r1013709499


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java:
##########
@@ -630,7 +630,8 @@ workingDir, getUsername())
               .collect(Collectors.toList());
 
       if (!tmpStatusList.isEmpty()) {
-        if (startKey.isEmpty()) {
+        if (startKey.isEmpty() || !statuses.getLast().getPath().toString()

Review Comment:
   Sharing what I discussed about this with @devmadhuu to explain the logic & 
reason for choosing this and not fixing in the listStatus root.
   
   In some case like the previous one which I flagged, where we are doing a 
listing on root, in that case when we list volumes, the volume passed as start 
path isn't returned and in other most of the cases the startPath entry is 
returned. So, one fix was to make sure in listVolume also there is an empty or 
null entry if not the first entry(We can't have first entry directly) as the 
first entry and that can be eliminated, but that didn't look very cheesy and I 
feel that can have corner case
   
   Though this fix comes just as part of that listStatusRoot & listVolume 
logic. I felt like the present behaviour `might` lead to missing entries as 
well in case of large directories for a case like:
   Say initially the dir had 0-9 entries & say page size is 3
   Page:1 -> 0, 1, 2 
   Now before page 2 gets fetched 2 gets deleted.
   Page:2: 3.4.5. (Listing ideally won't return 2 though it is in the start 
path because it doesn't exist)
   Now We here were considering that Page 2 first entry was always 2 and 
removing it, but indeed we would have removed 3
   and the final listing would have looked like after Page 2 : 0, 1, 2, 4, 5 (I 
haven't tried it, but that is how I suppose the server side logic should be, it 
won't be returning the deleted entry just because it is in the start path nor 
throwing an exception)
   
   So, I thought checking the last entry before removing should sort this case 
as well....
   
   Can have a consolidated reason as a comment if the logic sounds ok to 
everyone
   



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