cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject [04/19] cassandra git commit: If CompactionMetadata is not in stats file, use index summary instead
Date Tue, 12 Jan 2016 17:32:05 GMT
If CompactionMetadata is not in stats file, use index summary instead

patch by Carl Yeksigian; reviewed by Yuki Morishita for CASSANDRA-10676


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

Branch: refs/heads/cassandra-3.0
Commit: 10bbcfcd9c0599652e89687d5d6cd6bac40e3772
Parents: 0f27d68
Author: Carl Yeksigian <carl@apache.org>
Authored: Tue Jan 12 11:08:31 2016 -0500
Committer: Carl Yeksigian <carl@apache.org>
Committed: Tue Jan 12 12:26:43 2016 -0500

----------------------------------------------------------------------
 CHANGES.txt                                               |  3 ++-
 .../org/apache/cassandra/io/sstable/SSTableReader.java    | 10 +++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/10bbcfcd/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a6a0c60..6f567ee 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,7 +1,8 @@
 2.1.13
+ * If CompactionMetadata is not in stats file, use index summary instead (CASSANDRA-10676)
  * Retry sending gossip syn multiple times during shadow round (CASSANDRA-8072)
  * Fix pending range calculation during moves (CASSANDRA-10887)
- * Sane default (200Mbps) for inter-DC streaming througput (CASSANDRA-9708)
+ * Sane default (200Mbps) for inter-DC streaming througput (CASSANDRA-8708)
  * Match cassandra-loader options in COPY FROM (CASSANDRA-9303)
  * Fix binding to any address in CqlBulkRecordWriter (CASSANDRA-9309)
  * Fix the way we replace sstables after anticompaction (CASSANDRA-10831)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/10bbcfcd/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableReader.java b/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
index 84add6f..2680125 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
@@ -265,7 +265,15 @@ public class SSTableReader extends SSTable implements SelfRefCounted<SSTableRead
                 try
                 {
                     CompactionMetadata metadata = (CompactionMetadata) sstable.descriptor.getMetadataSerializer().deserialize(sstable.descriptor,
MetadataType.COMPACTION);
-                    assert metadata != null : sstable.getFilename();
+                    // If we can't load the CompactionMetadata, we are forced to estimate
the keys using the index
+                    // summary. (CASSANDRA-10676)
+                    if (metadata == null)
+                    {
+                        logger.warn("Reading cardinality from Statistics.db failed for {}",
sstable.getFilename());
+                        failed = true;
+                        break;
+                    }
+
                     if (cardinality == null)
                         cardinality = metadata.cardinalityEstimator;
                     else


Mime
View raw message