Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 898C59E03 for ; Sun, 23 Oct 2011 07:13:58 +0000 (UTC) Received: (qmail 7441 invoked by uid 500); 23 Oct 2011 07:13:58 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 7265 invoked by uid 500); 23 Oct 2011 07:13:57 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 7243 invoked by uid 99); 23 Oct 2011 07:13:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Oct 2011 07:13:54 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Oct 2011 07:13:52 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 1185B3174EC for ; Sun, 23 Oct 2011 07:11:32 +0000 (UTC) Date: Sun, 23 Oct 2011 07:11:32 +0000 (UTC) From: "Yang Yang (Issue Comment Edited) (JIRA)" To: commits@cassandra.apache.org Message-ID: <342138735.6321.1319353892073.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <428471690.17098.1319139970697.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Issue Comment Edited] (CASSANDRA-3390) ReadResponseSerializer.serializedSize() calculation is wrong MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ 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