sadanand48 commented on PR #6950:
URL: https://github.com/apache/ozone/pull/6950#issuecomment-2242368071

   Thanks @ArafatKhan2198 for the detailed explanation. 
   I tried to reproduce the class cast exception and found another place where 
we could add this check for OMKeyInfo.
   I wrote this in TestOmTableInsightTask
    ``` java
    @Test
     public void testPutFileAndDirWithSameName() throws Exception {
       List<String> paths = Arrays.asList(
           "/a/b/c/dir1",
           "/a/b/c/dir2"
       );
       ArrayList<OMDBUpdateEvent> putEvents = new ArrayList<>();
       for (long i = 0L; i < 2L; i++) {
         putEvents.add(getOMUpdateEvent(paths.get((int) i),
             getOmKeyInfo("vol1", "bucket1", KEY_ONE, (i + 1), true),
             FILE_TABLE, PUT, null));
       }
   
       putEvents.add(getOMUpdateEvent(paths.get(1),
           getOmDirInfo("vol1","bucket1",KEY_ONE,8L,BUCKET_ONE_OBJECT_ID),
           FILE_TABLE,PUT,null));
       OMUpdateEventBatch putEventBatch = new OMUpdateEventBatch(putEvents);
       nSSummaryTaskWithFso.processWithFSO(putEventBatch);
     }
   ```
   I think the root caused is fixed by this issue and this case should not 
happen due to the modified map.  We can perhaps also add this value check in 
NSSummaryTaskFSO too.


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