Updated Branches: refs/heads/trunk 3683d621b -> 31d991a25
don't create empty RowMutations in CommitLogReplayer patch by jbellis reviewed by dbrosius for (CASSANDRA-5541) Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/31d991a2 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/31d991a2 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/31d991a2 Branch: refs/heads/trunk Commit: 31d991a2551278de629ef38ed7e31b483ca67157 Parents: 3683d62 Author: Dave Brosius <[email protected]> Authored: Mon May 13 14:29:46 2013 -0400 Committer: Dave Brosius <[email protected]> Committed: Mon May 13 14:29:46 2013 -0400 ---------------------------------------------------------------------- CHANGES.txt | 2 +- .../cassandra/db/commitlog/CommitLogReplayer.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/31d991a2/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 1aca920..fb95e14 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -43,7 +43,7 @@ * Add binary protocol versioning (CASSANDRA-5436) * Swap THshaServer for TThreadedSelectorServer (CASSANDRA-5530) * Add alias support to SELECT statement (CASSANDRA-5075) - + * Don't create empty RowMutations in CommitLogReplayer (CASSANDRA-5541) 1.2.5 * fix 2i updates with identical values and timestamps (CASSANDRA-5540) http://git-wip-us.apache.org/repos/asf/cassandra/blob/31d991a2/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java index 37094c6..3d4cb8c 100644 --- a/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java +++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java @@ -237,11 +237,11 @@ public class CommitLogReplayer return; final Table table = Table.open(frm.getTable()); - RowMutation newRm = new RowMutation(frm.getTable(), frm.key()); // Rebuild the row mutation, omitting column families that // a) have already been flushed, // b) are part of a cf that was dropped. Keep in mind that the cf.name() is suspect. do every thing based on the cfid instead. + RowMutation newRm = null; for (ColumnFamily columnFamily : frm.getColumnFamilies()) { if (Schema.instance.getCF(columnFamily.id()) == null) @@ -254,12 +254,15 @@ public class CommitLogReplayer // if it is the last known segment, if we are after the replay position if (segment > rp.segment || (segment == rp.segment && entryLocation > rp.position)) { + if (newRm == null) + newRm = new RowMutation(frm.getTable(), frm.key()); newRm.add(columnFamily); replayedCount.incrementAndGet(); } } - if (!newRm.isEmpty()) + if (newRm != null) { + assert !newRm.isEmpty(); Table.open(newRm.getTable()).apply(newRm, false); tablesRecovered.add(table); }
