cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ZhongYu (JIRA)" <>
Subject [jira] [Created] (CASSANDRA-7664) IndexOutOfBoundsException thrown during repair
Date Fri, 01 Aug 2014 08:02:38 GMT
ZhongYu created CASSANDRA-7664:

             Summary: IndexOutOfBoundsException thrown during repair
                 Key: CASSANDRA-7664
             Project: Cassandra
          Issue Type: Bug
          Components: Core
         Environment: RHEL 6.1
Casandra 1.2.18
            Reporter: ZhongYu

I was running repair command with moderate read and write load at the same time. And I found
tens of IndexOutOfBoundsException in system log as follows:
ERROR [Thread-6056] 2013-05-22 14:47:59,416 (line132) Exception in thread
        at org.apache.cassandra.streaming.compress.CompressedInputStream$Reader.runMayThrow(

I read the source code of and found there surely will throw IndexOutOfBoundsException
in the following situation:

// Part of start from Line 139
       protected void runMayThrow() throws Exception
            byte[] compressedWithCRC;
            while (chunks.hasNext())
                CompressionMetadata.Chunk chunk =;

                int readLength = chunk.length + 4; // read with CRC
                compressedWithCRC = new byte[readLength];

                int bufferRead = 0;
                while (bufferRead < readLength)
                    bufferRead +=, bufferRead, readLength -
If read function read nothing because the end of the stream has been reached, it will return
-1, thus bufferRead can be negetive. In the next turn read function will throw IndexOutOfBoundsException
because bufferRead is negetive. 

This message was sent by Atlassian JIRA

View raw message