cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject [1/2] cassandra git commit: Avoid NPE when generating scrub error message
Date Tue, 05 May 2015 16:20:59 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 1a0262f24 -> 5bae5a313


Avoid NPE when generating scrub error message

Patch by Stefania Alborghetti; reviewed by Tyler Hobbs for
CASSANDRA-9290


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/dbb36a47
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/dbb36a47
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/dbb36a47

Branch: refs/heads/cassandra-2.1
Commit: dbb36a476bc502708ee7443e41bba570bfd5633a
Parents: a11bc78
Author: Stefania Alborghetti <stefania.alborghetti@datastax.com>
Authored: Tue May 5 11:18:23 2015 -0500
Committer: Tyler Hobbs <tylerlhobbs@gmail.com>
Committed: Tue May 5 11:18:23 2015 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/compaction/Scrubber.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/dbb36a47/src/java/org/apache/cassandra/db/compaction/Scrubber.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/Scrubber.java b/src/java/org/apache/cassandra/db/compaction/Scrubber.java
index 1752b21..f04df27 100644
--- a/src/java/org/apache/cassandra/db/compaction/Scrubber.java
+++ b/src/java/org/apache/cassandra/db/compaction/Scrubber.java
@@ -187,7 +187,7 @@ public class Scrubber implements Closeable
                     if (key == null)
                         throw new IOError(new IOException("Unable to read row key from data
file"));
 
-                    if (!key.key.equals(currentIndexKey))
+                    if (currentIndexKey != null && !key.key.equals(currentIndexKey))
                     {
                         throw new IOError(new IOException(String.format("Key from data file
(%s) does not match key from index file (%s)",
                                 ByteBufferUtil.bytesToHex(key.key), ByteBufferUtil.bytesToHex(currentIndexKey))));


Mime
View raw message