fix validation compaction of empty rows patch by Carl Yeksigian; reviewed by jbellis for CASSANDRA-5136
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1c2a69c3 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1c2a69c3 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1c2a69c3 Branch: refs/heads/cassandra-1.2 Commit: 1c2a69c3580c0f093e48e06aea06408fe6e9d942 Parents: 3ff0c81 Author: Jonathan Ellis <jbel...@apache.org> Authored: Wed Jan 9 15:58:19 2013 -0600 Committer: Jonathan Ellis <jbel...@apache.org> Committed: Wed Jan 9 15:58:19 2013 -0600 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../cassandra/db/compaction/CompactionManager.java | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/1c2a69c3/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 2346993..a4d7963 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 1.2.1 + * fix validation compaction of empty rows (CASSADRA-5136) * nodetool methods to enable/disable hint storage/delivery (CASSANDRA-4750) * disallow bloom filter false positive chance of 0 (CASSANDRA-5013) * add threadpool size adjustment methods to JMXEnabledThreadPoolExecutor and http://git-wip-us.apache.org/repos/asf/cassandra/blob/1c2a69c3/src/java/org/apache/cassandra/db/compaction/CompactionManager.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java index 4f0290f..7ef8ee0 100644 --- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java +++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java @@ -768,16 +768,17 @@ public class CompactionManager implements CompactionManagerMBean metrics.beginCompaction(ci); try { - Iterator<AbstractCompactedRow> nni = Iterators.filter(iter, Predicates.notNull()); - // validate the CF as we iterate over it validator.prepare(cfs); - while (nni.hasNext()) + while (iter.hasNext()) { if (ci.isStopRequested()) throw new CompactionInterruptedException(ci.getCompactionInfo()); - AbstractCompactedRow row = nni.next(); - validator.add(row); + AbstractCompactedRow row = iter.next(); + if (row.isEmpty()) + row.close(); + else + validator.add(row); } validator.complete(); }