From cb67c98d574d941819a127bb60033fbbf34e511f Mon Sep 17 00:00:00 2001 From: Pavel Yaskevich Date: Tue, 24 Apr 2012 10:52:54 -0700 Subject: [PATCH 1/2] fix stress tool that hangs forever on timeout or error patch by Pavel Yaskevich; reviewed by Brandon Williams for CASSANDRA-4128 --- CHANGES.txt | 1 + tools/stress/src/org/apache/cassandra/stress/Stress.java | 2 +- .../src/org/apache/cassandra/stress/StressAction.java | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 814fe99ec7..544d393522 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,7 @@ * cqlsh: guess correct version of Python for Arch Linux (CASSANDRA-4090) * (CLI) properly handle quotes in create/update keyspace commands (CASSANDRA-4129) * Avoids possible deadlock during bootstrap (CASSANDRA-4159) + * fix stress tool that hangs forever on timeout or error (CASSANDRA-4128) 1.0.9 diff --git a/tools/stress/src/org/apache/cassandra/stress/Stress.java b/tools/stress/src/org/apache/cassandra/stress/Stress.java index 36f0410daa..c5e65f8f6e 100644 --- a/tools/stress/src/org/apache/cassandra/stress/Stress.java +++ b/tools/stress/src/org/apache/cassandra/stress/Stress.java @@ -88,7 +88,7 @@ public final class Stress } else { - new StressAction(session, outStream).run(); + new StressAction(session, outStream).start(); } } diff --git a/tools/stress/src/org/apache/cassandra/stress/StressAction.java b/tools/stress/src/org/apache/cassandra/stress/StressAction.java index 571d498f17..f0a9f49630 100644 --- a/tools/stress/src/org/apache/cassandra/stress/StressAction.java +++ b/tools/stress/src/org/apache/cassandra/stress/StressAction.java @@ -137,6 +137,9 @@ public class StressAction extends Thread } } + if (producer.isAlive()) + producer.interrupt(); // if producer is still alive it means that we had errors in the consumers + // marking an end of the output to the client output.println("END"); } @@ -161,7 +164,8 @@ public class StressAction extends Thread } catch (InterruptedException e) { - System.err.println("Producer error - " + e.getMessage()); + if (e.getMessage() != null) + System.err.println("Producer error - " + e.getMessage()); return; } } From eb9f96146efb2611ce75739ecf5e2c2607650d7b Mon Sep 17 00:00:00 2001 From: Sylvain Lebresne Date: Thu, 26 Apr 2012 16:32:06 +0200 Subject: [PATCH 2/2] Fix bug with super columns where row cache is not updated patch by slebresne; reviewed by jbellis for CASSANDRA-4190 --- CHANGES.txt | 1 + src/java/org/apache/cassandra/db/ColumnFamily.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 544d393522..5b58681e9e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,6 +9,7 @@ * (CLI) properly handle quotes in create/update keyspace commands (CASSANDRA-4129) * Avoids possible deadlock during bootstrap (CASSANDRA-4159) * fix stress tool that hangs forever on timeout or error (CASSANDRA-4128) + * Fix super columns bug where cache is not updated (CASSANDRA-4190) 1.0.9 diff --git a/src/java/org/apache/cassandra/db/ColumnFamily.java b/src/java/org/apache/cassandra/db/ColumnFamily.java index d27a963d9b..0b1e399da4 100644 --- a/src/java/org/apache/cassandra/db/ColumnFamily.java +++ b/src/java/org/apache/cassandra/db/ColumnFamily.java @@ -141,7 +141,7 @@ public class ColumnFamily extends AbstractColumnContainer } /** - * Same as addAll() but do a cloneMeShallow of SuperColumn if necessary to + * Same as addAll() but do a cloneMe of SuperColumn if necessary to * avoid keeping references to the structure (see #3957). */ public void addAllWithSCCopy(ColumnFamily cf, Allocator allocator) @@ -150,7 +150,7 @@ public class ColumnFamily extends AbstractColumnContainer { for (IColumn c : cf) { - columns.addColumn(((SuperColumn)c).cloneMeShallow(), allocator); + columns.addColumn(((SuperColumn)c).cloneMe(), allocator); } delete(cf); }