cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yang Yang (Issue Comment Edited) (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (CASSANDRA-3390) ReadResponseSerializer.serializedSize() calculation is wrong
Date Sun, 23 Oct 2011 07:11:32 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-3390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13133584#comment-13133584
] 

Yang Yang edited comment on CASSANDRA-3390 at 10/23/11 7:10 AM:
----------------------------------------------------------------

Jonathan: I see what you mean:

the returned CF from cachedRow, in CFS.java:1169 :



    /**
     *  Filter a cached row, which will not be modified by the filter, but may be modified
by throwing out
     *  tombstones that are no longer relevant.
     *  The returned column family won't be thread safe.
     */
    ColumnFamily filterColumnFamily(ColumnFamily cached, QueryFilter filter, int gcBefore)
    {


in ColumnSerializer.java:serialize()--->ByteBufferUtils.write() 
            out.write(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining());



                
      was (Author: yangyangyyy):
    Jonathan: I see what you mean:

the returned CF from cachedRow, in CFS.java:1169 :



    /**
     *  Filter a cached row, which will not be modified by the filter, but may be modified
by throwing out
     *  tombstones that are no longer relevant.
     *  The returned column family won't be thread safe.
     */
    ColumnFamily filterColumnFamily(ColumnFamily cached, QueryFilter filter, int gcBefore)
    {


in ColumnSerializer.java:serialize()--->ByteBufferUtils.write() 
            out.write(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining());

the position() can be non-thread-safe, as well as others.



but that's a bit weird since my application code seems to work , i.e. without cassandra failing
on parsing the ReadResponse, which we would see if only partial byteBuffer is written





                  
> ReadResponseSerializer.serializedSize() calculation is wrong
> ------------------------------------------------------------
>
>                 Key: CASSANDRA-3390
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3390
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Yang Yang
>             Fix For: 1.0.1
>
>         Attachments: 3390.patch
>
>
> in ReadResponse.java
> the following code
>     public long serializedSize(ReadResponse response, int version)
>     {
>         int size = DBConstants.intSize;
>         size += (response.isDigestQuery() ? response.digest() : ByteBufferUtil.EMPTY_BYTE_BUFFER).remaining();
>         size += DBConstants.boolSize;
>         if (response.isDigestQuery())
>             size += response.digest().remaining();
>         else
>             size += Row.serializer().serializedSize(response.row(), version);
>         return size;
>     }
> adds the digest size 2 times
> this triggers assertion error in at least ReadVerbHandler

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message