jrwest commented on code in PR #3606:
URL: https://github.com/apache/cassandra/pull/3606#discussion_r1850635314


##########
src/java/org/apache/cassandra/io/util/CompressedChunkReader.java:
##########
@@ -117,8 +141,23 @@ public void readChunk(long position, ByteBuffer 
uncompressed)
                 {
                     ByteBuffer compressed = bufferHolder.getBuffer(length);
 
-                    if (channel.read(compressed, chunk.offset) != length)
-                        throw new CorruptBlockException(channel.filePath(), 
chunk);
+                    if (readAheadBuffer != null && readAheadBuffer.hasBuffer())
+                    {
+                        int copied = 0;
+                        while (copied < length) {

Review Comment:
   Ya unfortunately whether people use it, which would be surprising, we allow 
it so we have to handle it. I do like having it be a size. I also like ensuring 
it’s not smaller than some value. And I think I agree if the buffer size is < 
chunk size just don’t take the new code path (as chunk size will be sufficient 
anyways since it’s so large in that case). Only open question then is do we 
want to log when it happens? And do we log when the table metadata is changed 
or when the scanner is created (I lean towards the former)? 



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