jt2594838 commented on code in PR #12476:
URL: https://github.com/apache/iotdb/pull/12476#discussion_r1625229114
##########
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:
You may skip with the channel by `currSegmentSize + Integer.BYTES` if the
WAL is compressed, but `posRemain` is only reduced by `currSegmentSize`.
Is this inconsistency problematic?
--
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]