cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefania (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-9460) NullPointerException Creating Digest
Date Thu, 16 Jul 2015 01:38:04 GMT

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

Stefania commented on CASSANDRA-9460:
-------------------------------------

We could write something similar for trunk but a simple merge will not work because {{ReadResponse}}
and {{ResponseResolver}} have changed too much. However, I am not sure we need to do this
because the original code that caused the problem in {{StorageProxy.fetchRows()}} is no longer
there:

{code}
Row row = exec.get();
if (row != null)
{
    exec.command.maybeTrim(row);
    rows.add(row);
}
{code}

There is no more trimming in the read command in favor of an iterator based approach. So I
don't think we need to cache the digest in the data responses. Do you agree with this analysis
or shall we ask Sylvain if the iterators used in calculating the digest in the asynchronous
read repair task could ever become invalid?

--

On a different subject, we have received these two Coverity defects, I think the second one
we can ignore because we have an assertion to protect against the NPE whilst the first one
is trivial to fix, see [this commit|https://github.com/stef1927/cassandra/commit/7e65d2c8010e49579ffc8a5781c3e158356fef56].
Could you submit this commit too?

{code}
** CID 125556:  FindBugs: Correctness  (FB.VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY)
/src/java/org/apache/cassandra/db/ReadResponse.java: 75 in org.apache.cassandra.db.ReadResponse.setDigest(java.nio.ByteBuffer)()


________________________________________________________________________________________________________
*** CID 125556:  FindBugs: Correctness  (FB.VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY)
/src/java/org/apache/cassandra/db/ReadResponse.java: 75 in org.apache.cassandra.db.ReadResponse.setDigest(java.nio.ByteBuffer)()
69         public void setDigest(ByteBuffer digest)
70         {
71             ByteBuffer curr = this.digest;
72             if (!digestUpdater.compareAndSet(this, curr, digest))
73             {
74                 assert digest.equals(this.digest) :
>>>     CID 125556:  FindBugs: Correctness  (FB.VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY)
>>>     Argument of type byte[] formatted in useless way.
75                     String.format("Digest mismatch : %s vs %s", digest.array(), this.digest.array());
76             }
77         }
78
79         public boolean isDigestQuery()
80         {

** CID 125555:  Null pointer dereferences  (NULL_RETURNS)
/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java: 70 in org.apache.cassandra.service.RangeSliceResponseResolver.getData()()


________________________________________________________________________________________________________
*** CID 125555:  Null pointer dereferences  (NULL_RETURNS)
/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java: 70 in org.apache.cassandra.service.RangeSliceResponseResolver.getData()()
64             this.sources = endpoints;
65         }
66
67         public List<Row> getData()
68         {
69             assert !responses.isEmpty();
>>>     CID 125555:  Null pointer dereferences  (NULL_RETURNS)
>>>     Accessing field of null object "responses.peek()".
70             return responses.peek().payload.rows;
71         }
72
73         // Note: this would deserialize the response a 2nd time if getData was called first.
74         // (this is not currently an issue since we don't do read repair for range queries.)
75         public Iterable<Row> resolve()
{code}

> NullPointerException Creating Digest
> ------------------------------------
>
>                 Key: CASSANDRA-9460
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9460
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Tyler Hobbs
>            Assignee: Stefania
>             Fix For: 2.1.x
>
>         Attachments: node2.log
>
>
> In the {{consistency_test.TestConsistency.short_read_test}} dtest against cassandra-2.1,
the following error occured:
> {noformat}
> ERROR [ReadRepairStage:3] 2015-05-22 16:35:25,034 CassandraDaemon.java:223 - Exception
in thread Thread[ReadRepairStage:3,5,main]
> java.lang.NullPointerException: null
>     at org.apache.cassandra.db.ColumnFamily.updateDigest(ColumnFamily.java:390) ~[main/:na]
>     at org.apache.cassandra.db.ColumnFamily.digest(ColumnFamily.java:383) ~[main/:na]
>     at org.apache.cassandra.service.RowDigestResolver.resolve(RowDigestResolver.java:84)
~[main/:na]
>     at org.apache.cassandra.service.RowDigestResolver.resolve(RowDigestResolver.java:28)
~[main/:na]
>     at org.apache.cassandra.service.ReadCallback$AsyncRepairRunner.run(ReadCallback.java:176)
~[main/:na]
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
~[na:1.7.0_80]
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
~[na:1.7.0_80]
>     at java.lang.Thread.run(Thread.java:745) ~[na:1.7.0_80]
> {noformat}
> From a glance at the code in the stacktrace, it looks like there was a null cell in the
ColumnFamily that we were creating a digest of.  This error is probably particular to "short
reads".
> Here's the failing test: http://cassci.datastax.com/job/cassandra-2.1_dtest/lastCompletedBuild/testReport/consistency_test/TestConsistency/short_read_test/.
 I've attached the logs for the node with the error.
> We saw this issue against 2.1, but the problem may also exist with 2.0 and/or 2.2.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message