jt2594838 commented on code in PR #12476:
URL: https://github.com/apache/iotdb/pull/12476#discussion_r1636200265


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/io/WALInputStream.java:
##########
@@ -250,10 +250,14 @@ public void skipToGivenPosition(long pos) throws 
IOException {
         buffer.clear();
         channel.read(buffer);
         buffer.flip();
-        buffer.get();
+        CompressionType type = CompressionType.deserialize(buffer.get());
         currSegmentSize = buffer.getInt();
         if (posRemain >= currSegmentSize) {
           posRemain -= currSegmentSize;
+          channel.position(
+              channel.position()
+                  + currSegmentSize
+                  + (type == CompressionType.UNCOMPRESSED ? 0 : 
Integer.BYTES));

Review Comment:
   This should be clarified by comments or better variable names; try it.



-- 
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: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to