ArafatKhan2198 commented on PR #6492:
URL: https://github.com/apache/ozone/pull/6492#issuecomment-2083407606

   > @ArafatKhan2198 backward compatibility is still not resolved, please check 
comments reply
   
   
   Thanks for the find @sumitagrawl 
   You are right if we try to read beyond the available data in the 
`DataInputStream`, it will indeed throw an `EOFException`
   ### Key Changes Made:
   1. **Availability Check**: Added if (in.available() >= Long.BYTES) to ensure 
there is enough data left in the stream before attempting to read the parentId. 
This prevents an EOFException for data streams that are from an older format 
and do not contain the parentId field.
   2. **Default Parent ID**: If the data for parentId is not available, the 
code sets the parentId to -1 to indicate that the data is from an older format 
or the parentId was not set.
   
   


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