alexeykudinkin commented on a change in pull request #4015:
URL: https://github.com/apache/hudi/pull/4015#discussion_r770865659



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFileReader.java
##########
@@ -291,7 +292,7 @@ private boolean isBlockCorrupt(int blocksize) throws 
IOException {
       // This seek is required because contract of seek() is different for 
naked DFSInputStream vs BufferedFSInputStream
       // release-3.1.0-RC1/DFSInputStream.java#L1455
       // release-3.1.0-RC1/BufferedFSInputStream.java#L73
-      inputStream.seek(currentPos);
+      inputStream.seek(blockStartPos);

Review comment:
       A few things here: 
   
   1. `isBlockCorrupt` (should be `Corrupted` actually) is method that checks 
the state of the stream, and as such should not have any side-effects not 
expected from it -- it should not rewind stream to any other position other 
than it was when this method have been invoked. If we want to rewind the stream 
to some other position we should do this outside of this method -- we can do 
that right where this method is invoked.
   
   2. I read through the ticket, and i think i've got the hold of the issue 
you're facing but i don't think i understand your solution. Can you please add 
comments to the code to explain the semantic you're trying to set here? 




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


Reply via email to