[jira] [Commented] (CASSANDRA-6572) Workload recording / playback
[ https://issues.apache.org/jira/browse/CASSANDRA-6572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985239#comment-13985239 ] Lyuben Todorov commented on CASSANDRA-6572: --- Once a switch is made to a buffer of queries is kept in memory rather than opening and writing to a file for each query, I'm wondering if there should be some timing on the log so it gets flushed to disk after x amount of time. Arguments against is that when the queue is full or query recording is disabled the log gets flushed but if no querying is going on and Cassandra gets shut down the log will be lost. Simpler way of handling that is to handle that case in the shutdown process, but then during the time that the query log remains enabled it will be consuming memory. Workload recording / playback - Key: CASSANDRA-6572 URL: https://issues.apache.org/jira/browse/CASSANDRA-6572 Project: Cassandra Issue Type: New Feature Components: Core, Tools Reporter: Jonathan Ellis Assignee: Lyuben Todorov Fix For: 2.1.1 Attachments: 6572-trunk.diff Write sample mode gets us part way to testing new versions against a real world workload, but we need an easy way to test the query side as well. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-6861) Optimise our Netty 4 integration
[ https://issues.apache.org/jira/browse/CASSANDRA-6861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985278#comment-13985278 ] Benedict commented on CASSANDRA-6861: - See CASSANDRA-7045 for one possible explanation. For comparison see performance of async and hsha thrift, which in my experiments perform, either as poorly, or half as poorly. Further evidence for this hypothesis is that the gap narrows for larger messages. Optimise our Netty 4 integration Key: CASSANDRA-6861 URL: https://issues.apache.org/jira/browse/CASSANDRA-6861 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: T Jake Luciani Priority: Minor Labels: performance Fix For: 2.1 beta2 Now we've upgraded to Netty 4, we're generating a lot of garbage that could be avoided, so we should probably stop that. Should be reasonably easy to hook into Netty's pooled buffers, returning them to the pool once a given message is completed. -- This message was sent by Atlassian JIRA (v6.2#6252)
git commit: Preserves CQL metadata when updating table from thrift
Repository: cassandra Updated Branches: refs/heads/cassandra-1.2 7f019804c - 10527498a Preserves CQL metadata when updating table from thrift patch by mishail; reviewed by iamaleksey slebresne for CASSANDRA-6831 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/10527498 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/10527498 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/10527498 Branch: refs/heads/cassandra-1.2 Commit: 10527498a340feb7333b3c2b0252029fe6a840c7 Parents: 7f01980 Author: Sylvain Lebresne sylv...@datastax.com Authored: Wed Apr 30 11:19:57 2014 +0200 Committer: Sylvain Lebresne sylv...@datastax.com Committed: Wed Apr 30 11:19:57 2014 +0200 -- CHANGES.txt | 1 + src/java/org/apache/cassandra/config/CFMetaData.java | 11 --- .../org/apache/cassandra/thrift/CassandraServer.java | 10 ++ 3 files changed, 11 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index e8d6a8d..fa9a156 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,6 +14,7 @@ * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * Always clean up references in SerializingCache (CASSANDRA-6994) * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) + * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) 1.2.16 http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/src/java/org/apache/cassandra/config/CFMetaData.java -- diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java index 85c3dcb..9e3ceb7 100644 --- a/src/java/org/apache/cassandra/config/CFMetaData.java +++ b/src/java/org/apache/cassandra/config/CFMetaData.java @@ -802,17 +802,6 @@ public final class CFMetaData minCompactionThreshold = cfm.minCompactionThreshold; maxCompactionThreshold = cfm.maxCompactionThreshold; -/* - * Because thrift updates don't know about aliases, we should ignore - * the case where the new aliases are empty. - */ -if (!cfm.keyAliases.isEmpty()) -keyAliases = cfm.keyAliases; -if (!cfm.columnAliases.isEmpty()) -columnAliases = cfm.columnAliases; -if (cfm.valueAlias != null) -valueAlias = cfm.valueAlias; - bloomFilterFpChance = cfm.bloomFilterFpChance; caching = cfm.caching; populateIoCacheOnFlush = cfm.populateIoCacheOnFlush; http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/src/java/org/apache/cassandra/thrift/CassandraServer.java -- diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java index ec7a37d..588f732 100644 --- a/src/java/org/apache/cassandra/thrift/CassandraServer.java +++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java @@ -1427,6 +1427,16 @@ public class CassandraServer implements Cassandra.Iface CFMetaData.applyImplicitDefaults(cf_def); CFMetaData cfm = CFMetaData.fromThrift(cf_def); + +/* + * CASSANDRA-6831: Because thrift updates don't know about aliases, + * we should copy them from the original CFM + */ +if (!cf_def.isSetKey_alias()) +cfm.keyAliases(oldCfm.getKeyAliases()); +cfm.columnAliases(oldCfm.getColumnAliases()); +cfm.valueAlias(oldCfm.getValueAlias()); + CFMetaData.validateCompactionOptions(cfm.compactionStrategyClass, cfm.compactionStrategyOptions, false); cfm.addDefaultIndexNames(); MigrationManager.announceColumnFamilyUpdate(cfm);
[2/2] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Merge branch 'cassandra-1.2' into cassandra-2.0 Conflicts: src/java/org/apache/cassandra/thrift/CassandraServer.java Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b4337228 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b4337228 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b4337228 Branch: refs/heads/cassandra-2.0 Commit: b4337228df7178183a643a8f201e9389cab36ab3 Parents: 90d086a 1052749 Author: Sylvain Lebresne sylv...@datastax.com Authored: Wed Apr 30 11:24:21 2014 +0200 Committer: Sylvain Lebresne sylv...@datastax.com Committed: Wed Apr 30 11:24:21 2014 +0200 -- CHANGES.txt | 1 + .../org/apache/cassandra/config/CFMetaData.java | 47 +--- .../cassandra/thrift/CassandraServer.java | 3 +- .../unit/org/apache/cassandra/SchemaLoader.java | 16 ++- .../apache/cassandra/config/CFMetaDataTest.java | 32 - 5 files changed, 65 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b4337228/CHANGES.txt -- diff --cc CHANGES.txt index 428f8fc,fa9a156..e25e71f --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -23,64 -11,13 +23,65 @@@ Merged from 1.2 * Fix CQLSH parsing of functions and BLOB literals (CASSANDRA-7018) * Require nodetool rebuild_index to specify index names (CASSANDRA-7038) * Ensure that batchlog and hint timeouts do not produce hints (CASSANDRA-7058) - * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * Always clean up references in SerializingCache (CASSANDRA-6994) + * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) + * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) -1.2.16 +2.0.7 + * Put nodes in hibernate when join_ring is false (CASSANDRA-6961) + * Avoid early loading of non-system keyspaces before compaction-leftovers + cleanup at startup (CASSANDRA-6913) + * Restrict Windows to parallel repairs (CASSANDRA-6907) + * (Hadoop) Allow manually specifying start/end tokens in CFIF (CASSANDRA-6436) + * Fix NPE in MeteredFlusher (CASSANDRA-6820) + * Fix race processing range scan responses (CASSANDRA-6820) + * Allow deleting snapshots from dropped keyspaces (CASSANDRA-6821) + * Add uuid() function (CASSANDRA-6473) + * Omit tombstones from schema digests (CASSANDRA-6862) + * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884) + * Lower chances for losing new SSTables during nodetool refresh and + ColumnFamilyStore.loadNewSSTables (CASSANDRA-6514) + * Add support for DELETE ... IF EXISTS to CQL3 (CASSANDRA-5708) + * Update hadoop_cql3_word_count example (CASSANDRA-6793) + * Fix handling of RejectedExecution in sync Thrift server (CASSANDRA-6788) + * Log more information when exceeding tombstone_warn_threshold (CASSANDRA-6865) + * Fix truncate to not abort due to unreachable fat clients (CASSANDRA-6864) + * Fix schema concurrency exceptions (CASSANDRA-6841) + * Fix leaking validator FH in StreamWriter (CASSANDRA-6832) + * Fix saving triggers to schema (CASSANDRA-6789) + * Fix trigger mutations when base mutation list is immutable (CASSANDRA-6790) + * Fix accounting in FileCacheService to allow re-using RAR (CASSANDRA-6838) + * Fix static counter columns (CASSANDRA-6827) + * Restore expiring-deleted (cell) compaction optimization (CASSANDRA-6844) + * Fix CompactionManager.needsCleanup (CASSANDRA-6845) + * Correctly compare BooleanType values other than 0 and 1 (CASSANDRA-6779) + * Read message id as string from earlier versions (CASSANDRA-6840) + * Properly use the Paxos consistency for (non-protocol) batch (CASSANDRA-6837) + * Add paranoid disk failure option (CASSANDRA-6646) + * Improve PerRowSecondaryIndex performance (CASSANDRA-6876) + * Extend triggers to support CAS updates (CASSANDRA-6882) + * Static columns with IF NOT EXISTS don't always work as expected (CASSANDRA-6873) + * Fix paging with SELECT DISTINCT (CASSANDRA-6857) + * Fix UnsupportedOperationException on CAS timeout (CASSANDRA-6923) + * Improve MeteredFlusher handling of MF-unaffected column families + (CASSANDRA-6867) + * Add CqlRecordReader using native pagination (CASSANDRA-6311) + * Add QueryHandler interface (CASSANDRA-6659) + * Track liveRatio per-memtable, not per-CF (CASSANDRA-6945) + * Make sure upgradesstables keeps sstable level (CASSANDRA-6958) + * Fix LIMIT with static columns (CASSANDRA-6956) + * Fix clash with CQL column name in thrift validation (CASSANDRA-6892) + * Fix error with super columns in mixed 1.2-2.0 clusters (CASSANDRA-6966) + * Fix bad skip of sstables on
[1/2] git commit: Preserves CQL metadata when updating table from thrift
Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 90d086a15 - b4337228d Preserves CQL metadata when updating table from thrift patch by mishail; reviewed by iamaleksey slebresne for CASSANDRA-6831 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/10527498 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/10527498 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/10527498 Branch: refs/heads/cassandra-2.0 Commit: 10527498a340feb7333b3c2b0252029fe6a840c7 Parents: 7f01980 Author: Sylvain Lebresne sylv...@datastax.com Authored: Wed Apr 30 11:19:57 2014 +0200 Committer: Sylvain Lebresne sylv...@datastax.com Committed: Wed Apr 30 11:19:57 2014 +0200 -- CHANGES.txt | 1 + src/java/org/apache/cassandra/config/CFMetaData.java | 11 --- .../org/apache/cassandra/thrift/CassandraServer.java | 10 ++ 3 files changed, 11 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index e8d6a8d..fa9a156 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,6 +14,7 @@ * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * Always clean up references in SerializingCache (CASSANDRA-6994) * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) + * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) 1.2.16 http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/src/java/org/apache/cassandra/config/CFMetaData.java -- diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java index 85c3dcb..9e3ceb7 100644 --- a/src/java/org/apache/cassandra/config/CFMetaData.java +++ b/src/java/org/apache/cassandra/config/CFMetaData.java @@ -802,17 +802,6 @@ public final class CFMetaData minCompactionThreshold = cfm.minCompactionThreshold; maxCompactionThreshold = cfm.maxCompactionThreshold; -/* - * Because thrift updates don't know about aliases, we should ignore - * the case where the new aliases are empty. - */ -if (!cfm.keyAliases.isEmpty()) -keyAliases = cfm.keyAliases; -if (!cfm.columnAliases.isEmpty()) -columnAliases = cfm.columnAliases; -if (cfm.valueAlias != null) -valueAlias = cfm.valueAlias; - bloomFilterFpChance = cfm.bloomFilterFpChance; caching = cfm.caching; populateIoCacheOnFlush = cfm.populateIoCacheOnFlush; http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/src/java/org/apache/cassandra/thrift/CassandraServer.java -- diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java index ec7a37d..588f732 100644 --- a/src/java/org/apache/cassandra/thrift/CassandraServer.java +++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java @@ -1427,6 +1427,16 @@ public class CassandraServer implements Cassandra.Iface CFMetaData.applyImplicitDefaults(cf_def); CFMetaData cfm = CFMetaData.fromThrift(cf_def); + +/* + * CASSANDRA-6831: Because thrift updates don't know about aliases, + * we should copy them from the original CFM + */ +if (!cf_def.isSetKey_alias()) +cfm.keyAliases(oldCfm.getKeyAliases()); +cfm.columnAliases(oldCfm.getColumnAliases()); +cfm.valueAlias(oldCfm.getValueAlias()); + CFMetaData.validateCompactionOptions(cfm.compactionStrategyClass, cfm.compactionStrategyOptions, false); cfm.addDefaultIndexNames(); MigrationManager.announceColumnFamilyUpdate(cfm);
[2/3] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Merge branch 'cassandra-1.2' into cassandra-2.0 Conflicts: src/java/org/apache/cassandra/thrift/CassandraServer.java Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b4337228 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b4337228 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b4337228 Branch: refs/heads/cassandra-2.1 Commit: b4337228df7178183a643a8f201e9389cab36ab3 Parents: 90d086a 1052749 Author: Sylvain Lebresne sylv...@datastax.com Authored: Wed Apr 30 11:24:21 2014 +0200 Committer: Sylvain Lebresne sylv...@datastax.com Committed: Wed Apr 30 11:24:21 2014 +0200 -- CHANGES.txt | 1 + .../org/apache/cassandra/config/CFMetaData.java | 47 +--- .../cassandra/thrift/CassandraServer.java | 3 +- .../unit/org/apache/cassandra/SchemaLoader.java | 16 ++- .../apache/cassandra/config/CFMetaDataTest.java | 32 - 5 files changed, 65 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b4337228/CHANGES.txt -- diff --cc CHANGES.txt index 428f8fc,fa9a156..e25e71f --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -23,64 -11,13 +23,65 @@@ Merged from 1.2 * Fix CQLSH parsing of functions and BLOB literals (CASSANDRA-7018) * Require nodetool rebuild_index to specify index names (CASSANDRA-7038) * Ensure that batchlog and hint timeouts do not produce hints (CASSANDRA-7058) - * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * Always clean up references in SerializingCache (CASSANDRA-6994) + * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) + * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) -1.2.16 +2.0.7 + * Put nodes in hibernate when join_ring is false (CASSANDRA-6961) + * Avoid early loading of non-system keyspaces before compaction-leftovers + cleanup at startup (CASSANDRA-6913) + * Restrict Windows to parallel repairs (CASSANDRA-6907) + * (Hadoop) Allow manually specifying start/end tokens in CFIF (CASSANDRA-6436) + * Fix NPE in MeteredFlusher (CASSANDRA-6820) + * Fix race processing range scan responses (CASSANDRA-6820) + * Allow deleting snapshots from dropped keyspaces (CASSANDRA-6821) + * Add uuid() function (CASSANDRA-6473) + * Omit tombstones from schema digests (CASSANDRA-6862) + * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884) + * Lower chances for losing new SSTables during nodetool refresh and + ColumnFamilyStore.loadNewSSTables (CASSANDRA-6514) + * Add support for DELETE ... IF EXISTS to CQL3 (CASSANDRA-5708) + * Update hadoop_cql3_word_count example (CASSANDRA-6793) + * Fix handling of RejectedExecution in sync Thrift server (CASSANDRA-6788) + * Log more information when exceeding tombstone_warn_threshold (CASSANDRA-6865) + * Fix truncate to not abort due to unreachable fat clients (CASSANDRA-6864) + * Fix schema concurrency exceptions (CASSANDRA-6841) + * Fix leaking validator FH in StreamWriter (CASSANDRA-6832) + * Fix saving triggers to schema (CASSANDRA-6789) + * Fix trigger mutations when base mutation list is immutable (CASSANDRA-6790) + * Fix accounting in FileCacheService to allow re-using RAR (CASSANDRA-6838) + * Fix static counter columns (CASSANDRA-6827) + * Restore expiring-deleted (cell) compaction optimization (CASSANDRA-6844) + * Fix CompactionManager.needsCleanup (CASSANDRA-6845) + * Correctly compare BooleanType values other than 0 and 1 (CASSANDRA-6779) + * Read message id as string from earlier versions (CASSANDRA-6840) + * Properly use the Paxos consistency for (non-protocol) batch (CASSANDRA-6837) + * Add paranoid disk failure option (CASSANDRA-6646) + * Improve PerRowSecondaryIndex performance (CASSANDRA-6876) + * Extend triggers to support CAS updates (CASSANDRA-6882) + * Static columns with IF NOT EXISTS don't always work as expected (CASSANDRA-6873) + * Fix paging with SELECT DISTINCT (CASSANDRA-6857) + * Fix UnsupportedOperationException on CAS timeout (CASSANDRA-6923) + * Improve MeteredFlusher handling of MF-unaffected column families + (CASSANDRA-6867) + * Add CqlRecordReader using native pagination (CASSANDRA-6311) + * Add QueryHandler interface (CASSANDRA-6659) + * Track liveRatio per-memtable, not per-CF (CASSANDRA-6945) + * Make sure upgradesstables keeps sstable level (CASSANDRA-6958) + * Fix LIMIT with static columns (CASSANDRA-6956) + * Fix clash with CQL column name in thrift validation (CASSANDRA-6892) + * Fix error with super columns in mixed 1.2-2.0 clusters (CASSANDRA-6966) + * Fix bad skip of sstables on
[1/3] git commit: Preserves CQL metadata when updating table from thrift
Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 6b5b7f519 - 2269adba6 Preserves CQL metadata when updating table from thrift patch by mishail; reviewed by iamaleksey slebresne for CASSANDRA-6831 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/10527498 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/10527498 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/10527498 Branch: refs/heads/cassandra-2.1 Commit: 10527498a340feb7333b3c2b0252029fe6a840c7 Parents: 7f01980 Author: Sylvain Lebresne sylv...@datastax.com Authored: Wed Apr 30 11:19:57 2014 +0200 Committer: Sylvain Lebresne sylv...@datastax.com Committed: Wed Apr 30 11:19:57 2014 +0200 -- CHANGES.txt | 1 + src/java/org/apache/cassandra/config/CFMetaData.java | 11 --- .../org/apache/cassandra/thrift/CassandraServer.java | 10 ++ 3 files changed, 11 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index e8d6a8d..fa9a156 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,6 +14,7 @@ * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * Always clean up references in SerializingCache (CASSANDRA-6994) * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) + * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) 1.2.16 http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/src/java/org/apache/cassandra/config/CFMetaData.java -- diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java index 85c3dcb..9e3ceb7 100644 --- a/src/java/org/apache/cassandra/config/CFMetaData.java +++ b/src/java/org/apache/cassandra/config/CFMetaData.java @@ -802,17 +802,6 @@ public final class CFMetaData minCompactionThreshold = cfm.minCompactionThreshold; maxCompactionThreshold = cfm.maxCompactionThreshold; -/* - * Because thrift updates don't know about aliases, we should ignore - * the case where the new aliases are empty. - */ -if (!cfm.keyAliases.isEmpty()) -keyAliases = cfm.keyAliases; -if (!cfm.columnAliases.isEmpty()) -columnAliases = cfm.columnAliases; -if (cfm.valueAlias != null) -valueAlias = cfm.valueAlias; - bloomFilterFpChance = cfm.bloomFilterFpChance; caching = cfm.caching; populateIoCacheOnFlush = cfm.populateIoCacheOnFlush; http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/src/java/org/apache/cassandra/thrift/CassandraServer.java -- diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java index ec7a37d..588f732 100644 --- a/src/java/org/apache/cassandra/thrift/CassandraServer.java +++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java @@ -1427,6 +1427,16 @@ public class CassandraServer implements Cassandra.Iface CFMetaData.applyImplicitDefaults(cf_def); CFMetaData cfm = CFMetaData.fromThrift(cf_def); + +/* + * CASSANDRA-6831: Because thrift updates don't know about aliases, + * we should copy them from the original CFM + */ +if (!cf_def.isSetKey_alias()) +cfm.keyAliases(oldCfm.getKeyAliases()); +cfm.columnAliases(oldCfm.getColumnAliases()); +cfm.valueAlias(oldCfm.getValueAlias()); + CFMetaData.validateCompactionOptions(cfm.compactionStrategyClass, cfm.compactionStrategyOptions, false); cfm.addDefaultIndexNames(); MigrationManager.announceColumnFamilyUpdate(cfm);
[3/3] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Conflicts: CHANGES.txt src/java/org/apache/cassandra/config/CFMetaData.java test/unit/org/apache/cassandra/config/CFMetaDataTest.java Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2269adba Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2269adba Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2269adba Branch: refs/heads/cassandra-2.1 Commit: 2269adba6c28e24f60883700f657d36fff7b9d3f Parents: 6b5b7f5 b433722 Author: Sylvain Lebresne sylv...@datastax.com Authored: Wed Apr 30 11:35:15 2014 +0200 Committer: Sylvain Lebresne sylv...@datastax.com Committed: Wed Apr 30 11:35:15 2014 +0200 -- CHANGES.txt | 1 + .../org/apache/cassandra/config/CFMetaData.java | 45 +--- .../cassandra/thrift/CassandraServer.java | 3 +- .../unit/org/apache/cassandra/SchemaLoader.java | 16 ++- .../apache/cassandra/config/CFMetaDataTest.java | 5 ++- 5 files changed, 60 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2269adba/CHANGES.txt -- diff --cc CHANGES.txt index b60feb8,e25e71f..64e5afb --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -111,15 -81,7 +111,16 @@@ Merged from 2.0 (CASSANDRA-6906) * Fix SSTable not released if stream session fails (CASSANDRA-6818) * Avoid build failure due to ANTLR timeout (CASSANDRA-6991) + * Queries on compact tables can return more rows that requested (CASSANDRA-7052) + * USING TIMESTAMP for batches does not work (CASSANDRA-7053) + * Fix performance regression from CASSANDRA-5614 (CASSANDRA-6949) + * Ensure that batchlog and hint timeouts do not produce hints (CASSANDRA-7058) + * Merge groupable mutations in TriggerExecutor#execute() (CASSANDRA-7047) + * Plug holes in resource release when wiring up StreamSession (CASSANDRA-7073) + * Re-add parameter columns to tracing session (CASSANDRA-6942) ++ * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) Merged from 1.2: + * Fix nodetool display with vnodes (CASSANDRA-7082) * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816) * add extra SSL cipher suites (CASSANDRA-6613) * fix nodetool getsstables for blob PK (CASSANDRA-6803) http://git-wip-us.apache.org/repos/asf/cassandra/blob/2269adba/src/java/org/apache/cassandra/config/CFMetaData.java -- diff --cc src/java/org/apache/cassandra/config/CFMetaData.java index b4b3fbe,9ca41ac..2e531e8 --- a/src/java/org/apache/cassandra/config/CFMetaData.java +++ b/src/java/org/apache/cassandra/config/CFMetaData.java @@@ -1001,6 -895,44 +1001,44 @@@ public final class CFMetaDat public static CFMetaData fromThrift(org.apache.cassandra.thrift.CfDef cf_def) throws InvalidRequestException, ConfigurationException { + CFMetaData cfm = internalFromThrift(cf_def); + + if (cf_def.isSetKey_alias() !(cfm.keyValidator instanceof CompositeType)) -cfm.column_metadata.put(cf_def.key_alias, ColumnDefinition.partitionKeyDef(cf_def.key_alias, cfm.keyValidator, null)); ++ cfm.addOrReplaceColumnDefinition(ColumnDefinition.partitionKeyDef(cfm, cf_def.key_alias, cfm.keyValidator, null)); + + return cfm.rebuild(); + } + + public static CFMetaData fromThriftForUpdate(org.apache.cassandra.thrift.CfDef cf_def, CFMetaData toUpdate) throws InvalidRequestException, ConfigurationException + { + CFMetaData cfm = internalFromThrift(cf_def); + + // Thrift update can't have CQL metadata, and so we'll copy the ones of the updated metadata (to make + // sure we don't override anything existing -- see #6831). One exception (for historical reasons) is + // the partition key column name however, which can be provided through thrift. If it is, make sure + // we use the one of the update. + boolean hasKeyAlias = cf_def.isSetKey_alias() !(cfm.keyValidator instanceof CompositeType); + if (hasKeyAlias) -cfm.column_metadata.put(cf_def.key_alias, ColumnDefinition.partitionKeyDef(cf_def.key_alias, cfm.keyValidator, null)); ++ cfm.addOrReplaceColumnDefinition(ColumnDefinition.partitionKeyDef(cfm, cf_def.key_alias, cfm.keyValidator, null)); + + for (ColumnDefinition def : toUpdate.allColumns()) + { + // isPartOfCellName basically means 'is not just a CQL metadata' + if (def.isPartOfCellName()) + continue; + -if (def.type == ColumnDefinition.Type.PARTITION_KEY hasKeyAlias) ++if (def.kind ==
[1/4] git commit: Preserves CQL metadata when updating table from thrift
Repository: cassandra Updated Branches: refs/heads/trunk c06ba25a5 - d9f06a3be Preserves CQL metadata when updating table from thrift patch by mishail; reviewed by iamaleksey slebresne for CASSANDRA-6831 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/10527498 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/10527498 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/10527498 Branch: refs/heads/trunk Commit: 10527498a340feb7333b3c2b0252029fe6a840c7 Parents: 7f01980 Author: Sylvain Lebresne sylv...@datastax.com Authored: Wed Apr 30 11:19:57 2014 +0200 Committer: Sylvain Lebresne sylv...@datastax.com Committed: Wed Apr 30 11:19:57 2014 +0200 -- CHANGES.txt | 1 + src/java/org/apache/cassandra/config/CFMetaData.java | 11 --- .../org/apache/cassandra/thrift/CassandraServer.java | 10 ++ 3 files changed, 11 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index e8d6a8d..fa9a156 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,6 +14,7 @@ * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * Always clean up references in SerializingCache (CASSANDRA-6994) * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) + * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) 1.2.16 http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/src/java/org/apache/cassandra/config/CFMetaData.java -- diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java index 85c3dcb..9e3ceb7 100644 --- a/src/java/org/apache/cassandra/config/CFMetaData.java +++ b/src/java/org/apache/cassandra/config/CFMetaData.java @@ -802,17 +802,6 @@ public final class CFMetaData minCompactionThreshold = cfm.minCompactionThreshold; maxCompactionThreshold = cfm.maxCompactionThreshold; -/* - * Because thrift updates don't know about aliases, we should ignore - * the case where the new aliases are empty. - */ -if (!cfm.keyAliases.isEmpty()) -keyAliases = cfm.keyAliases; -if (!cfm.columnAliases.isEmpty()) -columnAliases = cfm.columnAliases; -if (cfm.valueAlias != null) -valueAlias = cfm.valueAlias; - bloomFilterFpChance = cfm.bloomFilterFpChance; caching = cfm.caching; populateIoCacheOnFlush = cfm.populateIoCacheOnFlush; http://git-wip-us.apache.org/repos/asf/cassandra/blob/10527498/src/java/org/apache/cassandra/thrift/CassandraServer.java -- diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java index ec7a37d..588f732 100644 --- a/src/java/org/apache/cassandra/thrift/CassandraServer.java +++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java @@ -1427,6 +1427,16 @@ public class CassandraServer implements Cassandra.Iface CFMetaData.applyImplicitDefaults(cf_def); CFMetaData cfm = CFMetaData.fromThrift(cf_def); + +/* + * CASSANDRA-6831: Because thrift updates don't know about aliases, + * we should copy them from the original CFM + */ +if (!cf_def.isSetKey_alias()) +cfm.keyAliases(oldCfm.getKeyAliases()); +cfm.columnAliases(oldCfm.getColumnAliases()); +cfm.valueAlias(oldCfm.getValueAlias()); + CFMetaData.validateCompactionOptions(cfm.compactionStrategyClass, cfm.compactionStrategyOptions, false); cfm.addDefaultIndexNames(); MigrationManager.announceColumnFamilyUpdate(cfm);
[4/4] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d9f06a3b Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d9f06a3b Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d9f06a3b Branch: refs/heads/trunk Commit: d9f06a3be095a6576974533d921a14819e43a91e Parents: c06ba25 2269adb Author: Sylvain Lebresne sylv...@datastax.com Authored: Wed Apr 30 11:36:04 2014 +0200 Committer: Sylvain Lebresne sylv...@datastax.com Committed: Wed Apr 30 11:36:04 2014 +0200 -- CHANGES.txt | 1 + .../org/apache/cassandra/config/CFMetaData.java | 45 +--- .../cassandra/thrift/CassandraServer.java | 3 +- .../unit/org/apache/cassandra/SchemaLoader.java | 16 ++- .../apache/cassandra/config/CFMetaDataTest.java | 5 ++- 5 files changed, 60 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/d9f06a3b/CHANGES.txt -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/d9f06a3b/src/java/org/apache/cassandra/config/CFMetaData.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/d9f06a3b/src/java/org/apache/cassandra/thrift/CassandraServer.java --
[2/4] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Merge branch 'cassandra-1.2' into cassandra-2.0 Conflicts: src/java/org/apache/cassandra/thrift/CassandraServer.java Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b4337228 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b4337228 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b4337228 Branch: refs/heads/trunk Commit: b4337228df7178183a643a8f201e9389cab36ab3 Parents: 90d086a 1052749 Author: Sylvain Lebresne sylv...@datastax.com Authored: Wed Apr 30 11:24:21 2014 +0200 Committer: Sylvain Lebresne sylv...@datastax.com Committed: Wed Apr 30 11:24:21 2014 +0200 -- CHANGES.txt | 1 + .../org/apache/cassandra/config/CFMetaData.java | 47 +--- .../cassandra/thrift/CassandraServer.java | 3 +- .../unit/org/apache/cassandra/SchemaLoader.java | 16 ++- .../apache/cassandra/config/CFMetaDataTest.java | 32 - 5 files changed, 65 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b4337228/CHANGES.txt -- diff --cc CHANGES.txt index 428f8fc,fa9a156..e25e71f --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -23,64 -11,13 +23,65 @@@ Merged from 1.2 * Fix CQLSH parsing of functions and BLOB literals (CASSANDRA-7018) * Require nodetool rebuild_index to specify index names (CASSANDRA-7038) * Ensure that batchlog and hint timeouts do not produce hints (CASSANDRA-7058) - * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * Always clean up references in SerializingCache (CASSANDRA-6994) + * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) + * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) -1.2.16 +2.0.7 + * Put nodes in hibernate when join_ring is false (CASSANDRA-6961) + * Avoid early loading of non-system keyspaces before compaction-leftovers + cleanup at startup (CASSANDRA-6913) + * Restrict Windows to parallel repairs (CASSANDRA-6907) + * (Hadoop) Allow manually specifying start/end tokens in CFIF (CASSANDRA-6436) + * Fix NPE in MeteredFlusher (CASSANDRA-6820) + * Fix race processing range scan responses (CASSANDRA-6820) + * Allow deleting snapshots from dropped keyspaces (CASSANDRA-6821) + * Add uuid() function (CASSANDRA-6473) + * Omit tombstones from schema digests (CASSANDRA-6862) + * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884) + * Lower chances for losing new SSTables during nodetool refresh and + ColumnFamilyStore.loadNewSSTables (CASSANDRA-6514) + * Add support for DELETE ... IF EXISTS to CQL3 (CASSANDRA-5708) + * Update hadoop_cql3_word_count example (CASSANDRA-6793) + * Fix handling of RejectedExecution in sync Thrift server (CASSANDRA-6788) + * Log more information when exceeding tombstone_warn_threshold (CASSANDRA-6865) + * Fix truncate to not abort due to unreachable fat clients (CASSANDRA-6864) + * Fix schema concurrency exceptions (CASSANDRA-6841) + * Fix leaking validator FH in StreamWriter (CASSANDRA-6832) + * Fix saving triggers to schema (CASSANDRA-6789) + * Fix trigger mutations when base mutation list is immutable (CASSANDRA-6790) + * Fix accounting in FileCacheService to allow re-using RAR (CASSANDRA-6838) + * Fix static counter columns (CASSANDRA-6827) + * Restore expiring-deleted (cell) compaction optimization (CASSANDRA-6844) + * Fix CompactionManager.needsCleanup (CASSANDRA-6845) + * Correctly compare BooleanType values other than 0 and 1 (CASSANDRA-6779) + * Read message id as string from earlier versions (CASSANDRA-6840) + * Properly use the Paxos consistency for (non-protocol) batch (CASSANDRA-6837) + * Add paranoid disk failure option (CASSANDRA-6646) + * Improve PerRowSecondaryIndex performance (CASSANDRA-6876) + * Extend triggers to support CAS updates (CASSANDRA-6882) + * Static columns with IF NOT EXISTS don't always work as expected (CASSANDRA-6873) + * Fix paging with SELECT DISTINCT (CASSANDRA-6857) + * Fix UnsupportedOperationException on CAS timeout (CASSANDRA-6923) + * Improve MeteredFlusher handling of MF-unaffected column families + (CASSANDRA-6867) + * Add CqlRecordReader using native pagination (CASSANDRA-6311) + * Add QueryHandler interface (CASSANDRA-6659) + * Track liveRatio per-memtable, not per-CF (CASSANDRA-6945) + * Make sure upgradesstables keeps sstable level (CASSANDRA-6958) + * Fix LIMIT with static columns (CASSANDRA-6956) + * Fix clash with CQL column name in thrift validation (CASSANDRA-6892) + * Fix error with super columns in mixed 1.2-2.0 clusters (CASSANDRA-6966) + * Fix bad skip of sstables on slice
[3/4] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Conflicts: CHANGES.txt src/java/org/apache/cassandra/config/CFMetaData.java test/unit/org/apache/cassandra/config/CFMetaDataTest.java Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2269adba Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2269adba Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2269adba Branch: refs/heads/trunk Commit: 2269adba6c28e24f60883700f657d36fff7b9d3f Parents: 6b5b7f5 b433722 Author: Sylvain Lebresne sylv...@datastax.com Authored: Wed Apr 30 11:35:15 2014 +0200 Committer: Sylvain Lebresne sylv...@datastax.com Committed: Wed Apr 30 11:35:15 2014 +0200 -- CHANGES.txt | 1 + .../org/apache/cassandra/config/CFMetaData.java | 45 +--- .../cassandra/thrift/CassandraServer.java | 3 +- .../unit/org/apache/cassandra/SchemaLoader.java | 16 ++- .../apache/cassandra/config/CFMetaDataTest.java | 5 ++- 5 files changed, 60 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2269adba/CHANGES.txt -- diff --cc CHANGES.txt index b60feb8,e25e71f..64e5afb --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -111,15 -81,7 +111,16 @@@ Merged from 2.0 (CASSANDRA-6906) * Fix SSTable not released if stream session fails (CASSANDRA-6818) * Avoid build failure due to ANTLR timeout (CASSANDRA-6991) + * Queries on compact tables can return more rows that requested (CASSANDRA-7052) + * USING TIMESTAMP for batches does not work (CASSANDRA-7053) + * Fix performance regression from CASSANDRA-5614 (CASSANDRA-6949) + * Ensure that batchlog and hint timeouts do not produce hints (CASSANDRA-7058) + * Merge groupable mutations in TriggerExecutor#execute() (CASSANDRA-7047) + * Plug holes in resource release when wiring up StreamSession (CASSANDRA-7073) + * Re-add parameter columns to tracing session (CASSANDRA-6942) ++ * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) Merged from 1.2: + * Fix nodetool display with vnodes (CASSANDRA-7082) * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816) * add extra SSL cipher suites (CASSANDRA-6613) * fix nodetool getsstables for blob PK (CASSANDRA-6803) http://git-wip-us.apache.org/repos/asf/cassandra/blob/2269adba/src/java/org/apache/cassandra/config/CFMetaData.java -- diff --cc src/java/org/apache/cassandra/config/CFMetaData.java index b4b3fbe,9ca41ac..2e531e8 --- a/src/java/org/apache/cassandra/config/CFMetaData.java +++ b/src/java/org/apache/cassandra/config/CFMetaData.java @@@ -1001,6 -895,44 +1001,44 @@@ public final class CFMetaDat public static CFMetaData fromThrift(org.apache.cassandra.thrift.CfDef cf_def) throws InvalidRequestException, ConfigurationException { + CFMetaData cfm = internalFromThrift(cf_def); + + if (cf_def.isSetKey_alias() !(cfm.keyValidator instanceof CompositeType)) -cfm.column_metadata.put(cf_def.key_alias, ColumnDefinition.partitionKeyDef(cf_def.key_alias, cfm.keyValidator, null)); ++ cfm.addOrReplaceColumnDefinition(ColumnDefinition.partitionKeyDef(cfm, cf_def.key_alias, cfm.keyValidator, null)); + + return cfm.rebuild(); + } + + public static CFMetaData fromThriftForUpdate(org.apache.cassandra.thrift.CfDef cf_def, CFMetaData toUpdate) throws InvalidRequestException, ConfigurationException + { + CFMetaData cfm = internalFromThrift(cf_def); + + // Thrift update can't have CQL metadata, and so we'll copy the ones of the updated metadata (to make + // sure we don't override anything existing -- see #6831). One exception (for historical reasons) is + // the partition key column name however, which can be provided through thrift. If it is, make sure + // we use the one of the update. + boolean hasKeyAlias = cf_def.isSetKey_alias() !(cfm.keyValidator instanceof CompositeType); + if (hasKeyAlias) -cfm.column_metadata.put(cf_def.key_alias, ColumnDefinition.partitionKeyDef(cf_def.key_alias, cfm.keyValidator, null)); ++ cfm.addOrReplaceColumnDefinition(ColumnDefinition.partitionKeyDef(cfm, cf_def.key_alias, cfm.keyValidator, null)); + + for (ColumnDefinition def : toUpdate.allColumns()) + { + // isPartOfCellName basically means 'is not just a CQL metadata' + if (def.isPartOfCellName()) + continue; + -if (def.type == ColumnDefinition.Type.PARTITION_KEY hasKeyAlias) ++if (def.kind ==
[jira] [Resolved] (CASSANDRA-6874) CQL3 docs doesn't document conditional DELETE
[ https://issues.apache.org/jira/browse/CASSANDRA-6874?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sylvain Lebresne resolved CASSANDRA-6874. - Resolution: Duplicate I actually fixed that part of the doc as part of CASSANDRA-7055. I'll probably only push the update public when 2.0.8 is out though because due to CASSANDRA-7055 the doc references a CQL version that will only be in 2.0.8. CQL3 docs doesn't document conditional DELETE - Key: CASSANDRA-6874 URL: https://issues.apache.org/jira/browse/CASSANDRA-6874 Project: Cassandra Issue Type: Bug Components: Documentation website Reporter: Mohica Jasha Assignee: Tyler Hobbs Labels: documentation http://cassandra.apache.org/doc/cql3/CQL.html#deleteStmt doesn't document conditional {{DELETE}}. But support for if clause for {{DELETE}} was there from C* 2.0 -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-6572) Workload recording / playback
[ https://issues.apache.org/jira/browse/CASSANDRA-6572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985381#comment-13985381 ] Benedict commented on CASSANDRA-6572: - I wouldn't worry about the negligible amount of memory wasted storing the data - after all, if there are no new messages to log it means the server isn't serving any requests. A shutdown hook is probably easiest and sufficient, as a periodic flush would also miss any messages logged between last flush and shutdown. Workload recording / playback - Key: CASSANDRA-6572 URL: https://issues.apache.org/jira/browse/CASSANDRA-6572 Project: Cassandra Issue Type: New Feature Components: Core, Tools Reporter: Jonathan Ellis Assignee: Lyuben Todorov Fix For: 2.1.1 Attachments: 6572-trunk.diff Write sample mode gets us part way to testing new versions against a real world workload, but we need an easy way to test the query side as well. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Resolved] (CASSANDRA-7099) Concurrent instances of same Prepared Statement seeing intermingled result sets
[ https://issues.apache.org/jira/browse/CASSANDRA-7099?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bill Mitchell resolved CASSANDRA-7099. -- Resolution: Not a Problem This problem would seem to be my fault. In the normal, non parallel case, one can cheat. One can bind a PreparedStatement, execute it, process its result set, then bind a different parameter value and execute the same BoundStatement again. This does not work when the resultSet size exceeds the fetch size. The initial segments are all fetched fine, but the Java Driver apparently uses the BoundStatement to distinguish the queries. If one executes the same BoundStatement object, with different values, to generate multiple result sets, the Java driver or Cassandra get quite confused as to which results to return to which query. Building distinct BoundStatement objects and executing each just once avoids the confusion. Concurrent instances of same Prepared Statement seeing intermingled result sets --- Key: CASSANDRA-7099 URL: https://issues.apache.org/jira/browse/CASSANDRA-7099 Project: Cassandra Issue Type: Bug Components: Core Environment: Cassandra 2.0.7 with single node cluster Windows dual-core laptop DataStax Java driver 2.0.1 Reporter: Bill Mitchell I have a schema in which a wide row is partitioned into smaller rows. (See CASSANDRA-6826, CASSANDRA-6825 for more detail on this schema.) In this case, I randomly assigned the rows across the partitions based on the first four hex digits of a hash value modulo the number of partitions. Occasionally I need to retrieve the rows in order of insertion irrespective of the partitioning. Cassandra, of course, does not support this when paging by fetch size is enabled, so I am issuing a query against each of the partitions to obtain their rows in order, and merging the results: SELECT l, partition, cd, rd, ec, ea FROM sr WHERE s = ?, l = ?, partition = ? ORDER BY cd ASC, ec ASC ALLOW FILTERING; These parallel queries are all instances of a single PreparedStatement. What I saw was identical values from multiple queries, which by construction should never happen, and after further investigation, discovered that rows from partition 5 are being returned in the result set for the query against another partition, e.g., 1. This was so unbelievable that I added diagnostic code in my test case to detect this: After reading 167 rows, returned partition 5 does not match query partition 4 The merge logic works fine and delivers correct results when I use LIMIT to avoid fetch size paging. Even if there were a bug there, it is hard to see how any client error explains ResultSet.one() returning a row whose values don't match the constraints in that ResultSet's query. I'm not sure of the exact significance of 167, as I have configured the queryFetchSize for the cluster to 1000, and in this merge logic I divide that by the number of partitions, 7, so the fetchSize for each of these parallel queries was set to 142. I suspect this is being treated as a minimum fetchSize, and the driver or server is rounding this up to fill a transmission block. When I prime the pump, issuing the query against each of the partitions, the initial contents of the result sets are correct. The failure appears after we advance two of these queries to the next page. Although I had been experimenting with fetchMoreResults() for prefetching, I disabled that to isolate this problem, so that is not a factor. I have not yet tried preparing separate instances of the query, as I already have common logic to cache and reuse already prepared statements. I have not proven that it is a server bug and not a Java driver bug, but on first glance it was not obvious how the Java driver might associate the responses with the wrong requests. Were that happening, one would expect to see the right overall collection of rows, just to the wrong queries, and not duplicates, which is what I saw. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-6861) Optimise our Netty 4 integration
[ https://issues.apache.org/jira/browse/CASSANDRA-6861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985516#comment-13985516 ] T Jake Luciani commented on CASSANDRA-6861: --- Yeah, looks like thrift hsha is about as poor. Optimise our Netty 4 integration Key: CASSANDRA-6861 URL: https://issues.apache.org/jira/browse/CASSANDRA-6861 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: T Jake Luciani Priority: Minor Labels: performance Fix For: 2.1 beta2 Now we've upgraded to Netty 4, we're generating a lot of garbage that could be avoided, so we should probably stop that. Should be reasonably easy to hook into Netty's pooled buffers, returning them to the pool once a given message is completed. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7099) Concurrent instances of same Prepared Statement seeing intermingled result sets
[ https://issues.apache.org/jira/browse/CASSANDRA-7099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985529#comment-13985529 ] Jack Krupansky commented on CASSANDRA-7099: --- It may have been your mistake, but could C* or the driver have detected the difficulty and reported an error? Concurrent instances of same Prepared Statement seeing intermingled result sets --- Key: CASSANDRA-7099 URL: https://issues.apache.org/jira/browse/CASSANDRA-7099 Project: Cassandra Issue Type: Bug Components: Core Environment: Cassandra 2.0.7 with single node cluster Windows dual-core laptop DataStax Java driver 2.0.1 Reporter: Bill Mitchell I have a schema in which a wide row is partitioned into smaller rows. (See CASSANDRA-6826, CASSANDRA-6825 for more detail on this schema.) In this case, I randomly assigned the rows across the partitions based on the first four hex digits of a hash value modulo the number of partitions. Occasionally I need to retrieve the rows in order of insertion irrespective of the partitioning. Cassandra, of course, does not support this when paging by fetch size is enabled, so I am issuing a query against each of the partitions to obtain their rows in order, and merging the results: SELECT l, partition, cd, rd, ec, ea FROM sr WHERE s = ?, l = ?, partition = ? ORDER BY cd ASC, ec ASC ALLOW FILTERING; These parallel queries are all instances of a single PreparedStatement. What I saw was identical values from multiple queries, which by construction should never happen, and after further investigation, discovered that rows from partition 5 are being returned in the result set for the query against another partition, e.g., 1. This was so unbelievable that I added diagnostic code in my test case to detect this: After reading 167 rows, returned partition 5 does not match query partition 4 The merge logic works fine and delivers correct results when I use LIMIT to avoid fetch size paging. Even if there were a bug there, it is hard to see how any client error explains ResultSet.one() returning a row whose values don't match the constraints in that ResultSet's query. I'm not sure of the exact significance of 167, as I have configured the queryFetchSize for the cluster to 1000, and in this merge logic I divide that by the number of partitions, 7, so the fetchSize for each of these parallel queries was set to 142. I suspect this is being treated as a minimum fetchSize, and the driver or server is rounding this up to fill a transmission block. When I prime the pump, issuing the query against each of the partitions, the initial contents of the result sets are correct. The failure appears after we advance two of these queries to the next page. Although I had been experimenting with fetchMoreResults() for prefetching, I disabled that to isolate this problem, so that is not a factor. I have not yet tried preparing separate instances of the query, as I already have common logic to cache and reuse already prepared statements. I have not proven that it is a server bug and not a Java driver bug, but on first glance it was not obvious how the Java driver might associate the responses with the wrong requests. Were that happening, one would expect to see the right overall collection of rows, just to the wrong queries, and not duplicates, which is what I saw. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-6875) CQL3: select multiple CQL rows in a single partition using IN
[ https://issues.apache.org/jira/browse/CASSANDRA-6875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985587#comment-13985587 ] Sylvain Lebresne commented on CASSANDRA-6875: - The overall principle looks good, but I feel this could use some more comments and/or made a little more clear. Mainly, the {{isMultiColumn}} path in {{SelectStatement.buildBound}} looks weird at face value: we're inside a loop that populates a {{ColumnNameBuilder}}, but the {{isMultiColumn}} path completely ignores both the iterated object and the builder. This work because it relies on the fact that when there is a multi-column restriction then it's the only one restriction (which is duplicated in the {{SelectStatement.columnRestrictions}} array), and that the value from such restriction is not a single column value but rather a fully built composite serialized value (which is not self evident from the method naming in particular). But it's hard to piece it all that together when you look at {{buildBound}} currently. Some comments would help, but I'd prefer going even further and move the {{isMultiColumn}} path outside of the loop (by looking up first if the first restriction in {{columnRestrictions}} is a multi-column one or not) since it has no reason to be in the loop. In fact, I'd go a tad further by making SelectStatement abstract and have 2 subClass, one for single-column restrictions with a {{SingleColumnRelation[] columnRestrictions}} array field as we have now, and one for multi-column that has just one non-array {{MultiColumnRestriction columnsRestriction}} field. After all, both cases exclude one another in the current implementation. Somewhat related, I'm slightly afraid that the parts about multi-column restrictions returning fully serialized composites (through Tuples.Value.get()) will not play nice with the 2.1 code, where we don't manipulate composites as opaque ByteBuffers anymore (concretely, Tuples will serialize the composite, but SelectStatement will have to deserialize it back right away to get a Composite, which will be both ugly and inefficient). So to avoid having to change everything on merge, I think it would be cleaner to make Tuples.Value return a list of (individual column) values instead of just one, and let SelectStatement build back the full composite name using a ColumnNameBuilder. Especially if you make the per-column and multi-column paths a tad more separated as suggested above, I suspect it might clarify things a bit. Other than that, a bunch of more minor comments and nits: * The {{SelectStatement.RawStatement.prepare()}} re-org patch breaks proper indentation at places (for instance, the indentation of parameters to 'new ColumnSpecification' in the first branch of udpateSingleColumnRestriction, though there is a few other places). Would be nice to fix those. * Can't we use {{QueryProcessor.instance.getPrepared}} instead of creating a only-for-test {{QueryProcessor.staticGetPrepared}}? Or at the very least leave such shortcuts in the tests where it belongs. * In Tuples.Literal.prepare, I'd prefer good ol'fashion indexed loop to iterate over 2 lists (feels clearer, and saves the allocator creation as a bonus). * In Tuples.Raw.makeInReceiver should probably be called makeReceiver (it's not related to IN). I'd also drop the spaces in the string generated (if only for consistency with the string generated in INRaw). As a side node, Raw.makeReceiver uses indexed iteration while INRaw.makeInReceiver don't, can't we make both consistent style wise for OCD sakes? * Why make methods of CQLStatement abstract (it's an interface)? Also, I'd rather add the QueryOptions parameter to the existing executeInternal and default to QueryOptions.DEFAULT when calling it, rather than having 2 methods. Though tbh, my preference would be to move the tests to dtest and leave those somewhat unrelated changes to another ticket, see below. * SingleColumnRelation.previousInTuple is now unused but not removed. * We could save one list allocation (instead of both toCreate and toUpdate) in SelectStatement.updateRestrictionsForRelation (for EQ and IN, we know it can only be a create, and for slices we can lookup with getExisting). * In Restriction, the {{values}} method is already at top-level, no reason to re-declare it for EQ. * It bothers me to start adding unit tests for CQL queries when all of our CQL tests are currently in dtest. I'd *much* rather keep it all in the dtests to avoid the confusion on where is what tested. CQL3: select multiple CQL rows in a single partition using IN - Key: CASSANDRA-6875 URL: https://issues.apache.org/jira/browse/CASSANDRA-6875 Project: Cassandra Issue Type: Bug Components: API Reporter: Nicolas
[jira] [Commented] (CASSANDRA-7099) Concurrent instances of same Prepared Statement seeing intermingled result sets
[ https://issues.apache.org/jira/browse/CASSANDRA-7099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985608#comment-13985608 ] Bill Mitchell commented on CASSANDRA-7099: -- My thought was that, if the Java driver were more clever, it might be possible to use the ResultSet to determine the correlation id when paging in more results, instead of the Statement. But there may be reasons why it wants to assume the Statement parameters have not changed, e.g., to avoid having to copy the bound parameters if it needs these to generate the later paged requests. Concurrent instances of same Prepared Statement seeing intermingled result sets --- Key: CASSANDRA-7099 URL: https://issues.apache.org/jira/browse/CASSANDRA-7099 Project: Cassandra Issue Type: Bug Components: Core Environment: Cassandra 2.0.7 with single node cluster Windows dual-core laptop DataStax Java driver 2.0.1 Reporter: Bill Mitchell I have a schema in which a wide row is partitioned into smaller rows. (See CASSANDRA-6826, CASSANDRA-6825 for more detail on this schema.) In this case, I randomly assigned the rows across the partitions based on the first four hex digits of a hash value modulo the number of partitions. Occasionally I need to retrieve the rows in order of insertion irrespective of the partitioning. Cassandra, of course, does not support this when paging by fetch size is enabled, so I am issuing a query against each of the partitions to obtain their rows in order, and merging the results: SELECT l, partition, cd, rd, ec, ea FROM sr WHERE s = ?, l = ?, partition = ? ORDER BY cd ASC, ec ASC ALLOW FILTERING; These parallel queries are all instances of a single PreparedStatement. What I saw was identical values from multiple queries, which by construction should never happen, and after further investigation, discovered that rows from partition 5 are being returned in the result set for the query against another partition, e.g., 1. This was so unbelievable that I added diagnostic code in my test case to detect this: After reading 167 rows, returned partition 5 does not match query partition 4 The merge logic works fine and delivers correct results when I use LIMIT to avoid fetch size paging. Even if there were a bug there, it is hard to see how any client error explains ResultSet.one() returning a row whose values don't match the constraints in that ResultSet's query. I'm not sure of the exact significance of 167, as I have configured the queryFetchSize for the cluster to 1000, and in this merge logic I divide that by the number of partitions, 7, so the fetchSize for each of these parallel queries was set to 142. I suspect this is being treated as a minimum fetchSize, and the driver or server is rounding this up to fill a transmission block. When I prime the pump, issuing the query against each of the partitions, the initial contents of the result sets are correct. The failure appears after we advance two of these queries to the next page. Although I had been experimenting with fetchMoreResults() for prefetching, I disabled that to isolate this problem, so that is not a factor. I have not yet tried preparing separate instances of the query, as I already have common logic to cache and reuse already prepared statements. I have not proven that it is a server bug and not a Java driver bug, but on first glance it was not obvious how the Java driver might associate the responses with the wrong requests. Were that happening, one would expect to see the right overall collection of rows, just to the wrong queries, and not duplicates, which is what I saw. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7107) General minor tidying of CollationController path
[ https://issues.apache.org/jira/browse/CASSANDRA-7107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985626#comment-13985626 ] Aleksey Yeschenko commented on CASSANDRA-7107: -- Have only skimmed it so far. Will have a deep look once the issues behind these two unit tests are fixed (caused by the patch): - org.apache.cassandra.cli.CliTest - org.apache.cassandra.db.ColumnFamilyStoreTest There are other tests failing, but those fail w/ and w/out the patch, both. General minor tidying of CollationController path - Key: CASSANDRA-7107 URL: https://issues.apache.org/jira/browse/CASSANDRA-7107 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Minor Fix For: 2.1.0 There is a lot of unnecessary boiler plate when grabbing an iterator from an in-memory column family. This patch: * Removes FakeCellName * Avoids wrapping a non-OnDiskAtomIterator as an OnDiskAtomIterator except when the wrapping is useful * Removes ColumnSlice.NavigableSetIterator and creates a simpler more direct equivalent in ABTC * Does not construct a SliceIterator in either ABSC or ABTC if only one slice is requested (just returns that slice as an Iterator) * Does not construct multiple list indirections in ABSC when constructing a slice * Shares forward/reverse iterators in ABSC between slices and full-iteration * Avoids O(N) comparisons during collation of results into an ABSC, by using the knowledge that all columns are provided in insertion order from a merge iterator -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7116) Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver
[ https://issues.apache.org/jira/browse/CASSANDRA-7116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benedict updated CASSANDRA-7116: Attachment: 7116.txt Trivial one-line patch Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver -- Key: CASSANDRA-7116 URL: https://issues.apache.org/jira/browse/CASSANDRA-7116 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Trivial Fix For: 2.1 rc1 Attachments: 7116.txt There's no reason to use a NBHM in this class, as we only add unique elements. A CLQ seems a more appropriate lightweight datastructure to use -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-6572) Workload recording / playback
[ https://issues.apache.org/jira/browse/CASSANDRA-6572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985649#comment-13985649 ] Lyuben Todorov commented on CASSANDRA-6572: --- Since queries are logged as their string form, this doesn't accommodate prepared statements. One way I think we can log the ps' is to log the string query during the prepare phase along with the query's id, e.g. {{b7693b50da63a31229b8413754bc72c0 INSERT INTO ks.cf (col1) VALUES (?) }} and then in ExecuteMessage#execute the values and the id can be logged again later on in the log, then during replay we can match values to the queryString by using the id. A better way to do it would be to get access to the statementId in QP#executePrepared but I'm not sure whether it's worth changing the statement to store it's id. Workload recording / playback - Key: CASSANDRA-6572 URL: https://issues.apache.org/jira/browse/CASSANDRA-6572 Project: Cassandra Issue Type: New Feature Components: Core, Tools Reporter: Jonathan Ellis Assignee: Lyuben Todorov Fix For: 2.1.1 Attachments: 6572-trunk.diff Write sample mode gets us part way to testing new versions against a real world workload, but we need an easy way to test the query side as well. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7099) Concurrent instances of same Prepared Statement seeing intermingled result sets
[ https://issues.apache.org/jira/browse/CASSANDRA-7099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985654#comment-13985654 ] Sylvain Lebresne commented on CASSANDRA-7099: - bq. it might be possible to use the ResultSet to determine the correlation id when paging in more results Fyi, the driver does need to send the full query (including bound parameters) for every page, not just an ID. This is not specific to the java driver, this is how the paging work in the protocol, and this is done so so that pages can be fetched from another coordinator than the one of the first page. That said, it's probably possible to make it easier driver side to reuse a BoundStatement more safely, or at least to clarify in the document when it's safe or not to do so. But that's a driver concern, so let's keep further discussion, if further discussion there is, on the driver mailing list/jira. Concurrent instances of same Prepared Statement seeing intermingled result sets --- Key: CASSANDRA-7099 URL: https://issues.apache.org/jira/browse/CASSANDRA-7099 Project: Cassandra Issue Type: Bug Components: Core Environment: Cassandra 2.0.7 with single node cluster Windows dual-core laptop DataStax Java driver 2.0.1 Reporter: Bill Mitchell I have a schema in which a wide row is partitioned into smaller rows. (See CASSANDRA-6826, CASSANDRA-6825 for more detail on this schema.) In this case, I randomly assigned the rows across the partitions based on the first four hex digits of a hash value modulo the number of partitions. Occasionally I need to retrieve the rows in order of insertion irrespective of the partitioning. Cassandra, of course, does not support this when paging by fetch size is enabled, so I am issuing a query against each of the partitions to obtain their rows in order, and merging the results: SELECT l, partition, cd, rd, ec, ea FROM sr WHERE s = ?, l = ?, partition = ? ORDER BY cd ASC, ec ASC ALLOW FILTERING; These parallel queries are all instances of a single PreparedStatement. What I saw was identical values from multiple queries, which by construction should never happen, and after further investigation, discovered that rows from partition 5 are being returned in the result set for the query against another partition, e.g., 1. This was so unbelievable that I added diagnostic code in my test case to detect this: After reading 167 rows, returned partition 5 does not match query partition 4 The merge logic works fine and delivers correct results when I use LIMIT to avoid fetch size paging. Even if there were a bug there, it is hard to see how any client error explains ResultSet.one() returning a row whose values don't match the constraints in that ResultSet's query. I'm not sure of the exact significance of 167, as I have configured the queryFetchSize for the cluster to 1000, and in this merge logic I divide that by the number of partitions, 7, so the fetchSize for each of these parallel queries was set to 142. I suspect this is being treated as a minimum fetchSize, and the driver or server is rounding this up to fill a transmission block. When I prime the pump, issuing the query against each of the partitions, the initial contents of the result sets are correct. The failure appears after we advance two of these queries to the next page. Although I had been experimenting with fetchMoreResults() for prefetching, I disabled that to isolate this problem, so that is not a factor. I have not yet tried preparing separate instances of the query, as I already have common logic to cache and reuse already prepared statements. I have not proven that it is a server bug and not a Java driver bug, but on first glance it was not obvious how the Java driver might associate the responses with the wrong requests. Were that happening, one would expect to see the right overall collection of rows, just to the wrong queries, and not duplicates, which is what I saw. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Comment Edited] (CASSANDRA-6572) Workload recording / playback
[ https://issues.apache.org/jira/browse/CASSANDRA-6572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985649#comment-13985649 ] Lyuben Todorov edited comment on CASSANDRA-6572 at 4/30/14 3:55 PM: Since queries are logged as their string form, this doesn't accommodate prepared statements. One way I think we can log the ps' is to log the string query during the prepare phase along with the query's id, e.g. {{b7693b50da63a31229b8413754bc72c0 INSERT INTO ks.cf (col1) VALUES ( \? )}} and then in {{ExecuteMessage#execute}} the values and the id can be logged again later on in the log, then during replay we can match values to the queryString by using the id. A better way to do it would be to get access to the statementId in QP#executePrepared but I'm not sure whether it's worth changing the statement to store it's id. was (Author: lyubent): Since queries are logged as their string form, this doesn't accommodate prepared statements. One way I think we can log the ps' is to log the string query during the prepare phase along with the query's id, e.g. {{b7693b50da63a31229b8413754bc72c0 INSERT INTO ks.cf (col1) VALUES (?) }} and then in ExecuteMessage#execute the values and the id can be logged again later on in the log, then during replay we can match values to the queryString by using the id. A better way to do it would be to get access to the statementId in QP#executePrepared but I'm not sure whether it's worth changing the statement to store it's id. Workload recording / playback - Key: CASSANDRA-6572 URL: https://issues.apache.org/jira/browse/CASSANDRA-6572 Project: Cassandra Issue Type: New Feature Components: Core, Tools Reporter: Jonathan Ellis Assignee: Lyuben Todorov Fix For: 2.1.1 Attachments: 6572-trunk.diff Write sample mode gets us part way to testing new versions against a real world workload, but we need an easy way to test the query side as well. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (CASSANDRA-7116) Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver
Benedict created CASSANDRA-7116: --- Summary: Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver Key: CASSANDRA-7116 URL: https://issues.apache.org/jira/browse/CASSANDRA-7116 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Trivial Fix For: 2.1 rc1 Attachments: 7116.txt There's no reason to use a NBHM in this class, as we only add unique elements. A CLQ seems a more appropriate lightweight datastructure to use -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-4718) More-efficient ExecutorService for improved throughput
[ https://issues.apache.org/jira/browse/CASSANDRA-4718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985658#comment-13985658 ] Benedict commented on CASSANDRA-4718: - I've uploaded a slight variant of the patch [here|https://github.com/belliottsmith/cassandra/tree/4718-lowsignal] - this introduces a special FJP for that processing native transport work, that avoids blocking on enqueue to the pool unless the configured limit has been reached. Instead we schedule a ForkJoinTask that sleeps for 5us, forking any work that has been queued in the interval (and going to sleep only if no work has been seen in the past 5ms). This permits the connection worker threads to return to servicing their connections more promptly. It has only a modest effect on my box, but it does give a 5-10% bump in native transport performance. More-efficient ExecutorService for improved throughput -- Key: CASSANDRA-4718 URL: https://issues.apache.org/jira/browse/CASSANDRA-4718 Project: Cassandra Issue Type: Improvement Reporter: Jonathan Ellis Assignee: Jason Brown Priority: Minor Labels: performance Fix For: 2.1.0 Attachments: 4718-v1.patch, PerThreadQueue.java, baq vs trunk.png, op costs of various queues.ods, stress op rate with various queues.ods, v1-stress.out Currently all our execution stages dequeue tasks one at a time. This can result in contention between producers and consumers (although we do our best to minimize this by using LinkedBlockingQueue). One approach to mitigating this would be to make consumer threads do more work in bulk instead of just one task per dequeue. (Producer threads tend to be single-task oriented by nature, so I don't see an equivalent opportunity there.) BlockingQueue has a drainTo(collection, int) method that would be perfect for this. However, no ExecutorService in the jdk supports using drainTo, nor could I google one. What I would like to do here is create just such a beast and wire it into (at least) the write and read stages. (Other possible candidates for such an optimization, such as the CommitLog and OutboundTCPConnection, are not ExecutorService-based and will need to be one-offs.) AbstractExecutorService may be useful. The implementations of ICommitLogExecutorService may also be useful. (Despite the name these are not actual ExecutorServices, although they share the most important properties of one.) -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-6861) Optimise our Netty 4 integration
[ https://issues.apache.org/jira/browse/CASSANDRA-6861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985659#comment-13985659 ] Benedict commented on CASSANDRA-6861: - It may be worth trying netty's JNI epoll provider whilst we're at this Optimise our Netty 4 integration Key: CASSANDRA-6861 URL: https://issues.apache.org/jira/browse/CASSANDRA-6861 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: T Jake Luciani Priority: Minor Labels: performance Fix For: 2.1 beta2 Now we've upgraded to Netty 4, we're generating a lot of garbage that could be avoided, so we should probably stop that. Should be reasonably easy to hook into Netty's pooled buffers, returning them to the pool once a given message is completed. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-6559) cqlsh should warn about ALLOW FILTERING
[ https://issues.apache.org/jira/browse/CASSANDRA-6559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985660#comment-13985660 ] Jonathan Ellis commented on CASSANDRA-6559: --- There's tension between smooth the learning curve for new users so they don't ragequit and go use mongo instead and make it harder for people to shoot themselves in the foot. We're going to continue to optimize for the former, but adding cqlsh-side warning is reasonable. cqlsh should warn about ALLOW FILTERING --- Key: CASSANDRA-6559 URL: https://issues.apache.org/jira/browse/CASSANDRA-6559 Project: Cassandra Issue Type: Bug Components: Tools Reporter: Tupshin Harper Assignee: Aleksey Yeschenko Priority: Minor Fix For: 2.0.8 ALLOW FILTERING can be a convenience for preliminary exploration of your data, and can be useful for batch jobs, but it is such an anti-pattern for regular production queries, that cqlsh should provie an explicit warn ingwhenever such a query is performed. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7116) Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver
[ https://issues.apache.org/jira/browse/CASSANDRA-7116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985663#comment-13985663 ] Jonathan Ellis commented on CASSANDRA-7116: --- Is CLQ lighter weight? Because a queue implies that order is important, which it is not here. So abstractly speaking I like the Set better. Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver -- Key: CASSANDRA-7116 URL: https://issues.apache.org/jira/browse/CASSANDRA-7116 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Trivial Fix For: 2.1 rc1 Attachments: 7116.txt There's no reason to use a NBHM in this class, as we only add unique elements. A CLQ seems a more appropriate lightweight datastructure to use -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7116) Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver
[ https://issues.apache.org/jira/browse/CASSANDRA-7116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985669#comment-13985669 ] Benedict commented on CASSANDRA-7116: - Well, for small collections (like we have here) it's lighter weight memory-wise, and it's faster - at the very least because it has no need to invoke the object hashCode() which involves revoking the biased lock on the object, but also because on a small map you can still have collisions which require at least rehashing, and possibly resizing (NBHM resizes when you have too many collisions, not based on total size, iirc). CLQ is guaranteed O(1) behaviour, and a constant 16 bytes per entry Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver -- Key: CASSANDRA-7116 URL: https://issues.apache.org/jira/browse/CASSANDRA-7116 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Trivial Fix For: 2.1 rc1 Attachments: 7116.txt There's no reason to use a NBHM in this class, as we only add unique elements. A CLQ seems a more appropriate lightweight datastructure to use -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7116) Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver
[ https://issues.apache.org/jira/browse/CASSANDRA-7116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985675#comment-13985675 ] Benedict commented on CASSANDRA-7116: - To put it another way, the Set imposes a uniqueness constraint, and the CLQ imposes an ordering constraint, but the ordering constraint is cheaper to maintain. That said, I'd be happy to use a lock-free stack here as well, which is even easier/cheaper to maintain; or simply an atomic index pointer and an atomic reference array. Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver -- Key: CASSANDRA-7116 URL: https://issues.apache.org/jira/browse/CASSANDRA-7116 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Trivial Fix For: 2.1 rc1 Attachments: 7116.txt There's no reason to use a NBHM in this class, as we only add unique elements. A CLQ seems a more appropriate lightweight datastructure to use -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7111) Include snippet of CQL query near error in SyntaxError messages
[ https://issues.apache.org/jira/browse/CASSANDRA-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jonathan Ellis updated CASSANDRA-7111: -- Component/s: (was: Core) Tools API Can we target this for 2.1.1 or would it break assumptions of what a SyntaxError should contain? Include snippet of CQL query near error in SyntaxError messages --- Key: CASSANDRA-7111 URL: https://issues.apache.org/jira/browse/CASSANDRA-7111 Project: Cassandra Issue Type: Improvement Components: API, Tools Reporter: Tyler Hobbs Priority: Minor When a SyntaxError is returned, including a snippet of the query close to the error would make a lot of error messages easier to understand. For example, if you did this with the python driver: {code} session.execute(SELECT * FROM users WHERE username='%s', ['Joe Smith']) {code} you would wind up with an extra set of single quotes (the driver automatically escapes and quotes input). If a snippet like {{...WHERE username=''Joe Smith''}} were included in the error message, this would be pretty easy to spot. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-6572) Workload recording / playback
[ https://issues.apache.org/jira/browse/CASSANDRA-6572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985695#comment-13985695 ] Benedict commented on CASSANDRA-6572: - It might be easiest to modify QP.processPrepared to accept the statementId as an extra parameter, to keep everything encapsulated in QP Workload recording / playback - Key: CASSANDRA-6572 URL: https://issues.apache.org/jira/browse/CASSANDRA-6572 Project: Cassandra Issue Type: New Feature Components: Core, Tools Reporter: Jonathan Ellis Assignee: Lyuben Todorov Fix For: 2.1.1 Attachments: 6572-trunk.diff Write sample mode gets us part way to testing new versions against a real world workload, but we need an easy way to test the query side as well. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7111) Include snippet of CQL query near error in SyntaxError messages
[ https://issues.apache.org/jira/browse/CASSANDRA-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985705#comment-13985705 ] Tyler Hobbs commented on CASSANDRA-7111: The snippet could just be inserted into the normal message without breaking compatibility. I don't think any of the drivers try to parse the message or anything like that. Include snippet of CQL query near error in SyntaxError messages --- Key: CASSANDRA-7111 URL: https://issues.apache.org/jira/browse/CASSANDRA-7111 Project: Cassandra Issue Type: Improvement Components: API, Tools Reporter: Tyler Hobbs Priority: Minor When a SyntaxError is returned, including a snippet of the query close to the error would make a lot of error messages easier to understand. For example, if you did this with the python driver: {code} session.execute(SELECT * FROM users WHERE username='%s', ['Joe Smith']) {code} you would wind up with an extra set of single quotes (the driver automatically escapes and quotes input). If a snippet like {{...WHERE username=''Joe Smith''}} were included in the error message, this would be pretty easy to spot. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (CASSANDRA-7117) cqlsh should return a non-zero error code if a query fails
J.B. Langston created CASSANDRA-7117: Summary: cqlsh should return a non-zero error code if a query fails Key: CASSANDRA-7117 URL: https://issues.apache.org/jira/browse/CASSANDRA-7117 Project: Cassandra Issue Type: Improvement Reporter: J.B. Langston Priority: Minor cqlsh should return a non-zero error code when the last query in a file or piped stdin fails. This is so that shell scripts to determine if a cql script failed or succeeded. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7117) cqlsh should return a non-zero error code if a query fails
[ https://issues.apache.org/jira/browse/CASSANDRA-7117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] J.B. Langston updated CASSANDRA-7117: - Description: cqlsh should return a non-zero error code when a query in a file or piped stdin fails. This is so that shell scripts to determine if a cql script failed or succeeded. (was: cqlsh should return a non-zero error code when the last query in a file or piped stdin fails. This is so that shell scripts to determine if a cql script failed or succeeded.) cqlsh should return a non-zero error code if a query fails -- Key: CASSANDRA-7117 URL: https://issues.apache.org/jira/browse/CASSANDRA-7117 Project: Cassandra Issue Type: Improvement Reporter: J.B. Langston Priority: Minor cqlsh should return a non-zero error code when a query in a file or piped stdin fails. This is so that shell scripts to determine if a cql script failed or succeeded. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7116) Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver
[ https://issues.apache.org/jira/browse/CASSANDRA-7116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985726#comment-13985726 ] Jonathan Ellis commented on CASSANDRA-7116: --- Hmm, in CASSANDRA-6933 you sneaked in a change to Collections.synchronizedList for trunk. Which do you prefer? :) Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver -- Key: CASSANDRA-7116 URL: https://issues.apache.org/jira/browse/CASSANDRA-7116 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Trivial Fix For: 2.1 rc1 Attachments: 7116.txt There's no reason to use a NBHM in this class, as we only add unique elements. A CLQ seems a more appropriate lightweight datastructure to use -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7111) Include snippet of CQL query near error in SyntaxError messages
[ https://issues.apache.org/jira/browse/CASSANDRA-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jonathan Ellis updated CASSANDRA-7111: -- Fix Version/s: 2.1 rc1 Include snippet of CQL query near error in SyntaxError messages --- Key: CASSANDRA-7111 URL: https://issues.apache.org/jira/browse/CASSANDRA-7111 Project: Cassandra Issue Type: Improvement Components: API, Tools Reporter: Tyler Hobbs Priority: Minor Fix For: 2.1 rc1 When a SyntaxError is returned, including a snippet of the query close to the error would make a lot of error messages easier to understand. For example, if you did this with the python driver: {code} session.execute(SELECT * FROM users WHERE username='%s', ['Joe Smith']) {code} you would wind up with an extra set of single quotes (the driver automatically escapes and quotes input). If a snippet like {{...WHERE username=''Joe Smith''}} were included in the error message, this would be pretty easy to spot. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7111) Include snippet of CQL query near error in SyntaxError messages
[ https://issues.apache.org/jira/browse/CASSANDRA-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jonathan Ellis updated CASSANDRA-7111: -- Priority: Major (was: Minor) Include snippet of CQL query near error in SyntaxError messages --- Key: CASSANDRA-7111 URL: https://issues.apache.org/jira/browse/CASSANDRA-7111 Project: Cassandra Issue Type: Improvement Components: API, Tools Reporter: Tyler Hobbs Fix For: 2.1 rc1 When a SyntaxError is returned, including a snippet of the query close to the error would make a lot of error messages easier to understand. For example, if you did this with the python driver: {code} session.execute(SELECT * FROM users WHERE username='%s', ['Joe Smith']) {code} you would wind up with an extra set of single quotes (the driver automatically escapes and quotes input). If a snippet like {{...WHERE username=''Joe Smith''}} were included in the error message, this would be pretty easy to spot. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7116) Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver
[ https://issues.apache.org/jira/browse/CASSANDRA-7116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985741#comment-13985741 ] Benedict commented on CASSANDRA-7116: - Heh, whoops, snuck that past even myself :) CLQ is maybe slightly better because no biased lock revocation is necessary. But it's probably much of a muchness. Use ConcurrentLinkedQueue instead of NonBlockingHashSet in AbstractRowResolver -- Key: CASSANDRA-7116 URL: https://issues.apache.org/jira/browse/CASSANDRA-7116 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Trivial Fix For: 2.1 rc1 Attachments: 7116.txt There's no reason to use a NBHM in this class, as we only add unique elements. A CLQ seems a more appropriate lightweight datastructure to use -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (CASSANDRA-7118) Exception around IOException doesnt report file or table getting exception
Laura Adney created CASSANDRA-7118: -- Summary: Exception around IOException doesnt report file or table getting exception Key: CASSANDRA-7118 URL: https://issues.apache.org/jira/browse/CASSANDRA-7118 Project: Cassandra Issue Type: Improvement Reporter: Laura Adney Priority: Minor Saw this in Cassandra version: 1.2.11.2 Run into several situations where an IOException indicates that corruption has occurred. The exception does not provide the sstable or the table name making it very difficult to determine what files are involved. The request is to update the error/exception to include more relevant table/file information. Example Exception: ERROR [ReadStage:146665] 2014-02-25 06:28:18,286 CassandraDaemon.java (line 191) Exception in thread Thread[ReadStage:146665,5,main] java.lang.RuntimeException: org.apache.cassandra.io.sstable.CorruptSSTableException: java.io.EOFException at org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:1613) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: org.apache.cassandra.io.sstable.CorruptSSTableException: java.io.EOFException Caused by: java.io.EOFException at java.io.RandomAccessFile.readFully(RandomAccessFile.java:446) at java.io.RandomAccessFile.readFully(RandomAccessFile.java:424) at org.apache.cassandra.io.util.RandomAccessReader.readBytes(RandomAccessReader.java:380) at org.apache.cassandra.utils.ByteBufferUtil.read(ByteBufferUtil.java:392) at org.apache.cassandra.utils.ByteBufferUtil.readWithLength(ByteBufferUtil.java:355) at org.apache.cassandra.db.ColumnSerializer.deserializeColumnBody(ColumnSerializer.java:94) at org.apache.cassandra.db.OnDiskAtom$Serializer.deserializeFromSSTable(OnDiskAtom.java:92) at org.apache.cassandra.db.OnDiskAtom$Serializer.deserializeFromSSTable(OnDiskAtom.java:73) at org.apache.cassandra.db.columniterator.IndexedSliceReader$SimpleBlockFetcher.init(IndexedSliceReader.java:477) at org.apache.cassandra.db.columniterator.IndexedSliceReader.init(IndexedSliceReader.java:94) -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7117) cqlsh should return a non-zero error code if a query fails
[ https://issues.apache.org/jira/browse/CASSANDRA-7117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985737#comment-13985737 ] Jose Martinez Poblete commented on CASSANDRA-7117: -- This is an illustration of the described behavior {noformat} ubuntu@ip-10-182-163-57:~$ echo select count(*) from word limit 100; /tmp/bad.sql ubuntu@ip-10-182-163-57:~$ cqlsh -k Keyspace1 -f /tmp/bad.sql /tmp/bad.sql:2:Bad Request: unconfigured columnfamily word ubuntu@ip-10-182-163-57:~$ echo $? 0 ubuntu@ip-10-182-163-57:~$ echo select count(*) from words limit 100; /tmp/good.sql ubuntu@ip-10-182-163-57:~$ cqlsh -k Keyspace1 -f /tmp/good.sql count 650722 (1 rows) ubuntu@ip-10-182-163-57:~$ echo $? 0 ubuntu@ip-10-182-163-57:~$ {noformat} cqlsh should return a non-zero error code if a query fails -- Key: CASSANDRA-7117 URL: https://issues.apache.org/jira/browse/CASSANDRA-7117 Project: Cassandra Issue Type: Improvement Reporter: J.B. Langston Priority: Minor cqlsh should return a non-zero error code when a query in a file or piped stdin fails. This is so that shell scripts to determine if a cql script failed or succeeded. -- This message was sent by Atlassian JIRA (v6.2#6252)
[3/3] git commit: merge from 2.1
merge from 2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/8d993a47 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8d993a47 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8d993a47 Branch: refs/heads/trunk Commit: 8d993a476d48c1969793cf20eab23239b270b8c3 Parents: d9f06a3 74e96b4 Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 11:58:28 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 11:58:28 2014 -0500 -- .../org/apache/cassandra/service/AbstractRowResolver.java| 8 1 file changed, 4 insertions(+), 4 deletions(-) --
[2/3] git commit: change NBHS in ARR to CLQ patch by bes; reviewed by jbellis for CASSANDRA-7116
change NBHS in ARR to CLQ patch by bes; reviewed by jbellis for CASSANDRA-7116 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/74e96b46 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/74e96b46 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/74e96b46 Branch: refs/heads/trunk Commit: 74e96b460ae779e5823178108001871d4a10be7a Parents: 2269adb Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 11:46:51 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 11:57:48 2014 -0500 -- .../org/apache/cassandra/service/AbstractRowResolver.java | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/74e96b46/src/java/org/apache/cassandra/service/AbstractRowResolver.java -- diff --git a/src/java/org/apache/cassandra/service/AbstractRowResolver.java b/src/java/org/apache/cassandra/service/AbstractRowResolver.java index 47a00da..1fbb92b 100644 --- a/src/java/org/apache/cassandra/service/AbstractRowResolver.java +++ b/src/java/org/apache/cassandra/service/AbstractRowResolver.java @@ -18,9 +18,9 @@ package org.apache.cassandra.service; import java.nio.ByteBuffer; -import java.util.Set; +import java.util.Collection; +import java.util.concurrent.ConcurrentLinkedQueue; -import org.cliffc.high_scale_lib.NonBlockingHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,7 +34,8 @@ public abstract class AbstractRowResolver implements IResponseResolverReadRespo protected static final Logger logger = LoggerFactory.getLogger(AbstractRowResolver.class); protected final String keyspaceName; -protected final SetMessageInReadResponse replies = new NonBlockingHashSetMessageInReadResponse(); +// CLQ gives us thread-safety without the overhead of guaranteeing uniqueness like a Set would +protected final CollectionMessageInReadResponse replies = new ConcurrentLinkedQueue(); protected final DecoratedKey key; public AbstractRowResolver(ByteBuffer key, String keyspaceName)
[1/3] git commit: change NBHS in ARR to CLQ patch by bes; reviewed by jbellis for CASSANDRA-7116
Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 2269adba6 - 74e96b460 refs/heads/trunk d9f06a3be - 8d993a476 change NBHS in ARR to CLQ patch by bes; reviewed by jbellis for CASSANDRA-7116 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/74e96b46 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/74e96b46 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/74e96b46 Branch: refs/heads/cassandra-2.1 Commit: 74e96b460ae779e5823178108001871d4a10be7a Parents: 2269adb Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 11:46:51 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 11:57:48 2014 -0500 -- .../org/apache/cassandra/service/AbstractRowResolver.java | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/74e96b46/src/java/org/apache/cassandra/service/AbstractRowResolver.java -- diff --git a/src/java/org/apache/cassandra/service/AbstractRowResolver.java b/src/java/org/apache/cassandra/service/AbstractRowResolver.java index 47a00da..1fbb92b 100644 --- a/src/java/org/apache/cassandra/service/AbstractRowResolver.java +++ b/src/java/org/apache/cassandra/service/AbstractRowResolver.java @@ -18,9 +18,9 @@ package org.apache.cassandra.service; import java.nio.ByteBuffer; -import java.util.Set; +import java.util.Collection; +import java.util.concurrent.ConcurrentLinkedQueue; -import org.cliffc.high_scale_lib.NonBlockingHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,7 +34,8 @@ public abstract class AbstractRowResolver implements IResponseResolverReadRespo protected static final Logger logger = LoggerFactory.getLogger(AbstractRowResolver.class); protected final String keyspaceName; -protected final SetMessageInReadResponse replies = new NonBlockingHashSetMessageInReadResponse(); +// CLQ gives us thread-safety without the overhead of guaranteeing uniqueness like a Set would +protected final CollectionMessageInReadResponse replies = new ConcurrentLinkedQueue(); protected final DecoratedKey key; public AbstractRowResolver(ByteBuffer key, String keyspaceName)
[jira] [Resolved] (CASSANDRA-7117) cqlsh should return a non-zero error code if a query fails
[ https://issues.apache.org/jira/browse/CASSANDRA-7117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mikhail Stepura resolved CASSANDRA-7117. Resolution: Duplicate cqlsh should return a non-zero error code if a query fails -- Key: CASSANDRA-7117 URL: https://issues.apache.org/jira/browse/CASSANDRA-7117 Project: Cassandra Issue Type: Improvement Reporter: J.B. Langston Priority: Minor cqlsh should return a non-zero error code when a query in a file or piped stdin fails. This is so that shell scripts to determine if a cql script failed or succeeded. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (CASSANDRA-7119) Optimise isLive(System.currentTimeMillis()) + minor Cell cleanup
Aleksey Yeschenko created CASSANDRA-7119: Summary: Optimise isLive(System.currentTimeMillis()) + minor Cell cleanup Key: CASSANDRA-7119 URL: https://issues.apache.org/jira/browse/CASSANDRA-7119 Project: Cassandra Issue Type: Improvement Reporter: Aleksey Yeschenko Assignee: Aleksey Yeschenko Priority: Minor Fix For: 2.1 beta2 There are lots of Cell#isMakredForDeleteAt(System.currentTimeMillis()) and Cell#isLive(System.currentTimeMillis()) calls in the codebase - including in Cell#reconcile(), while we only need to pass the current time to the ExpiringCell. System.currentTimeMillis() is cheap, but not calling it at all is cheaper (and it's not *that* cheap when virtualised under certain configs). There is also another form - calling isMarkedForDelete() with Long.MIN_VALUE/Long.MAX_VALUE, when we know we aren't expecting an ExpiringCell, ever. So the patch adds an argument-less isLive() method that only calls System.currentTimeMillis() for ExpiringCell. To reduce duplication between Native* and Buffer*, isMarkedForDelete() has been removed entirely in favor of the shorter-to-type isLive() (plus I never really liked the name anyway). Also performs minor clean up and fixes one minor bug: - removes the unused Cell#getMarkedForDeleteAt() method - removes redundant Override-s in AbstractCell - corrects BufferCounterUpdateCell#reconcile() to sum the timestamps and not pick the max (must have slipped through 6694) -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7119) Optimise isLive(System.currentTimeMillis()) + minor Cell cleanup
[ https://issues.apache.org/jira/browse/CASSANDRA-7119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985771#comment-13985771 ] Aleksey Yeschenko commented on CASSANDRA-7119: -- Pushed the trivial commit to https://github.com/iamaleksey/cassandra/commits/7119 Optimise isLive(System.currentTimeMillis()) + minor Cell cleanup Key: CASSANDRA-7119 URL: https://issues.apache.org/jira/browse/CASSANDRA-7119 Project: Cassandra Issue Type: Improvement Reporter: Aleksey Yeschenko Assignee: Aleksey Yeschenko Priority: Minor Fix For: 2.1 beta2 There are lots of Cell#isMakredForDeleteAt(System.currentTimeMillis()) and Cell#isLive(System.currentTimeMillis()) calls in the codebase - including in Cell#reconcile(), while we only need to pass the current time to the ExpiringCell. System.currentTimeMillis() is cheap, but not calling it at all is cheaper (and it's not *that* cheap when virtualised under certain configs). There is also another form - calling isMarkedForDelete() with Long.MIN_VALUE/Long.MAX_VALUE, when we know we aren't expecting an ExpiringCell, ever. So the patch adds an argument-less isLive() method that only calls System.currentTimeMillis() for ExpiringCell. To reduce duplication between Native* and Buffer*, isMarkedForDelete() has been removed entirely in favor of the shorter-to-type isLive() (plus I never really liked the name anyway). Also performs minor clean up and fixes one minor bug: - removes the unused Cell#getMarkedForDeleteAt() method - removes redundant Override-s in AbstractCell - corrects BufferCounterUpdateCell#reconcile() to sum the timestamps and not pick the max (must have slipped through 6694) -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7119) Optimise isLive(System.currentTimeMillis()) + minor Cell cleanup
[ https://issues.apache.org/jira/browse/CASSANDRA-7119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aleksey Yeschenko updated CASSANDRA-7119: - Reviewer: Benedict Optimise isLive(System.currentTimeMillis()) + minor Cell cleanup Key: CASSANDRA-7119 URL: https://issues.apache.org/jira/browse/CASSANDRA-7119 Project: Cassandra Issue Type: Improvement Reporter: Aleksey Yeschenko Assignee: Aleksey Yeschenko Priority: Minor Fix For: 2.1 beta2 There are lots of Cell#isMakredForDeleteAt(System.currentTimeMillis()) and Cell#isLive(System.currentTimeMillis()) calls in the codebase - including in Cell#reconcile(), while we only need to pass the current time to the ExpiringCell. System.currentTimeMillis() is cheap, but not calling it at all is cheaper (and it's not *that* cheap when virtualised under certain configs). There is also another form - calling isMarkedForDelete() with Long.MIN_VALUE/Long.MAX_VALUE, when we know we aren't expecting an ExpiringCell, ever. So the patch adds an argument-less isLive() method that only calls System.currentTimeMillis() for ExpiringCell. To reduce duplication between Native* and Buffer*, isMarkedForDelete() has been removed entirely in favor of the shorter-to-type isLive() (plus I never really liked the name anyway). Also performs minor clean up and fixes one minor bug: - removes the unused Cell#getMarkedForDeleteAt() method - removes redundant Override-s in AbstractCell - corrects BufferCounterUpdateCell#reconcile() to sum the timestamps and not pick the max (must have slipped through 6694) -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Resolved] (CASSANDRA-7108) Enabling the Repair Service in OpsCenter generates imprecise repair errors
[ https://issues.apache.org/jira/browse/CASSANDRA-7108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nick Bailey resolved CASSANDRA-7108. Resolution: Invalid Nayden, This would be an OpsCenter bug and not a Cassandra bug. Unfortunately the OpsCenter bug tracker is not public. If you can email be at nick @ datastax with some more information I can get a bug created in our internal tracker. Specifically your node counts, dc information, and snitch information. Enabling the Repair Service in OpsCenter generates imprecise repair errors Key: CASSANDRA-7108 URL: https://issues.apache.org/jira/browse/CASSANDRA-7108 Project: Cassandra Issue Type: Bug Environment: Ubuntu 12.04, 12.10, 14.04 DSE version: 4.0.0 Cassandra version: 2.0.5.x (x = multiple, e.g. 22, 24) Reporter: nayden kolev Enabling the Repair Service in OpsCenter seems to trigger an error on every node, logged every few minutes (sample below). This does not happen if a nodetool repair keyspace command is issued. I have been able to reproduce it on 4 separate clusters over the past month or so, all of them running the latest DSE and Cassandra (2.0.5+) Error logged INFO [RMI TCP Connection(1350)-127.0.0.1] 2014-04-29 18:22:17,705 StorageService.java (line 2539) Starting repair command #6311, repairing 1 ranges for keyspace OpsCenter ERROR [RMI TCP Connection(1350)-127.0.0.1] 2014-04-29 18:22:17,710 StorageService.java (line 2560) Repair session failed: java.lang.IllegalArgumentException: Requested range intersects a local range but is not fully contained in one; this would lead to imprecise repair at org.apache.cassandra.service.ActiveRepairService.getNeighbors(ActiveRepairService.java:164) at org.apache.cassandra.repair.RepairSession.init(RepairSession.java:128) at org.apache.cassandra.repair.RepairSession.init(RepairSession.java:117) at org.apache.cassandra.service.ActiveRepairService.submitRepairSession(ActiveRepairService.java:97) at org.apache.cassandra.service.StorageService.forceKeyspaceRepair(StorageService.java:2620) at org.apache.cassandra.service.StorageService$5.runMayThrow(StorageService.java:2556) at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at org.apache.cassandra.service.StorageService.forceKeyspaceRepairRange(StorageService.java:2519) at org.apache.cassandra.service.StorageService.forceKeyspaceRepairRange(StorageService.java:2512) at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75) at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1487) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1328) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1420) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:848) at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
[jira] [Created] (CASSANDRA-7120) Bad paging state returned for prepared statements for last page
Tyler Hobbs created CASSANDRA-7120: -- Summary: Bad paging state returned for prepared statements for last page Key: CASSANDRA-7120 URL: https://issues.apache.org/jira/browse/CASSANDRA-7120 Project: Cassandra Issue Type: Bug Components: Core Reporter: Tyler Hobbs When executing a paged query with a prepared statement, a non-null paging state is sometimes being returned for the final page, causing an endless paging loop. Specifically, this is the schema being used: {noformat} CREATE KEYSPACE test3rf WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'}'; USE test3rf; CREATE TABLE test3rf.test ( k int PRIMARY KEY, v int ) {noformat} The inserts are like so: {noformat} INSERT INTO test3rf.test (k, v) VALUES (?, 0) {noformat} With values from [0, 99] used for k. The query is {{SELECT * FROM test3rf.test}} with a fetch size of 3. The final page returns the row with k=3, and the paging state is {{000400420004000176007fa2}}. This matches the paging state from three pages earlier. When executing this with a non-prepared statement, no paging state is returned for this page. This problem doesn't happen with the 2.0 branch. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7111) Include snippet of CQL query near error in SyntaxError messages
[ https://issues.apache.org/jira/browse/CASSANDRA-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985794#comment-13985794 ] Sylvain Lebresne commented on CASSANDRA-7111: - Yeah, I don't think we've ever promised not changing error messages, and even those maverick drivers that do parse error message probably just pattern match part of the message, so adding this wouldn't break them probably. So I wouldn't mind doing this even in 2.0 if the patch is trivial, which I think it will. The convenience it might bring to most users outweighs the very remote risk of breaking 1 or 2 users imo. Include snippet of CQL query near error in SyntaxError messages --- Key: CASSANDRA-7111 URL: https://issues.apache.org/jira/browse/CASSANDRA-7111 Project: Cassandra Issue Type: Improvement Components: API, Tools Reporter: Tyler Hobbs Fix For: 2.1 rc1 When a SyntaxError is returned, including a snippet of the query close to the error would make a lot of error messages easier to understand. For example, if you did this with the python driver: {code} session.execute(SELECT * FROM users WHERE username='%s', ['Joe Smith']) {code} you would wind up with an extra set of single quotes (the driver automatically escapes and quotes input). If a snippet like {{...WHERE username=''Joe Smith''}} were included in the error message, this would be pretty easy to spot. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-6855) Native protocol V3
[ https://issues.apache.org/jira/browse/CASSANDRA-6855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985792#comment-13985792 ] Tyler Hobbs commented on CASSANDRA-6855: +1 Native protocol V3 -- Key: CASSANDRA-6855 URL: https://issues.apache.org/jira/browse/CASSANDRA-6855 Project: Cassandra Issue Type: New Feature Reporter: Sylvain Lebresne Assignee: Sylvain Lebresne Fix For: 2.1 beta2 I think we need a V3 of the protocol for 2.1. The things that this could/should includes are: # Adding an optional Serial CL for protocol batches (like we have for QUERY and EXECUTE). It was an oversight of V2 of not adding it, and now that we can batch conditional updates, it's definitively missing. # Proper type codes for UDT. This is not *strictly* needed to be able to support UDT since currently a UDT will be sent as a custom type with his fully class name + arguments. But parsing that is no fun nor convenient for clients. It's also not particular space efficient (though that's probably not a huge concern since with prepared statement you can avoid sending the ResultSet metadata every time). # Serialization format for collections. Currently the serialization format only allow for 65K elements, each of 65K bytes size at most. While collections are not meant to store large amount of data, having the limitation in the protocol serialization format is the wrong way to deal with that. Concretely, the current workaround for CASSANDRA-5428 is ugly. I'll note that the current serialization format is also an obstacle to supporting null inside collections (whether or not we want to support null there is a good question, but here again I'm not sure being limited by the serialization format is a good idea). # CASSANDRA-6178: I continue to believe that in many case it makes somewhat more sense to have the default timestamp provided by the client (this is a necessary condition for true idempotent retries in particular). I'm absolutely fine making that optional and leaving server-side generated timestamps by default, but since client can already provide timestamp in query string anyway, I don't see a big deal in making it easier for client driver to control that without messing with the query string. # Optional names for values in QUERY messages: it has been brought to my attention that while V2 allows to send a query string with values for a one-roundtrip bind-and-execute, a driver can't really support named bind marker with that feature properly without parsing the query. The proposition is thus to make it (optionally) possible to ship the name of the marker each value is supposed to be bound to. I think that 1) and 2) are enough reason to make a V3 (even if there is disagreement on the rest that is). 3) is a little bit more involved tbh but I do think having the current limitations bolted in the protocol serialization format is wrong in the long run, and it turns out that due to UDT we will start storing serialized collections internally so if we want to lift said limitation in the serialization format, we should do it now and everywhere, as doing it afterwards will be a lot more painful. 4) and 5) are probably somewhat more minor, but at the same time, both are completely optional (a driver won't have to support those if he doesn't want). They are really just about making things more flexible for client drivers and they are not particularly hard to support so I don't see too many reasons not to include them. Last but not least, I know that some may find it wrong to do a new protocol version with each major of C*, so let me state my view here: I fully agree that we shouldn't make an habit of that in the long run and that's definitively *not* my objective. However, it would be silly to expect that we could get everything right and forget nothing in the very first version. It shouldn't be surprising that we'll have to burn a few versions (and there might be a few more yet) before getting something more stable and complete and I think that delaying the addition of stuffs that are useful to create some fake notion of stability would be even more silly. On the bright side, the additions of this V3 are comparatively much more simple to implement for a client that those of V2 (in fact, for clients that want to support UDT, it will probably require less effort to add the changes for this new version than to try to support UDT without it), so I do think we make good progress on getting the protocol stabilized -- This message was sent by Atlassian JIRA (v6.2#6252)
[1/3] git commit: switch README to asciidoc extension
Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 b4337228d - 50466aa49 refs/heads/trunk 8d993a476 - dbf3e1c57 switch README to asciidoc extension Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a8852ea7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a8852ea7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a8852ea7 Branch: refs/heads/cassandra-2.0 Commit: a8852ea7f2381971b59c6413fbaaa9111c8f9104 Parents: b433722 Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:17:16 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:17:16 2014 -0500 -- README.asc | 102 README.txt | 102 2 files changed, 102 insertions(+), 102 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8852ea7/README.asc -- diff --git a/README.asc b/README.asc new file mode 100644 index 000..320fdf8 --- /dev/null +++ b/README.asc @@ -0,0 +1,102 @@ + + +Cassandra is a highly scalable, eventually consistent, distributed, structured +key-value store. + + +Project description +--- + +Cassandra brings together the distributed systems technologies from Dynamo +and the data model from Google's BigTable. Like Dynamo, Cassandra is +eventually consistent. Like BigTable, Cassandra provides a ColumnFamily-based +data model richer than typical key/value systems. + +For more information see http://cassandra.apache.org/ + +Requirements + + * Java = 1.7 (OpenJDK and Sun have been tested) + +Getting started +--- + +This short guide will walk you through getting a basic one node cluster up +and running, and demonstrate some simple reads and writes. + + * tar -zxvf apache-cassandra-$VERSION.tar.gz + * cd apache-cassandra-$VERSION + * sudo mkdir -p /var/log/cassandra + * sudo chown -R `whoami` /var/log/cassandra + * sudo mkdir -p /var/lib/cassandra + * sudo chown -R `whoami` /var/lib/cassandra + +Note: The sample configuration files in conf/ determine the file-system +locations Cassandra uses for logging and data storage. You are free to +change these to suit your own environment and adjust the path names +used here accordingly. + +Now that we're ready, let's start it up! + + * bin/cassandra -f + +Unix: Running the startup script with the -f argument will cause +Cassandra to remain in the foreground and log to standard out. + +Windows: bin\cassandra.bat runs in the foreground by default. To +install Cassandra as a Windows service, download Procrun from +http://commons.apache.org/daemon/procrun.html, set the PRUNSRV +environment variable to the full path of prunsrv (e.g., +C:\procrun\prunsrv.exe), and run bin\cassandra.bat install. +Similarly, uninstall will remove the service. + +Now let's try to read and write some data using the Cassandra Query Language: + + * bin/cqlsh + +The command line client is interactive so if everything worked you should +be sitting in front of a prompt... + + Connected to Test Cluster at localhost:9160. + [cqlsh 2.2.0 | Cassandra 1.2.0 | CQL spec 3.0.0 | Thrift protocol 19.35.0] + Use HELP for help. + cqlsh + + +As the banner says, you can use 'help;' or '?' to see what CQL has to +offer, and 'quit;' or 'exit;' when you've had enough fun. But lets try +something slightly more interesting: + + cqlsh CREATE SCHEMA schema1 + WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; + cqlsh USE schema1; + cqlsh:Schema1 CREATE TABLE users ( + user_id varchar PRIMARY KEY, + first varchar, + last varchar, + age int + ); + cqlsh:Schema1 INSERT INTO users (user_id, first, last, age) + VALUES ('jsmith', 'John', 'Smith', 42); + cqlsh:Schema1 SELECT * FROM users; + user_id | age | first | last + -+-+---+--- +jsmith | 42 | john | smith + + cqlsh:Schema1 + +If your session looks similar to what's above, congrats, your single node +cluster is operational! + +For more on what commands are supported by CQL, see +https://github.com/apache/cassandra/blob/trunk/doc/cql3/CQL.textile. A +reasonable way to think of it is as, SQL minus joins and subqueries. + +Wondering where to go from here? + + * Getting started: http://wiki.apache.org/cassandra/GettingStarted + * Join us in #cassandra on irc.freenode.net and ask questions + * Subscribe to the Users mailing list by sending a mail to +user-subscr...@cassandra.apache.org + * Planet Cassandra aggregates Cassandra articles and news: +http://planetcassandra.org/
[3/3] git commit: fix build
fix build Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/dbf3e1c5 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/dbf3e1c5 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/dbf3e1c5 Branch: refs/heads/trunk Commit: dbf3e1c574d08dee0450feaf8cc7e0d4df0e0ba8 Parents: 8d993a4 Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:45:45 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:45:45 2014 -0500 -- src/java/org/apache/cassandra/service/AbstractRowResolver.java | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/dbf3e1c5/src/java/org/apache/cassandra/service/AbstractRowResolver.java -- diff --git a/src/java/org/apache/cassandra/service/AbstractRowResolver.java b/src/java/org/apache/cassandra/service/AbstractRowResolver.java index 1fbb92b..a84a6b6 100644 --- a/src/java/org/apache/cassandra/service/AbstractRowResolver.java +++ b/src/java/org/apache/cassandra/service/AbstractRowResolver.java @@ -18,7 +18,9 @@ package org.apache.cassandra.service; import java.nio.ByteBuffer; +import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.concurrent.ConcurrentLinkedQueue; import org.slf4j.Logger; @@ -34,8 +36,8 @@ public abstract class AbstractRowResolver implements IResponseResolverReadRespo protected static final Logger logger = LoggerFactory.getLogger(AbstractRowResolver.class); protected final String keyspaceName; -// CLQ gives us thread-safety without the overhead of guaranteeing uniqueness like a Set would -protected final CollectionMessageInReadResponse replies = new ConcurrentLinkedQueue(); +// synchronizedList gives us thread-safety without the overhead of guaranteeing uniqueness like a Set would +protected final CollectionMessageInReadResponse replies = Collections.synchronizedList(new ArrayListMessageInReadResponse()); protected final DecoratedKey key; public AbstractRowResolver(ByteBuffer key, String keyspaceName)
[2/3] git commit: wip
wip Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/50466aa4 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/50466aa4 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/50466aa4 Branch: refs/heads/cassandra-2.0 Commit: 50466aa490fc9d6324329696bcc56da9f7109d77 Parents: a8852ea Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:43:20 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:43:20 2014 -0500 -- README.asc | 109 +++- 1 file changed, 53 insertions(+), 56 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/50466aa4/README.asc -- diff --git a/README.asc b/README.asc index 320fdf8..1fd7cf7 100644 --- a/README.asc +++ b/README.asc @@ -1,22 +1,18 @@ +Executive summary +- +Cassandra is a partitioned row store. Rows are organized into tables with a required primary key. -Cassandra is a highly scalable, eventually consistent, distributed, structured -key-value store. +http://wiki.apache.org/cassandra/Partitioners[Partitioning] means that Cassandra can distribute your data across multiple machines in an application-transparent matter. Cassandra will automatically repartition as machines are added and removed from the cluster. +http://wiki.apache.org/cassandra/DataModel[Row store] means that like relational databases, Cassandra organizes data by rows and columns. The Cassandra Query Language (CQL) is a close relative of SQL. -Project description - -Cassandra brings together the distributed systems technologies from Dynamo -and the data model from Google's BigTable. Like Dynamo, Cassandra is -eventually consistent. Like BigTable, Cassandra provides a ColumnFamily-based -data model richer than typical key/value systems. - -For more information see http://cassandra.apache.org/ +For more information, see http://cassandra.apache.org/[the Apache Cassandra web site]. Requirements - * Java = 1.7 (OpenJDK and Sun have been tested) +. Java = 1.7 (OpenJDK and Oracle JVMS have been tested) +. Python 2.7 (for cqlsh) Getting started --- @@ -24,73 +20,74 @@ Getting started This short guide will walk you through getting a basic one node cluster up and running, and demonstrate some simple reads and writes. - * tar -zxvf apache-cassandra-$VERSION.tar.gz - * cd apache-cassandra-$VERSION - * sudo mkdir -p /var/log/cassandra - * sudo chown -R `whoami` /var/log/cassandra - * sudo mkdir -p /var/lib/cassandra - * sudo chown -R `whoami` /var/lib/cassandra +First, we'll unpack our archive: -Note: The sample configuration files in conf/ determine the file-system -locations Cassandra uses for logging and data storage. You are free to -change these to suit your own environment and adjust the path names -used here accordingly. + $ tar -zxvf apache-cassandra-$VERSION.tar.gz + $ cd apache-cassandra-$VERSION -Now that we're ready, let's start it up! +and create the log and data directories. These correspond to the defaults from conf/ and may be adjusted to suit your own environment: - * bin/cassandra -f + $ sudo mkdir -p /var/log/cassandra + $ sudo chown -R `whoami` /var/log/cassandra + $ sudo mkdir -p /var/lib/cassandra + $ sudo chown -R `whoami` /var/lib/cassandra -Unix: Running the startup script with the -f argument will cause -Cassandra to remain in the foreground and log to standard out. +Finally, we start the server. Running the startup script with the -f argument will cause +Cassandra to remain in the foreground and log to standard out; it can be stopped with ctrl-C. -Windows: bin\cassandra.bat runs in the foreground by default. To -install Cassandra as a Windows service, download Procrun from -http://commons.apache.org/daemon/procrun.html, set the PRUNSRV -environment variable to the full path of prunsrv (e.g., + $ bin/cassandra -f + + +Note for Windows users: to install Cassandra as a service, download +Procrun from http://commons.apache.org/daemon/procrun.html, set the +PRUNSRV environment variable to the full path of prunsrv (e.g., C:\procrun\prunsrv.exe), and run bin\cassandra.bat install. Similarly, uninstall will remove the service. + Now let's try to read and write some data using the Cassandra Query Language: - * bin/cqlsh + $ bin/cqlsh The command line client is interactive so if everything worked you should -be sitting in front of a prompt... - - Connected to Test Cluster at localhost:9160. - [cqlsh 2.2.0 | Cassandra 1.2.0 | CQL spec 3.0.0 | Thrift protocol 19.35.0] - Use HELP for help. - cqlsh +be sitting in front of a prompt: + +Connected to Test
[jira] [Commented] (CASSANDRA-6890) Standardize on a single read path
[ https://issues.apache.org/jira/browse/CASSANDRA-6890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985821#comment-13985821 ] Joshua McKenzie commented on CASSANDRA-6890: Running cql3 native, snappy compression, and mixed load w/1-to-1 ratio looks to have normalized a lot of the performance differential I was seeing. Using linux mmap as a baseline: Raw op/s: | |windows buffered|windows mmap|linux buffered|linux mmap| | 4 threadCount|2236|2171|1953|2111| | 8 threadCount|4716|4673|3955|4300| | 16 threadCount|7605|7529|6795|7465| | 24 threadCount|8662|9231|8341|8819| | 36 threadCount|13907|13147|13237|14451| | 54 threadCount|24039|24817|24177|26073| | 81 threadCount|39016|43673|34154|40929| |121 threadCount|40494|49513|42658|48313| |181 threadCount|53189|53039|49691|52885| |271 threadCount|53447|55354|54842|58779| |406 threadCount|54853|54295|60108|64675| |609 threadCount|60067|56145|61823|70885| |913 threadCount|57333|58483|60763|70398| % Comparison: | | windows buffered|windows mmap|linux buffered|linux mmap| | 4 threadCount|105.92%|102.84%|92.52%|100.00%| | 8 threadCount|109.67%|108.67%|91.98%|100.00%| | 16 threadCount|101.88%|100.86%|91.02%|100.00%| | 24 threadCount|98.22%|104.67%|94.58%|100.00%| | 36 threadCount|96.24%|90.98%|91.60%|100.00%| | 54 threadCount|92.20%|95.18%|92.73%|100.00%| | 81 threadCount|95.33%|106.70%|83.45%|100.00%| |121 threadCount|83.82%|102.48%|88.30%|100.00%| |181 threadCount|100.57%|100.29%|93.96%|100.00%| |271 threadCount|90.93%|94.17%|93.30%|100.00%| |406 threadCount|84.81%|83.95%|92.94%|100.00%| |609 threadCount|84.74%|79.21%|87.22%|100.00%| |913 threadCount|81.44%|83.07%|86.31%|100.00%| As Benedict indicated, and in-process page cache should make the debate between these two paths moot. The results above are quite close to the 10% threshold you've indicated Jonathan; I'd be comfortable normalizing the system on buffered I/O leading up to 3.0 to give us a single read path to migrate to an in-process page cache. I certainly don't see a need for us to keep the mmap'ed path on Windows as there doesn't appear to be a performance differential when using a more representative work-load on cql3. As an aside, do we have a documented set of suggestions on how people should approach stress-testing Cassandra, or perhaps a set of performance regression testing we do against releases? Nothing beats specialized expertise in tuning the stress workload to your expected usage patterns but it might help to give people a baseline and a starting point for their own testing. Pavel: I did record perf runs from both buffered and memory-mapped performance on linux, but given how close the results above are I don't know how much value we'll be able to pull from them. I can attach them to the ticket if you're still interested. Standardize on a single read path - Key: CASSANDRA-6890 URL: https://issues.apache.org/jira/browse/CASSANDRA-6890 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Joshua McKenzie Assignee: Joshua McKenzie Labels: performance Fix For: 3.0 Attachments: mmap_gc.jpg, mmap_jstat.txt, mmap_perf.txt, nommap_gc.jpg, nommap_jstat.txt Since we actively unmap unreferenced SSTR's and also copy data out of those readers on the read path, the current memory mapped i/o is a lot of complexity for very little payoff. Clean out the mmapp'ed i/o on the read path. -- This message was sent by Atlassian JIRA (v6.2#6252)
[04/10] git commit: wip
wip Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/50466aa4 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/50466aa4 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/50466aa4 Branch: refs/heads/trunk Commit: 50466aa490fc9d6324329696bcc56da9f7109d77 Parents: a8852ea Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:43:20 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:43:20 2014 -0500 -- README.asc | 109 +++- 1 file changed, 53 insertions(+), 56 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/50466aa4/README.asc -- diff --git a/README.asc b/README.asc index 320fdf8..1fd7cf7 100644 --- a/README.asc +++ b/README.asc @@ -1,22 +1,18 @@ +Executive summary +- +Cassandra is a partitioned row store. Rows are organized into tables with a required primary key. -Cassandra is a highly scalable, eventually consistent, distributed, structured -key-value store. +http://wiki.apache.org/cassandra/Partitioners[Partitioning] means that Cassandra can distribute your data across multiple machines in an application-transparent matter. Cassandra will automatically repartition as machines are added and removed from the cluster. +http://wiki.apache.org/cassandra/DataModel[Row store] means that like relational databases, Cassandra organizes data by rows and columns. The Cassandra Query Language (CQL) is a close relative of SQL. -Project description - -Cassandra brings together the distributed systems technologies from Dynamo -and the data model from Google's BigTable. Like Dynamo, Cassandra is -eventually consistent. Like BigTable, Cassandra provides a ColumnFamily-based -data model richer than typical key/value systems. - -For more information see http://cassandra.apache.org/ +For more information, see http://cassandra.apache.org/[the Apache Cassandra web site]. Requirements - * Java = 1.7 (OpenJDK and Sun have been tested) +. Java = 1.7 (OpenJDK and Oracle JVMS have been tested) +. Python 2.7 (for cqlsh) Getting started --- @@ -24,73 +20,74 @@ Getting started This short guide will walk you through getting a basic one node cluster up and running, and demonstrate some simple reads and writes. - * tar -zxvf apache-cassandra-$VERSION.tar.gz - * cd apache-cassandra-$VERSION - * sudo mkdir -p /var/log/cassandra - * sudo chown -R `whoami` /var/log/cassandra - * sudo mkdir -p /var/lib/cassandra - * sudo chown -R `whoami` /var/lib/cassandra +First, we'll unpack our archive: -Note: The sample configuration files in conf/ determine the file-system -locations Cassandra uses for logging and data storage. You are free to -change these to suit your own environment and adjust the path names -used here accordingly. + $ tar -zxvf apache-cassandra-$VERSION.tar.gz + $ cd apache-cassandra-$VERSION -Now that we're ready, let's start it up! +and create the log and data directories. These correspond to the defaults from conf/ and may be adjusted to suit your own environment: - * bin/cassandra -f + $ sudo mkdir -p /var/log/cassandra + $ sudo chown -R `whoami` /var/log/cassandra + $ sudo mkdir -p /var/lib/cassandra + $ sudo chown -R `whoami` /var/lib/cassandra -Unix: Running the startup script with the -f argument will cause -Cassandra to remain in the foreground and log to standard out. +Finally, we start the server. Running the startup script with the -f argument will cause +Cassandra to remain in the foreground and log to standard out; it can be stopped with ctrl-C. -Windows: bin\cassandra.bat runs in the foreground by default. To -install Cassandra as a Windows service, download Procrun from -http://commons.apache.org/daemon/procrun.html, set the PRUNSRV -environment variable to the full path of prunsrv (e.g., + $ bin/cassandra -f + + +Note for Windows users: to install Cassandra as a service, download +Procrun from http://commons.apache.org/daemon/procrun.html, set the +PRUNSRV environment variable to the full path of prunsrv (e.g., C:\procrun\prunsrv.exe), and run bin\cassandra.bat install. Similarly, uninstall will remove the service. + Now let's try to read and write some data using the Cassandra Query Language: - * bin/cqlsh + $ bin/cqlsh The command line client is interactive so if everything worked you should -be sitting in front of a prompt... - - Connected to Test Cluster at localhost:9160. - [cqlsh 2.2.0 | Cassandra 1.2.0 | CQL spec 3.0.0 | Thrift protocol 19.35.0] - Use HELP for help. - cqlsh +be sitting in front of a prompt: + +Connected to Test Cluster
[10/10] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/ad342470 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/ad342470 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/ad342470 Branch: refs/heads/trunk Commit: ad3424707fec9cecad3e5c9a18582cd9933d07ac Parents: dbf3e1c ece3864 Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:50:20 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:50:20 2014 -0500 -- README.asc | 99 ++ README.txt | 102 2 files changed, 99 insertions(+), 102 deletions(-) --
[09/10] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/ece38643 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/ece38643 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/ece38643 Branch: refs/heads/cassandra-2.1 Commit: ece386439b41144727412d57843bee1be839 Parents: 74e96b4 44a5fc1 Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:50:13 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:50:13 2014 -0500 -- README.asc | 99 ++ README.txt | 102 2 files changed, 99 insertions(+), 102 deletions(-) --
[07/10] git commit: formatting
formatting Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/44a5fc1d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/44a5fc1d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/44a5fc1d Branch: refs/heads/trunk Commit: 44a5fc1df7a90357415638b0ad8f1a4fb14354c3 Parents: 50466aa Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:50:05 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:50:05 2014 -0500 -- README.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/44a5fc1d/README.asc -- diff --git a/README.asc b/README.asc index 1fd7cf7..2e0a0e6 100644 --- a/README.asc +++ b/README.asc @@ -39,7 +39,7 @@ Cassandra to remain in the foreground and log to standard out; it can be stopped Note for Windows users: to install Cassandra as a service, download -Procrun from http://commons.apache.org/daemon/procrun.html, set the +http://commons.apache.org/daemon/procrun.html[Procrun], set the PRUNSRV environment variable to the full path of prunsrv (e.g., C:\procrun\prunsrv.exe), and run bin\cassandra.bat install. Similarly, uninstall will remove the service.
[jira] [Comment Edited] (CASSANDRA-6890) Standardize on a single read path
[ https://issues.apache.org/jira/browse/CASSANDRA-6890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985821#comment-13985821 ] Joshua McKenzie edited comment on CASSANDRA-6890 at 4/30/14 5:49 PM: - Running cql3 native, snappy compression, and mixed load w/1-to-1 ratio looks to have normalized a lot of the performance differential I was seeing. Using linux mmap as a baseline: Raw op/s: | |windows buffered|windows mmap|linux buffered|linux mmap| | 4 threadCount|2236|2171|1953|2111| | 8 threadCount|4716|4673|3955|4300| | 16 threadCount|7605|7529|6795|7465| | 24 threadCount|8662|9231|8341|8819| | 36 threadCount|13907|13147|13237|14451| | 54 threadCount|24039|24817|24177|26073| | 81 threadCount|39016|43673|34154|40929| |121 threadCount|40494|49513|42658|48313| |181 threadCount|53189|53039|49691|52885| |271 threadCount|53447|55354|54842|58779| |406 threadCount|54853|54295|60108|64675| |609 threadCount|60067|56145|61823|70885| |913 threadCount|57333|58483|60763|70398| % Comparison: | | windows buffered|windows mmap|linux buffered|linux mmap| | 4 threadCount|105.92%|102.84%|92.52%|100.00%| | 8 threadCount|109.67%|108.67%|91.98%|100.00%| | 16 threadCount|101.88%|100.86%|91.02%|100.00%| | 24 threadCount|98.22%|104.67%|94.58%|100.00%| | 36 threadCount|96.24%|90.98%|91.60%|100.00%| | 54 threadCount|92.20%|95.18%|92.73%|100.00%| | 81 threadCount|95.33%|106.70%|83.45%|100.00%| |121 threadCount|83.82%|102.48%|88.30%|100.00%| |181 threadCount|100.57%|100.29%|93.96%|100.00%| |271 threadCount|90.93%|94.17%|93.30%|100.00%| |406 threadCount|84.81%|83.95%|92.94%|100.00%| |609 threadCount|84.74%|79.21%|87.22%|100.00%| |913 threadCount|81.44%|83.07%|86.31%|100.00%| As Benedict indicated, an in-process page cache should make the debate between these two paths moot. The results above are quite close to the 10% threshold you've indicated Jonathan; I'd be comfortable normalizing the system on buffered I/O leading up to 3.0 to give us a single read path to migrate to an in-process page cache. I certainly don't see a need for us to keep the mmap'ed path on Windows as there doesn't appear to be a performance differential when using a more representative work-load on cql3. As an aside, do we have a documented set of suggestions on how people should approach stress-testing Cassandra, or perhaps a set of performance regression testing we do against releases? Nothing beats specialized expertise in tuning the stress workload to your expected usage patterns but it might help to give people a baseline and a starting point for their own testing. Pavel: I did record perf runs from both buffered and memory-mapped performance on linux, but given how close the results above are I don't know how much value we'll be able to pull from them. I can attach them to the ticket if you're still interested. was (Author: joshuamckenzie): Running cql3 native, snappy compression, and mixed load w/1-to-1 ratio looks to have normalized a lot of the performance differential I was seeing. Using linux mmap as a baseline: Raw op/s: | |windows buffered|windows mmap|linux buffered|linux mmap| | 4 threadCount|2236|2171|1953|2111| | 8 threadCount|4716|4673|3955|4300| | 16 threadCount|7605|7529|6795|7465| | 24 threadCount|8662|9231|8341|8819| | 36 threadCount|13907|13147|13237|14451| | 54 threadCount|24039|24817|24177|26073| | 81 threadCount|39016|43673|34154|40929| |121 threadCount|40494|49513|42658|48313| |181 threadCount|53189|53039|49691|52885| |271 threadCount|53447|55354|54842|58779| |406 threadCount|54853|54295|60108|64675| |609 threadCount|60067|56145|61823|70885| |913 threadCount|57333|58483|60763|70398| % Comparison: | | windows buffered|windows mmap|linux buffered|linux mmap| | 4 threadCount|105.92%|102.84%|92.52%|100.00%| | 8 threadCount|109.67%|108.67%|91.98%|100.00%| | 16 threadCount|101.88%|100.86%|91.02%|100.00%| | 24 threadCount|98.22%|104.67%|94.58%|100.00%| | 36 threadCount|96.24%|90.98%|91.60%|100.00%| | 54 threadCount|92.20%|95.18%|92.73%|100.00%| | 81 threadCount|95.33%|106.70%|83.45%|100.00%| |121 threadCount|83.82%|102.48%|88.30%|100.00%| |181 threadCount|100.57%|100.29%|93.96%|100.00%| |271 threadCount|90.93%|94.17%|93.30%|100.00%| |406 threadCount|84.81%|83.95%|92.94%|100.00%| |609 threadCount|84.74%|79.21%|87.22%|100.00%| |913 threadCount|81.44%|83.07%|86.31%|100.00%| As Benedict indicated, and in-process page cache should make the debate between these two paths moot. The results above are quite close to the 10% threshold you've indicated Jonathan; I'd be comfortable normalizing the system on buffered I/O leading up to 3.0 to give us a single read path to migrate to an in-process page cache. I certainly don't see a need for us to keep the mmap'ed path on Windows as there doesn't appear to be a performance differential when using a more representative work-load on cql3. As an
[03/10] git commit: wip
wip Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/50466aa4 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/50466aa4 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/50466aa4 Branch: refs/heads/cassandra-2.1 Commit: 50466aa490fc9d6324329696bcc56da9f7109d77 Parents: a8852ea Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:43:20 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:43:20 2014 -0500 -- README.asc | 109 +++- 1 file changed, 53 insertions(+), 56 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/50466aa4/README.asc -- diff --git a/README.asc b/README.asc index 320fdf8..1fd7cf7 100644 --- a/README.asc +++ b/README.asc @@ -1,22 +1,18 @@ +Executive summary +- +Cassandra is a partitioned row store. Rows are organized into tables with a required primary key. -Cassandra is a highly scalable, eventually consistent, distributed, structured -key-value store. +http://wiki.apache.org/cassandra/Partitioners[Partitioning] means that Cassandra can distribute your data across multiple machines in an application-transparent matter. Cassandra will automatically repartition as machines are added and removed from the cluster. +http://wiki.apache.org/cassandra/DataModel[Row store] means that like relational databases, Cassandra organizes data by rows and columns. The Cassandra Query Language (CQL) is a close relative of SQL. -Project description - -Cassandra brings together the distributed systems technologies from Dynamo -and the data model from Google's BigTable. Like Dynamo, Cassandra is -eventually consistent. Like BigTable, Cassandra provides a ColumnFamily-based -data model richer than typical key/value systems. - -For more information see http://cassandra.apache.org/ +For more information, see http://cassandra.apache.org/[the Apache Cassandra web site]. Requirements - * Java = 1.7 (OpenJDK and Sun have been tested) +. Java = 1.7 (OpenJDK and Oracle JVMS have been tested) +. Python 2.7 (for cqlsh) Getting started --- @@ -24,73 +20,74 @@ Getting started This short guide will walk you through getting a basic one node cluster up and running, and demonstrate some simple reads and writes. - * tar -zxvf apache-cassandra-$VERSION.tar.gz - * cd apache-cassandra-$VERSION - * sudo mkdir -p /var/log/cassandra - * sudo chown -R `whoami` /var/log/cassandra - * sudo mkdir -p /var/lib/cassandra - * sudo chown -R `whoami` /var/lib/cassandra +First, we'll unpack our archive: -Note: The sample configuration files in conf/ determine the file-system -locations Cassandra uses for logging and data storage. You are free to -change these to suit your own environment and adjust the path names -used here accordingly. + $ tar -zxvf apache-cassandra-$VERSION.tar.gz + $ cd apache-cassandra-$VERSION -Now that we're ready, let's start it up! +and create the log and data directories. These correspond to the defaults from conf/ and may be adjusted to suit your own environment: - * bin/cassandra -f + $ sudo mkdir -p /var/log/cassandra + $ sudo chown -R `whoami` /var/log/cassandra + $ sudo mkdir -p /var/lib/cassandra + $ sudo chown -R `whoami` /var/lib/cassandra -Unix: Running the startup script with the -f argument will cause -Cassandra to remain in the foreground and log to standard out. +Finally, we start the server. Running the startup script with the -f argument will cause +Cassandra to remain in the foreground and log to standard out; it can be stopped with ctrl-C. -Windows: bin\cassandra.bat runs in the foreground by default. To -install Cassandra as a Windows service, download Procrun from -http://commons.apache.org/daemon/procrun.html, set the PRUNSRV -environment variable to the full path of prunsrv (e.g., + $ bin/cassandra -f + + +Note for Windows users: to install Cassandra as a service, download +Procrun from http://commons.apache.org/daemon/procrun.html, set the +PRUNSRV environment variable to the full path of prunsrv (e.g., C:\procrun\prunsrv.exe), and run bin\cassandra.bat install. Similarly, uninstall will remove the service. + Now let's try to read and write some data using the Cassandra Query Language: - * bin/cqlsh + $ bin/cqlsh The command line client is interactive so if everything worked you should -be sitting in front of a prompt... - - Connected to Test Cluster at localhost:9160. - [cqlsh 2.2.0 | Cassandra 1.2.0 | CQL spec 3.0.0 | Thrift protocol 19.35.0] - Use HELP for help. - cqlsh +be sitting in front of a prompt: + +Connected to Test
[06/10] git commit: formatting
formatting Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/44a5fc1d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/44a5fc1d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/44a5fc1d Branch: refs/heads/cassandra-2.0 Commit: 44a5fc1df7a90357415638b0ad8f1a4fb14354c3 Parents: 50466aa Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:50:05 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:50:05 2014 -0500 -- README.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/44a5fc1d/README.asc -- diff --git a/README.asc b/README.asc index 1fd7cf7..2e0a0e6 100644 --- a/README.asc +++ b/README.asc @@ -39,7 +39,7 @@ Cassandra to remain in the foreground and log to standard out; it can be stopped Note for Windows users: to install Cassandra as a service, download -Procrun from http://commons.apache.org/daemon/procrun.html, set the +http://commons.apache.org/daemon/procrun.html[Procrun], set the PRUNSRV environment variable to the full path of prunsrv (e.g., C:\procrun\prunsrv.exe), and run bin\cassandra.bat install. Similarly, uninstall will remove the service.
[05/10] git commit: formatting
formatting Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/44a5fc1d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/44a5fc1d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/44a5fc1d Branch: refs/heads/cassandra-2.1 Commit: 44a5fc1df7a90357415638b0ad8f1a4fb14354c3 Parents: 50466aa Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:50:05 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:50:05 2014 -0500 -- README.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/44a5fc1d/README.asc -- diff --git a/README.asc b/README.asc index 1fd7cf7..2e0a0e6 100644 --- a/README.asc +++ b/README.asc @@ -39,7 +39,7 @@ Cassandra to remain in the foreground and log to standard out; it can be stopped Note for Windows users: to install Cassandra as a service, download -Procrun from http://commons.apache.org/daemon/procrun.html, set the +http://commons.apache.org/daemon/procrun.html[Procrun], set the PRUNSRV environment variable to the full path of prunsrv (e.g., C:\procrun\prunsrv.exe), and run bin\cassandra.bat install. Similarly, uninstall will remove the service.
[02/10] git commit: switch README to asciidoc extension
switch README to asciidoc extension Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a8852ea7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a8852ea7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a8852ea7 Branch: refs/heads/trunk Commit: a8852ea7f2381971b59c6413fbaaa9111c8f9104 Parents: b433722 Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:17:16 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:17:16 2014 -0500 -- README.asc | 102 README.txt | 102 2 files changed, 102 insertions(+), 102 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8852ea7/README.asc -- diff --git a/README.asc b/README.asc new file mode 100644 index 000..320fdf8 --- /dev/null +++ b/README.asc @@ -0,0 +1,102 @@ + + +Cassandra is a highly scalable, eventually consistent, distributed, structured +key-value store. + + +Project description +--- + +Cassandra brings together the distributed systems technologies from Dynamo +and the data model from Google's BigTable. Like Dynamo, Cassandra is +eventually consistent. Like BigTable, Cassandra provides a ColumnFamily-based +data model richer than typical key/value systems. + +For more information see http://cassandra.apache.org/ + +Requirements + + * Java = 1.7 (OpenJDK and Sun have been tested) + +Getting started +--- + +This short guide will walk you through getting a basic one node cluster up +and running, and demonstrate some simple reads and writes. + + * tar -zxvf apache-cassandra-$VERSION.tar.gz + * cd apache-cassandra-$VERSION + * sudo mkdir -p /var/log/cassandra + * sudo chown -R `whoami` /var/log/cassandra + * sudo mkdir -p /var/lib/cassandra + * sudo chown -R `whoami` /var/lib/cassandra + +Note: The sample configuration files in conf/ determine the file-system +locations Cassandra uses for logging and data storage. You are free to +change these to suit your own environment and adjust the path names +used here accordingly. + +Now that we're ready, let's start it up! + + * bin/cassandra -f + +Unix: Running the startup script with the -f argument will cause +Cassandra to remain in the foreground and log to standard out. + +Windows: bin\cassandra.bat runs in the foreground by default. To +install Cassandra as a Windows service, download Procrun from +http://commons.apache.org/daemon/procrun.html, set the PRUNSRV +environment variable to the full path of prunsrv (e.g., +C:\procrun\prunsrv.exe), and run bin\cassandra.bat install. +Similarly, uninstall will remove the service. + +Now let's try to read and write some data using the Cassandra Query Language: + + * bin/cqlsh + +The command line client is interactive so if everything worked you should +be sitting in front of a prompt... + + Connected to Test Cluster at localhost:9160. + [cqlsh 2.2.0 | Cassandra 1.2.0 | CQL spec 3.0.0 | Thrift protocol 19.35.0] + Use HELP for help. + cqlsh + + +As the banner says, you can use 'help;' or '?' to see what CQL has to +offer, and 'quit;' or 'exit;' when you've had enough fun. But lets try +something slightly more interesting: + + cqlsh CREATE SCHEMA schema1 + WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; + cqlsh USE schema1; + cqlsh:Schema1 CREATE TABLE users ( + user_id varchar PRIMARY KEY, + first varchar, + last varchar, + age int + ); + cqlsh:Schema1 INSERT INTO users (user_id, first, last, age) + VALUES ('jsmith', 'John', 'Smith', 42); + cqlsh:Schema1 SELECT * FROM users; + user_id | age | first | last + -+-+---+--- +jsmith | 42 | john | smith + + cqlsh:Schema1 + +If your session looks similar to what's above, congrats, your single node +cluster is operational! + +For more on what commands are supported by CQL, see +https://github.com/apache/cassandra/blob/trunk/doc/cql3/CQL.textile. A +reasonable way to think of it is as, SQL minus joins and subqueries. + +Wondering where to go from here? + + * Getting started: http://wiki.apache.org/cassandra/GettingStarted + * Join us in #cassandra on irc.freenode.net and ask questions + * Subscribe to the Users mailing list by sending a mail to +user-subscr...@cassandra.apache.org + * Planet Cassandra aggregates Cassandra articles and news: +http://planetcassandra.org/ http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8852ea7/README.txt
[08/10] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/ece38643 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/ece38643 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/ece38643 Branch: refs/heads/trunk Commit: ece386439b41144727412d57843bee1be839 Parents: 74e96b4 44a5fc1 Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:50:13 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:50:13 2014 -0500 -- README.asc | 99 ++ README.txt | 102 2 files changed, 99 insertions(+), 102 deletions(-) --
[01/10] git commit: switch README to asciidoc extension
Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 50466aa49 - 44a5fc1df refs/heads/cassandra-2.1 74e96b460 - ece386439 refs/heads/trunk dbf3e1c57 - ad3424707 switch README to asciidoc extension Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a8852ea7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a8852ea7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a8852ea7 Branch: refs/heads/cassandra-2.1 Commit: a8852ea7f2381971b59c6413fbaaa9111c8f9104 Parents: b433722 Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 12:17:16 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 12:17:16 2014 -0500 -- README.asc | 102 README.txt | 102 2 files changed, 102 insertions(+), 102 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8852ea7/README.asc -- diff --git a/README.asc b/README.asc new file mode 100644 index 000..320fdf8 --- /dev/null +++ b/README.asc @@ -0,0 +1,102 @@ + + +Cassandra is a highly scalable, eventually consistent, distributed, structured +key-value store. + + +Project description +--- + +Cassandra brings together the distributed systems technologies from Dynamo +and the data model from Google's BigTable. Like Dynamo, Cassandra is +eventually consistent. Like BigTable, Cassandra provides a ColumnFamily-based +data model richer than typical key/value systems. + +For more information see http://cassandra.apache.org/ + +Requirements + + * Java = 1.7 (OpenJDK and Sun have been tested) + +Getting started +--- + +This short guide will walk you through getting a basic one node cluster up +and running, and demonstrate some simple reads and writes. + + * tar -zxvf apache-cassandra-$VERSION.tar.gz + * cd apache-cassandra-$VERSION + * sudo mkdir -p /var/log/cassandra + * sudo chown -R `whoami` /var/log/cassandra + * sudo mkdir -p /var/lib/cassandra + * sudo chown -R `whoami` /var/lib/cassandra + +Note: The sample configuration files in conf/ determine the file-system +locations Cassandra uses for logging and data storage. You are free to +change these to suit your own environment and adjust the path names +used here accordingly. + +Now that we're ready, let's start it up! + + * bin/cassandra -f + +Unix: Running the startup script with the -f argument will cause +Cassandra to remain in the foreground and log to standard out. + +Windows: bin\cassandra.bat runs in the foreground by default. To +install Cassandra as a Windows service, download Procrun from +http://commons.apache.org/daemon/procrun.html, set the PRUNSRV +environment variable to the full path of prunsrv (e.g., +C:\procrun\prunsrv.exe), and run bin\cassandra.bat install. +Similarly, uninstall will remove the service. + +Now let's try to read and write some data using the Cassandra Query Language: + + * bin/cqlsh + +The command line client is interactive so if everything worked you should +be sitting in front of a prompt... + + Connected to Test Cluster at localhost:9160. + [cqlsh 2.2.0 | Cassandra 1.2.0 | CQL spec 3.0.0 | Thrift protocol 19.35.0] + Use HELP for help. + cqlsh + + +As the banner says, you can use 'help;' or '?' to see what CQL has to +offer, and 'quit;' or 'exit;' when you've had enough fun. But lets try +something slightly more interesting: + + cqlsh CREATE SCHEMA schema1 + WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; + cqlsh USE schema1; + cqlsh:Schema1 CREATE TABLE users ( + user_id varchar PRIMARY KEY, + first varchar, + last varchar, + age int + ); + cqlsh:Schema1 INSERT INTO users (user_id, first, last, age) + VALUES ('jsmith', 'John', 'Smith', 42); + cqlsh:Schema1 SELECT * FROM users; + user_id | age | first | last + -+-+---+--- +jsmith | 42 | john | smith + + cqlsh:Schema1 + +If your session looks similar to what's above, congrats, your single node +cluster is operational! + +For more on what commands are supported by CQL, see +https://github.com/apache/cassandra/blob/trunk/doc/cql3/CQL.textile. A +reasonable way to think of it is as, SQL minus joins and subqueries. + +Wondering where to go from here? + + * Getting started: http://wiki.apache.org/cassandra/GettingStarted + * Join us in #cassandra on irc.freenode.net and ask questions + * Subscribe to the Users mailing list by sending a mail to +user-subscr...@cassandra.apache.org + * Planet Cassandra aggregates Cassandra
[jira] [Updated] (CASSANDRA-6648) Race condition during node bootstrapping
[ https://issues.apache.org/jira/browse/CASSANDRA-6648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan McGuire updated CASSANDRA-6648: Labels: qa-resolved (was: ) Race condition during node bootstrapping Key: CASSANDRA-6648 URL: https://issues.apache.org/jira/browse/CASSANDRA-6648 Project: Cassandra Issue Type: Bug Components: Core Reporter: Sergio Bossa Assignee: Sergio Bossa Priority: Critical Labels: qa-resolved Fix For: 1.2.15, 2.0.5 Attachments: 6648-v2.txt, 6648-v3-1.2.txt, 6648-v3.txt, CASSANDRA-6648.patch When bootstrapping a new node, data is missing as if the new node didn't actually bootstrap, which I tracked down to the following scenario: 1) New node joins token ring and waits for schema to be settled before actually bootstrapping. 2) The schema scheck somewhat passes and it starts bootstrapping. 3) Bootstrapping doesn't find the ks/cf that should have received from the other node. 4) Queries at this point cause NPEs, until when later they recover but data is missed. The problem seems to be caused by a race condition between the migration manager and the bootstrapper, with the former running after the latter. I think this is supposed to protect against such scenarios: {noformat} while (!MigrationManager.isReadyForBootstrap()) { setMode(Mode.JOINING, waiting for schema information to complete, true); Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS); } {noformat} But MigrationManager.isReadyForBootstrap() implementation is quite fragile and doesn't take into account slow schema propagation. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-6285) 2.0 HSHA server introduces corrupt data
[ https://issues.apache.org/jira/browse/CASSANDRA-6285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan McGuire updated CASSANDRA-6285: Labels: qa-resolved (was: ) 2.0 HSHA server introduces corrupt data --- Key: CASSANDRA-6285 URL: https://issues.apache.org/jira/browse/CASSANDRA-6285 Project: Cassandra Issue Type: Bug Components: Core Environment: 4 nodes, shortly updated from 1.2.11 to 2.0.2 Reporter: David Sauer Assignee: Pavel Yaskevich Priority: Critical Labels: qa-resolved Fix For: 2.0.6 Attachments: 6285_testnotes1.txt, CASSANDRA-6285-disruptor-heap.patch, cassandra-attack-src.zip, compaction_test.py, disruptor-high-cpu.patch, disruptor-memory-corruption.patch After altering everything to LCS the table OpsCenter.rollups60 amd one other none OpsCenter-Table got stuck with everything hanging around in L0. The compaction started and ran until the logs showed this: ERROR [CompactionExecutor:111] 2013-11-01 19:14:53,865 CassandraDaemon.java (line 187) Exception in thread Thread[CompactionExecutor:111,1,RMI Runtime] java.lang.RuntimeException: Last written key DecoratedKey(1326283851463420237, 37382e34362e3132382e3139382d6a7576616c69735f6e6f72785f696e6465785f323031335f31305f30382d63616368655f646f63756d656e74736c6f6f6b75702d676574426c6f6f6d46696c746572537061636555736564) = current key DecoratedKey(954210699457429663, 37382e34362e3132382e3139382d6a7576616c69735f6e6f72785f696e6465785f323031335f31305f30382d63616368655f646f63756d656e74736c6f6f6b75702d676574546f74616c4469736b5370616365557365640b0f) writing into /var/lib/cassandra/data/OpsCenter/rollups60/OpsCenter-rollups60-tmp-jb-58656-Data.db at org.apache.cassandra.io.sstable.SSTableWriter.beforeAppend(SSTableWriter.java:141) at org.apache.cassandra.io.sstable.SSTableWriter.append(SSTableWriter.java:164) at org.apache.cassandra.db.compaction.CompactionTask.runWith(CompactionTask.java:160) at org.apache.cassandra.io.util.DiskAwareRunnable.runMayThrow(DiskAwareRunnable.java:48) at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) at org.apache.cassandra.db.compaction.CompactionTask.executeInternal(CompactionTask.java:60) at org.apache.cassandra.db.compaction.AbstractCompactionTask.execute(AbstractCompactionTask.java:59) at org.apache.cassandra.db.compaction.CompactionManager$6.runMayThrow(CompactionManager.java:296) at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) Moving back to STC worked to keep the compactions running. Especialy my own Table i would like to move to LCS. After a major compaction with STC the move to LCS fails with the same Exception. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-5337) vnode-aware replacenode command
[ https://issues.apache.org/jira/browse/CASSANDRA-5337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan McGuire updated CASSANDRA-5337: Labels: qa-resolved (was: vnodes) vnode-aware replacenode command --- Key: CASSANDRA-5337 URL: https://issues.apache.org/jira/browse/CASSANDRA-5337 Project: Cassandra Issue Type: New Feature Components: Core Affects Versions: 1.2.0 Reporter: Jonathan Ellis Assignee: Brandon Williams Labels: qa-resolved Fix For: 1.2.7, 2.0.0 Attachments: 5337-v2.txt, 5337.txt Currently you have the following options to replace a dead, unrecoverable node: - replacetoken. this requires specifying all 256 or so vnode tokens as a CSL - bootstrap new node, decommission old one. this is inefficient since the new node's vnodes will probably not overlap much with the old one's, so we replicate stream about 2x as much as if we were just replacing the old with the new We should add an analogue to replacetoken that takes the address or node ID of the dead node instead. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-6731) Requests unnecessarily redirected with CL=ONE
[ https://issues.apache.org/jira/browse/CASSANDRA-6731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan McGuire updated CASSANDRA-6731: Labels: qa-resolved (was: ) Requests unnecessarily redirected with CL=ONE - Key: CASSANDRA-6731 URL: https://issues.apache.org/jira/browse/CASSANDRA-6731 Project: Cassandra Issue Type: Bug Components: Core Environment: Linux Reporter: Aris Prassinos Assignee: Tyler Hobbs Priority: Minor Labels: qa-resolved Fix For: 2.0.6 Attachments: 6731.traces.txt, ticket_6731.py Three-node cluster with RF=3. All data currently in sync. Network topology strategy. Each node defined to be on a different rack. endpoint_snitch: PropertyFileSnitch dynamic_snitch_update_interval_in_ms: 100 dynamic_snitch_reset_interval_in_ms: 60 dynamic_snitch_badness_threshold: 0 All tables defined with read_repair_chance=0 From cqlsh when querying with Consistency=ONE tracing shows that requests get frequently redirected to other nodes even though the local node has the data. There is no other activity on the cluster besides my test queries. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-6416) MoveTest fails in 1.2+
[ https://issues.apache.org/jira/browse/CASSANDRA-6416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan McGuire updated CASSANDRA-6416: Labels: qa-resolved (was: ) MoveTest fails in 1.2+ -- Key: CASSANDRA-6416 URL: https://issues.apache.org/jira/browse/CASSANDRA-6416 Project: Cassandra Issue Type: Bug Components: Tests Reporter: Jonathan Ellis Assignee: Michael Shuler Labels: qa-resolved Fix For: 1.2.13, 2.0.4 One test fails in 1.2, two in 2.0/trunk. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-6615) Changing the IP of a node on a live cluster leaves gossip infos and throws Exceptions
[ https://issues.apache.org/jira/browse/CASSANDRA-6615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan McGuire updated CASSANDRA-6615: Labels: qa-resolved (was: ) Changing the IP of a node on a live cluster leaves gossip infos and throws Exceptions - Key: CASSANDRA-6615 URL: https://issues.apache.org/jira/browse/CASSANDRA-6615 Project: Cassandra Issue Type: Bug Components: Core Reporter: Fabien Rousseau Assignee: Brandon Williams Labels: qa-resolved Fix For: 1.2.14, 2.0.5 Attachments: 6615.txt Following this procedure : https://engineering.eventbrite.com/changing-the-ip-address-of-a-cassandra-node-with-auto_bootstrapfalse/ to change the IP of a node, we encountered an issue : - logs contains: java.lang.RuntimeException: Host ID collision between active endpoint /127.0.0.5 and /127.0.0.3 - logs also indicate that the old IP is being removed of the cluster (FatClient timeout), then added again... - nodetool gossipinfo still list old IP (even a few hours after...) - the old IP is still seen as UP in the cluster... (according to the logs...) Below is a small shell script which allows to reproduce the scenario... {noformat} #! /bin/bash CLUSTER=$1 ccm create $CLUSTER --cassandra-dir=. ccm populate -n 2 ccm start ccm add node3 -i 127.0.0.3 -j 7300 -b ccm node3 start ccm node3 ring ccm node3 stop sed -i 's/127.0.0.3/127.0.0.5/g' ~/.ccm/$CLUSTER/node3/node.conf sed -i 's/127.0.0.3/127.0.0.5/g' ~/.ccm/$CLUSTER/node3/conf/cassandra.yaml ccm node3 start sleep 3 nodetool --host 127.0.0.5 --port 7300 gossipinfo {noformat} -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-6131) JAVA_HOME on cassandra-env.sh is ignored on Debian packages
[ https://issues.apache.org/jira/browse/CASSANDRA-6131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan McGuire updated CASSANDRA-6131: Labels: qa-resolved (was: debian) JAVA_HOME on cassandra-env.sh is ignored on Debian packages --- Key: CASSANDRA-6131 URL: https://issues.apache.org/jira/browse/CASSANDRA-6131 Project: Cassandra Issue Type: Bug Components: Packaging Reporter: Sebastián Lacuesta Assignee: Eric Evans Labels: qa-resolved Fix For: 2.0.5 Attachments: 6131-2.patch, 6131.patch I've just got upgraded to 2.0.1 package from the apache repositories using apt. I had the JAVA_HOME environment variable set in /etc/cassandra/cassandra-env.sh but after the upgrade it only worked by setting it on /usr/sbin/cassandra script. I can't configure java 7 system wide, only for cassandra. Off-toppic: Thanks for getting rid of the jsvc mess. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-5383) Windows 7 deleting/renaming files problem
[ https://issues.apache.org/jira/browse/CASSANDRA-5383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan McGuire updated CASSANDRA-5383: Labels: qa-resolved (was: ) Windows 7 deleting/renaming files problem - Key: CASSANDRA-5383 URL: https://issues.apache.org/jira/browse/CASSANDRA-5383 Project: Cassandra Issue Type: Bug Components: Tests Affects Versions: 2.0 beta 1 Reporter: Ryan McGuire Assignee: Marcus Eriksson Labels: qa-resolved Fix For: 2.0.2 Attachments: 0001-CASSANDRA-5383-cant-move-a-file-on-top-of-another-fi.patch, 0001-CASSANDRA-5383-v2.patch, 0001-use-Java7-apis-for-deleting-and-moving-files-and-cre.patch, 5383-v3.patch, 5383_patch_v2_system.log, cant_move_file_patch.log, test_log.5383.patch_v2.log.txt, v2+cant_move_file_patch.log Two unit tests are failing on Windows 7 due to errors in renaming/deleting files: org.apache.cassandra.db.ColumnFamilyStoreTest: {code} [junit] Testsuite: org.apache.cassandra.db.ColumnFamilyStoreTest [junit] Tests run: 27, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 13.904 sec [junit] [junit] - Standard Error - [junit] ERROR 13:06:46,058 Unable to delete build\test\cassandra\data\Keyspace1\Indexed2\Keyspace1-Indexed2.birthdate_index-ja-1-Data.db (it will be removed on server restart; we'll also retry after GC) [junit] ERROR 13:06:48,508 Fatal exception in thread Thread[NonPeriodicTasks:1,5,main] [junit] java.lang.RuntimeException: Tried to hard link to file that does not exist build\test\cassandra\data\Keyspace1\Standard1\Keyspace1-Standard1-ja-7-Statistics.db [junit] at org.apache.cassandra.io.util.FileUtils.createHardLink(FileUtils.java:72) [junit] at org.apache.cassandra.io.sstable.SSTableReader.createLinks(SSTableReader.java:1057) [junit] at org.apache.cassandra.db.DataTracker$1.run(DataTracker.java:168) [junit] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) [junit] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [junit] at java.util.concurrent.FutureTask.run(FutureTask.java:138) [junit] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) [junit] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206) [junit] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [junit] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [junit] at java.lang.Thread.run(Thread.java:662) [junit] - --- [junit] Testcase: testSliceByNamesCommandOldMetatada(org.apache.cassandra.db.ColumnFamilyStoreTest): Caused an ERROR [junit] Failed to rename build\test\cassandra\data\Keyspace1\Standard1\Keyspace1-Standard1-ja-6-Statistics.db-tmp to build\test\cassandra\data\Keyspace1\Standard1\Keyspace1-Standard1-ja-6-Statistics.db [junit] java.lang.RuntimeException: Failed to rename build\test\cassandra\data\Keyspace1\Standard1\Keyspace1-Standard1-ja-6-Statistics.db-tmp to build\test\cassandra\data\Keyspace1\Standard1\Keyspace1-Standard1-ja-6-Statistics.db [junit] at org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:133) [junit] at org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:122) [junit] at org.apache.cassandra.db.compaction.LeveledManifest.mutateLevel(LeveledManifest.java:575) [junit] at org.apache.cassandra.db.ColumnFamilyStore.loadNewSSTables(ColumnFamilyStore.java:589) [junit] at org.apache.cassandra.db.ColumnFamilyStoreTest.testSliceByNamesCommandOldMetatada(ColumnFamilyStoreTest.java:885) [junit] [junit] [junit] Testcase: testRemoveUnifinishedCompactionLeftovers(org.apache.cassandra.db.ColumnFamilyStoreTest): Caused an ERROR [junit] java.io.IOException: Failed to delete c:\Users\Ryan\git\cassandra\build\test\cassandra\data\Keyspace1\Standard3\Keyspace1-Standard3-ja-2-Data.db [junit] FSWriteError in build\test\cassandra\data\Keyspace1\Standard3\Keyspace1-Standard3-ja-2-Data.db [junit] at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:112) [junit] at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:103) [junit] at org.apache.cassandra.io.sstable.SSTable.delete(SSTable.java:139) [junit] at org.apache.cassandra.db.ColumnFamilyStore.removeUnfinishedCompactionLeftovers(ColumnFamilyStore.java:507) [junit] at
[jira] [Updated] (CASSANDRA-6893) Unintended update with conditional statement
[ https://issues.apache.org/jira/browse/CASSANDRA-6893?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan McGuire updated CASSANDRA-6893: Labels: qa-resolved (was: ) Unintended update with conditional statement Key: CASSANDRA-6893 URL: https://issues.apache.org/jira/browse/CASSANDRA-6893 Project: Cassandra Issue Type: Bug Environment: Ubuntu Precise 64bit / Cassandra 2.0.6 Reporter: Suguru Namura Assignee: Sylvain Lebresne Labels: qa-resolved Fix For: 2.0.7 Attachments: 6893.txt, ConcurrentCASUpdate.java After updated to 2.0.6, I have encountered the strange behavior of conditional updates. When I executed CQL like UPDATE test SET value = ? WHERE id = ? IF value = ? in concurrent, sometimes cassandra returns true even if value is not satisfied the condition. I have attached the program which reproduce this issue. The program works fine in cassandra 2.0.5. But it seems that resets values while execution in 2.0.6. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-4899) add gitignore
[ https://issues.apache.org/jira/browse/CASSANDRA-4899?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan McGuire updated CASSANDRA-4899: Labels: qa-resolved (was: ) add gitignore - Key: CASSANDRA-4899 URL: https://issues.apache.org/jira/browse/CASSANDRA-4899 Project: Cassandra Issue Type: Task Reporter: Radim Kolar Assignee: Michael Shuler Priority: Trivial Labels: qa-resolved Fix For: 1.2.14, 2.0.4 Attachments: .gitignore, cass-gitignore.txt -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-5936) Improve the way we pick L0 compaction candidates
[ https://issues.apache.org/jira/browse/CASSANDRA-5936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marcus Eriksson updated CASSANDRA-5936: --- Labels: compaction (was: ) Improve the way we pick L0 compaction candidates Key: CASSANDRA-5936 URL: https://issues.apache.org/jira/browse/CASSANDRA-5936 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Marcus Eriksson Assignee: Marcus Eriksson Labels: compaction Fix For: 2.1 beta2 We could improve the way we pick compaction candidates in level 0 in LCS. The most common way for us to get behind on compaction is after repairs, we should exploit the fact that the streamed sstables are most often very narrow in range since the other nodes in the ring will have a similar sstable-range-distribution. We should in theory be able to do 10 concurrent compactions involving L1 - ie, partition L0 in buckets defined by the sstables in L1 to only keep one L1 SSTable busy for every compaction (be it L1 to L2 or L0 to L1). we will need some heuristics on when to select candidates from the buckets and when to do it the old way (since L0 sstables can span several L1 sstables) -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7019) Major tombstone compaction
[ https://issues.apache.org/jira/browse/CASSANDRA-7019?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marcus Eriksson updated CASSANDRA-7019: --- Labels: compaction (was: ) Major tombstone compaction -- Key: CASSANDRA-7019 URL: https://issues.apache.org/jira/browse/CASSANDRA-7019 Project: Cassandra Issue Type: Improvement Reporter: Marcus Eriksson Labels: compaction It should be possible to do a major tombstone compaction by including all sstables, but writing them out 1:1, meaning that if you have 10 sstables before, you will have 10 sstables after the compaction with the same data, minus all the expired tombstones. We could do this in two ways: # a nodetool command that includes _all_ sstables # once we detect that an sstable has more than x% (20%?) expired tombstones, we start one of these compactions, and include all overlapping sstables that contain older data. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-6851) Improve anticompaction after incremental repair
[ https://issues.apache.org/jira/browse/CASSANDRA-6851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marcus Eriksson updated CASSANDRA-6851: --- Labels: compaction lhf (was: ) Improve anticompaction after incremental repair --- Key: CASSANDRA-6851 URL: https://issues.apache.org/jira/browse/CASSANDRA-6851 Project: Cassandra Issue Type: Improvement Reporter: Marcus Eriksson Priority: Minor Labels: compaction, lhf Fix For: 2.1 beta2 After an incremental repair we iterate over all sstables and split them in two parts, one containing the repaired data and one the unrepaired. We could in theory double the number of sstables on a node. To avoid this we could make anticompaction also do a compaction, for example, if we are to anticompact 10 sstables, we could anticompact those to 2. Note that we need to avoid creating too big sstables though, if we anticompact all sstables on a node it would essentially be a major compaction. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7119) Optimise isLive(System.currentTimeMillis()) + minor Cell cleanup
[ https://issues.apache.org/jira/browse/CASSANDRA-7119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985869#comment-13985869 ] Benedict commented on CASSANDRA-7119: - LGTM * Could use a test case for the timestamp summation (and I don't understand it, so have to trust you're right on that one) * Could call !isLive(Long.MIN_VALUE) in cases where we called isMarkedForDelete(Long.MIN_VALUE) to avoid further System.currentTimeMillis() - or could simply call instanceof DeletedCell. Or leave it as is. * I was under the impression we defaulted to explicit imports, not package.* (though I don't see a spec either way in the codestyle) Optimise isLive(System.currentTimeMillis()) + minor Cell cleanup Key: CASSANDRA-7119 URL: https://issues.apache.org/jira/browse/CASSANDRA-7119 Project: Cassandra Issue Type: Improvement Reporter: Aleksey Yeschenko Assignee: Aleksey Yeschenko Priority: Minor Fix For: 2.1 beta2 There are lots of Cell#isMakredForDeleteAt(System.currentTimeMillis()) and Cell#isLive(System.currentTimeMillis()) calls in the codebase - including in Cell#reconcile(), while we only need to pass the current time to the ExpiringCell. System.currentTimeMillis() is cheap, but not calling it at all is cheaper (and it's not *that* cheap when virtualised under certain configs). There is also another form - calling isMarkedForDelete() with Long.MIN_VALUE/Long.MAX_VALUE, when we know we aren't expecting an ExpiringCell, ever. So the patch adds an argument-less isLive() method that only calls System.currentTimeMillis() for ExpiringCell. To reduce duplication between Native* and Buffer*, isMarkedForDelete() has been removed entirely in favor of the shorter-to-type isLive() (plus I never really liked the name anyway). Also performs minor clean up and fixes one minor bug: - removes the unused Cell#getMarkedForDeleteAt() method - removes redundant Override-s in AbstractCell - corrects BufferCounterUpdateCell#reconcile() to sum the timestamps and not pick the max (must have slipped through 6694) -- This message was sent by Atlassian JIRA (v6.2#6252)
[1/4] Native protocol v3
Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 ece386439 - 9872b74ef http://git-wip-us.apache.org/repos/asf/cassandra/blob/9872b74e/src/java/org/apache/cassandra/transport/messages/BatchMessage.java -- diff --git a/src/java/org/apache/cassandra/transport/messages/BatchMessage.java b/src/java/org/apache/cassandra/transport/messages/BatchMessage.java index ef30a22..ec96ed1 100644 --- a/src/java/org/apache/cassandra/transport/messages/BatchMessage.java +++ b/src/java/org/apache/cassandra/transport/messages/BatchMessage.java @@ -28,6 +28,7 @@ import io.netty.buffer.ByteBuf; import org.apache.cassandra.cql3.*; import org.apache.cassandra.cql3.statements.BatchStatement; import org.apache.cassandra.cql3.statements.ModificationStatement; +import org.apache.cassandra.cql3.statements.ParsedStatement; import org.apache.cassandra.db.ConsistencyLevel; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.exceptions.PreparedQueryNotFoundException; @@ -61,8 +62,11 @@ public class BatchMessage extends Message.Request throw new ProtocolException(Invalid query kind in BATCH messages. Must be 0 or 1 but got + kind); variables.add(CBUtil.readValueList(body)); } -ConsistencyLevel consistency = CBUtil.readConsistencyLevel(body); -return new BatchMessage(toType(type), queryOrIds, variables, consistency); +QueryOptions options = version 3 + ? QueryOptions.fromPreV3Batch(CBUtil.readConsistencyLevel(body)) + : QueryOptions.codec.decode(body, version); + +return new BatchMessage(toType(type), queryOrIds, variables, options); } public void encode(BatchMessage msg, ByteBuf dest, int version) @@ -84,7 +88,10 @@ public class BatchMessage extends Message.Request CBUtil.writeValueList(msg.values.get(i), dest); } -CBUtil.writeConsistencyLevel(msg.consistency, dest); +if (version 3) +CBUtil.writeConsistencyLevel(msg.options.getConsistency(), dest); +else +QueryOptions.codec.encode(msg.options, dest, version); } public int encodedSize(BatchMessage msg, int version) @@ -99,7 +106,9 @@ public class BatchMessage extends Message.Request size += CBUtil.sizeOfValueList(msg.values.get(i)); } -size += CBUtil.sizeOfConsistencyLevel(msg.consistency); +size += version 3 + ? CBUtil.sizeOfConsistencyLevel(msg.options.getConsistency()) + : QueryOptions.codec.encodedSize(msg.options, version); return size; } @@ -131,15 +140,15 @@ public class BatchMessage extends Message.Request public final BatchStatement.Type type; public final ListObject queryOrIdList; public final ListListByteBuffer values; -public final ConsistencyLevel consistency; +public final QueryOptions options; -public BatchMessage(BatchStatement.Type type, ListObject queryOrIdList, ListListByteBuffer values, ConsistencyLevel consistency) +public BatchMessage(BatchStatement.Type type, ListObject queryOrIdList, ListListByteBuffer values, QueryOptions options) { super(Message.Type.BATCH); this.type = type; this.queryOrIdList = queryOrIdList; this.values = values; -this.consistency = consistency; +this.options = options; } public Message.Response execute(QueryState state) @@ -161,27 +170,39 @@ public class BatchMessage extends Message.Request } QueryHandler handler = state.getClientState().getCQLQueryHandler(); -ListModificationStatement statements = new ArrayListModificationStatement(queryOrIdList.size()); +ListParsedStatement.Prepared prepared = new ArrayList(queryOrIdList.size()); for (int i = 0; i queryOrIdList.size(); i++) { Object query = queryOrIdList.get(i); -CQLStatement statement; +ParsedStatement.Prepared p; if (query instanceof String) { -statement = QueryProcessor.parseStatement((String)query, state); +p = QueryProcessor.parseStatement((String)query, state); } else { -statement = handler.getPrepared((MD5Digest)query); -if (statement == null) +p = handler.getPrepared((MD5Digest)query); +if (p == null) throw new PreparedQueryNotFoundException((MD5Digest)query); } ListByteBuffer queryValues = values.get(i); -if
[5/5] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/6b4d9803 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/6b4d9803 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/6b4d9803 Branch: refs/heads/trunk Commit: 6b4d980357de573f9128c3a065a6d11c54a3b571 Parents: ad34247 9872b74 Author: Sylvain Lebresne sylv...@datastax.com Authored: Wed Apr 30 20:22:53 2014 +0200 Committer: Sylvain Lebresne sylv...@datastax.com Committed: Wed Apr 30 20:22:53 2014 +0200 -- CHANGES.txt | 1 + build.xml | 2 +- doc/native_protocol_v3.spec | 911 +++ src/java/org/apache/cassandra/auth/Auth.java| 16 +- .../cassandra/auth/CassandraAuthorizer.java | 6 +- .../cassandra/auth/PasswordAuthenticator.java | 4 +- .../org/apache/cassandra/cql3/Attributes.java | 8 +- .../cassandra/cql3/BatchQueryOptions.java | 81 +- .../apache/cassandra/cql3/ColumnCondition.java | 32 +- .../org/apache/cassandra/cql3/Constants.java| 20 +- src/java/org/apache/cassandra/cql3/Lists.java | 34 +- src/java/org/apache/cassandra/cql3/Maps.java| 32 +- .../org/apache/cassandra/cql3/QueryHandler.java | 3 +- .../org/apache/cassandra/cql3/QueryOptions.java | 283 -- .../apache/cassandra/cql3/QueryProcessor.java | 29 +- .../org/apache/cassandra/cql3/ResultSet.java| 6 +- src/java/org/apache/cassandra/cql3/Sets.java| 26 +- src/java/org/apache/cassandra/cql3/Term.java| 18 +- .../apache/cassandra/cql3/UpdateParameters.java | 6 +- .../org/apache/cassandra/cql3/UserTypes.java| 18 +- .../cassandra/cql3/functions/FunctionCall.java | 20 +- .../cql3/statements/BatchStatement.java | 95 +- .../cql3/statements/CQL3CasConditions.java | 14 +- .../cql3/statements/ModificationStatement.java | 63 +- .../cassandra/cql3/statements/Restriction.java | 28 +- .../cql3/statements/SelectStatement.java| 150 +-- .../org/apache/cassandra/db/DefsTables.java | 19 +- .../cassandra/db/marshal/CollectionType.java| 29 +- .../apache/cassandra/db/marshal/ListType.java | 12 +- .../apache/cassandra/db/marshal/MapType.java| 21 +- .../apache/cassandra/db/marshal/SetType.java| 15 +- .../apache/cassandra/db/marshal/UserType.java | 5 + .../hadoop/pig/AbstractCassandraStorage.java| 11 +- .../cassandra/io/sstable/CQLSSTableWriter.java | 11 +- .../serializers/CollectionSerializer.java | 106 ++- .../cassandra/serializers/ListSerializer.java | 39 +- .../cassandra/serializers/MapSerializer.java| 48 +- .../cassandra/serializers/SetSerializer.java| 39 +- .../cassandra/service/IMigrationListener.java | 3 + .../cassandra/service/MigrationManager.java | 18 + .../cassandra/thrift/CassandraServer.java | 4 +- .../org/apache/cassandra/transport/CBUtil.java | 17 + .../org/apache/cassandra/transport/Client.java | 4 +- .../apache/cassandra/transport/DataType.java| 79 +- .../org/apache/cassandra/transport/Event.java | 158 +++- .../apache/cassandra/transport/OptionCodec.java | 28 +- .../org/apache/cassandra/transport/Server.java | 21 +- .../cassandra/transport/SimpleClient.java | 4 +- .../transport/messages/BatchMessage.java| 53 +- .../transport/messages/EventMessage.java| 6 +- .../transport/messages/ExecuteMessage.java | 5 +- .../cassandra/transport/SerDeserTest.java | 217 + 52 files changed, 2232 insertions(+), 646 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/6b4d9803/CHANGES.txt -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/6b4d9803/build.xml -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/6b4d9803/src/java/org/apache/cassandra/cql3/QueryProcessor.java -- diff --cc src/java/org/apache/cassandra/cql3/QueryProcessor.java index db99060,40c45af..9a5ac92 --- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java +++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java @@@ -51,13 -51,14 +51,13 @@@ public class QueryProcessor implements private static final Logger logger = LoggerFactory.getLogger(QueryProcessor.class); private static final MemoryMeter meter = new MemoryMeter().withGuessing(MemoryMeter.Guess.FALLBACK_BEST); private static final long MAX_CACHE_PREPARED_MEMORY = Runtime.getRuntime().maxMemory() / 256; -private static final int MAX_CACHE_PREPARED_COUNT = 1; - private static
[1/5] Native protocol v3
Repository: cassandra Updated Branches: refs/heads/trunk ad3424707 - 6b4d98035 http://git-wip-us.apache.org/repos/asf/cassandra/blob/9872b74e/src/java/org/apache/cassandra/transport/messages/BatchMessage.java -- diff --git a/src/java/org/apache/cassandra/transport/messages/BatchMessage.java b/src/java/org/apache/cassandra/transport/messages/BatchMessage.java index ef30a22..ec96ed1 100644 --- a/src/java/org/apache/cassandra/transport/messages/BatchMessage.java +++ b/src/java/org/apache/cassandra/transport/messages/BatchMessage.java @@ -28,6 +28,7 @@ import io.netty.buffer.ByteBuf; import org.apache.cassandra.cql3.*; import org.apache.cassandra.cql3.statements.BatchStatement; import org.apache.cassandra.cql3.statements.ModificationStatement; +import org.apache.cassandra.cql3.statements.ParsedStatement; import org.apache.cassandra.db.ConsistencyLevel; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.exceptions.PreparedQueryNotFoundException; @@ -61,8 +62,11 @@ public class BatchMessage extends Message.Request throw new ProtocolException(Invalid query kind in BATCH messages. Must be 0 or 1 but got + kind); variables.add(CBUtil.readValueList(body)); } -ConsistencyLevel consistency = CBUtil.readConsistencyLevel(body); -return new BatchMessage(toType(type), queryOrIds, variables, consistency); +QueryOptions options = version 3 + ? QueryOptions.fromPreV3Batch(CBUtil.readConsistencyLevel(body)) + : QueryOptions.codec.decode(body, version); + +return new BatchMessage(toType(type), queryOrIds, variables, options); } public void encode(BatchMessage msg, ByteBuf dest, int version) @@ -84,7 +88,10 @@ public class BatchMessage extends Message.Request CBUtil.writeValueList(msg.values.get(i), dest); } -CBUtil.writeConsistencyLevel(msg.consistency, dest); +if (version 3) +CBUtil.writeConsistencyLevel(msg.options.getConsistency(), dest); +else +QueryOptions.codec.encode(msg.options, dest, version); } public int encodedSize(BatchMessage msg, int version) @@ -99,7 +106,9 @@ public class BatchMessage extends Message.Request size += CBUtil.sizeOfValueList(msg.values.get(i)); } -size += CBUtil.sizeOfConsistencyLevel(msg.consistency); +size += version 3 + ? CBUtil.sizeOfConsistencyLevel(msg.options.getConsistency()) + : QueryOptions.codec.encodedSize(msg.options, version); return size; } @@ -131,15 +140,15 @@ public class BatchMessage extends Message.Request public final BatchStatement.Type type; public final ListObject queryOrIdList; public final ListListByteBuffer values; -public final ConsistencyLevel consistency; +public final QueryOptions options; -public BatchMessage(BatchStatement.Type type, ListObject queryOrIdList, ListListByteBuffer values, ConsistencyLevel consistency) +public BatchMessage(BatchStatement.Type type, ListObject queryOrIdList, ListListByteBuffer values, QueryOptions options) { super(Message.Type.BATCH); this.type = type; this.queryOrIdList = queryOrIdList; this.values = values; -this.consistency = consistency; +this.options = options; } public Message.Response execute(QueryState state) @@ -161,27 +170,39 @@ public class BatchMessage extends Message.Request } QueryHandler handler = state.getClientState().getCQLQueryHandler(); -ListModificationStatement statements = new ArrayListModificationStatement(queryOrIdList.size()); +ListParsedStatement.Prepared prepared = new ArrayList(queryOrIdList.size()); for (int i = 0; i queryOrIdList.size(); i++) { Object query = queryOrIdList.get(i); -CQLStatement statement; +ParsedStatement.Prepared p; if (query instanceof String) { -statement = QueryProcessor.parseStatement((String)query, state); +p = QueryProcessor.parseStatement((String)query, state); } else { -statement = handler.getPrepared((MD5Digest)query); -if (statement == null) +p = handler.getPrepared((MD5Digest)query); +if (p == null) throw new PreparedQueryNotFoundException((MD5Digest)query); } ListByteBuffer queryValues = values.get(i); -if (queryValues.size() !=
[jira] [Commented] (CASSANDRA-6131) JAVA_HOME on cassandra-env.sh is ignored on Debian packages
[ https://issues.apache.org/jira/browse/CASSANDRA-6131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985874#comment-13985874 ] Sebastián Lacuesta commented on CASSANDRA-6131: --- Works for me. Thanks! JAVA_HOME on cassandra-env.sh is ignored on Debian packages --- Key: CASSANDRA-6131 URL: https://issues.apache.org/jira/browse/CASSANDRA-6131 Project: Cassandra Issue Type: Bug Components: Packaging Reporter: Sebastián Lacuesta Assignee: Eric Evans Labels: qa-resolved Fix For: 2.0.5 Attachments: 6131-2.patch, 6131.patch I've just got upgraded to 2.0.1 package from the apache repositories using apt. I had the JAVA_HOME environment variable set in /etc/cassandra/cassandra-env.sh but after the upgrade it only worked by setting it on /usr/sbin/cassandra script. I can't configure java 7 system wide, only for cassandra. Off-toppic: Thanks for getting rid of the jsvc mess. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-6890) Standardize on a single read path
[ https://issues.apache.org/jira/browse/CASSANDRA-6890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985905#comment-13985905 ] Jonathan Ellis commented on CASSANDRA-6890: --- bq. I'd be comfortable normalizing the system on buffered I/O leading up to 3.0 to give us a single read path to migrate to an in-process page cache All right. What do we do for uncompressed sstables? Currently there are no blocks/pages to cache. Standardize on a single read path - Key: CASSANDRA-6890 URL: https://issues.apache.org/jira/browse/CASSANDRA-6890 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Joshua McKenzie Assignee: Joshua McKenzie Labels: performance Fix For: 3.0 Attachments: mmap_gc.jpg, mmap_jstat.txt, mmap_perf.txt, nommap_gc.jpg, nommap_jstat.txt Since we actively unmap unreferenced SSTR's and also copy data out of those readers on the read path, the current memory mapped i/o is a lot of complexity for very little payoff. Clean out the mmapp'ed i/o on the read path. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-6890) Standardize on a single read path
[ https://issues.apache.org/jira/browse/CASSANDRA-6890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985911#comment-13985911 ] Benedict commented on CASSANDRA-6890: - Sure there are - I want to push them through the same cache, so we can get our other knock on benefits of reduced message passing for all file types. Standardize on a single read path - Key: CASSANDRA-6890 URL: https://issues.apache.org/jira/browse/CASSANDRA-6890 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Joshua McKenzie Assignee: Joshua McKenzie Labels: performance Fix For: 3.0 Attachments: mmap_gc.jpg, mmap_jstat.txt, mmap_perf.txt, nommap_gc.jpg, nommap_jstat.txt Since we actively unmap unreferenced SSTR's and also copy data out of those readers on the read path, the current memory mapped i/o is a lot of complexity for very little payoff. Clean out the mmapp'ed i/o on the read path. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7107) General minor tidying of CollationController path
[ https://issues.apache.org/jira/browse/CASSANDRA-7107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985919#comment-13985919 ] Benedict commented on CASSANDRA-7107: - Weird. I was sure I'd run all of the unit tests before uploading. Two line patch uploaded that fixes those two tests. General minor tidying of CollationController path - Key: CASSANDRA-7107 URL: https://issues.apache.org/jira/browse/CASSANDRA-7107 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Minor Fix For: 2.1.0 There is a lot of unnecessary boiler plate when grabbing an iterator from an in-memory column family. This patch: * Removes FakeCellName * Avoids wrapping a non-OnDiskAtomIterator as an OnDiskAtomIterator except when the wrapping is useful * Removes ColumnSlice.NavigableSetIterator and creates a simpler more direct equivalent in ABTC * Does not construct a SliceIterator in either ABSC or ABTC if only one slice is requested (just returns that slice as an Iterator) * Does not construct multiple list indirections in ABSC when constructing a slice * Shares forward/reverse iterators in ABSC between slices and full-iteration * Avoids O(N) comparisons during collation of results into an ABSC, by using the knowledge that all columns are provided in insertion order from a merge iterator -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7081) select writetime(colname) returns 0 for static columns
[ https://issues.apache.org/jira/browse/CASSANDRA-7081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985927#comment-13985927 ] Tyler Hobbs commented on CASSANDRA-7081: +1 select writetime(colname) returns 0 for static columns -- Key: CASSANDRA-7081 URL: https://issues.apache.org/jira/browse/CASSANDRA-7081 Project: Cassandra Issue Type: Bug Reporter: Nicolas Favre-Felix Assignee: Sylvain Lebresne Fix For: 2.0.8 Attachments: 7081.txt Selecting the write time for a static column returns 0 in Cassandra 2.0 (c3550fe) and an expected timestamp in 2.1 (trunk, acdbbb9). Would it be possible to include this timestamp in a 2.0 release too? {code} CREATE TABLE test (partition_key text, cluster_key text, data text, st text static, PRIMARY KEY(partition_key, cluster_key)); INSERT INTO test (partition_key, cluster_key, data, st) VALUES ( 'PK', 'CK', 'DATA', 'ST'); SELECT writetime(st), writetime(data) FROM test where partition_key='PK'; writetime(st) | writetime(data) ---+-- 0 | 1398314681729000 (1 rows) {code} -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (CASSANDRA-7121) Fix build error introduced by CASSANDRA-7116
Doğan Çeçen created CASSANDRA-7121: -- Summary: Fix build error introduced by CASSANDRA-7116 Key: CASSANDRA-7121 URL: https://issues.apache.org/jira/browse/CASSANDRA-7121 Project: Cassandra Issue Type: Bug Reporter: Doğan Çeçen Priority: Trivial RowDataResolver is calling {{replies.get}} method, but Collection interface doesn't contain {{get}} method (List does). Build reports some errors about this. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7121) Fix build error introduced by CASSANDRA-7116
[ https://issues.apache.org/jira/browse/CASSANDRA-7121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doğan Çeçen updated CASSANDRA-7121: --- Attachment: trunk-7121.txt Fix build error introduced by CASSANDRA-7116 Key: CASSANDRA-7121 URL: https://issues.apache.org/jira/browse/CASSANDRA-7121 Project: Cassandra Issue Type: Bug Reporter: Doğan Çeçen Priority: Trivial Attachments: trunk-7121.txt RowDataResolver is calling {{replies.get}} method, but Collection interface doesn't contain {{get}} method (List does). Build reports some errors about this. -- This message was sent by Atlassian JIRA (v6.2#6252)
git commit: Optimize Cell liveness checks and clean up Cell
Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 9872b74ef - 4485e6dbf Optimize Cell liveness checks and clean up Cell patch by Aleksey Yeschenko; reviewed by Benedict Elliott Smith for CASSANDRA-7119 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/4485e6db Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/4485e6db Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/4485e6db Branch: refs/heads/cassandra-2.1 Commit: 4485e6dbfed89c9137a58412210e56ae88cfe217 Parents: 9872b74 Author: Aleksey Yeschenko alek...@apache.org Authored: Wed Apr 30 21:06:46 2014 +0200 Committer: Aleksey Yeschenko alek...@apache.org Committed: Wed Apr 30 21:06:46 2014 +0200 -- CHANGES.txt | 1 + .../apache/cassandra/cql/QueryProcessor.java| 4 +- .../cassandra/cql3/statements/Selection.java| 2 +- .../org/apache/cassandra/db/AbstractCell.java | 39 +--- .../cassandra/db/BufferCounterUpdateCell.java | 6 +-- .../apache/cassandra/db/BufferDeletedCell.java | 8 ++-- .../apache/cassandra/db/BufferExpiringCell.java | 8 ++-- src/java/org/apache/cassandra/db/Cell.java | 9 + .../apache/cassandra/db/CounterMutation.java| 2 +- .../cassandra/db/HintedHandOffManager.java | 2 +- .../apache/cassandra/db/NativeDeletedCell.java | 8 ++-- .../apache/cassandra/db/NativeExpiringCell.java | 8 ++-- .../db/compaction/LazilyCompactedRow.java | 5 +-- .../db/composites/AbstractCellNameType.java | 4 +- .../AbstractSimplePerColumnSecondaryIndex.java | 3 +- .../db/index/SecondaryIndexManager.java | 8 ++-- .../CompositesIndexOnCollectionKey.java | 4 +- .../CompositesIndexOnCollectionValue.java | 10 ++--- .../composites/CompositesIndexOnRegular.java| 8 +--- .../db/index/composites/CompositesSearcher.java | 8 +--- .../cassandra/db/index/keys/KeysIndex.java | 8 +--- .../cassandra/db/index/keys/KeysSearcher.java | 2 +- .../apache/cassandra/service/CacheService.java | 2 +- .../cassandra/thrift/CassandraServer.java | 10 ++--- .../apache/cassandra/db/ColumnFamilyTest.java | 5 ++- .../apache/cassandra/db/CounterCellTest.java| 8 ++-- .../apache/cassandra/db/RangeTombstoneTest.java | 2 +- .../org/apache/cassandra/db/RemoveCellTest.java | 14 +++ .../apache/cassandra/db/RemoveSubCellTest.java | 5 ++- test/unit/org/apache/cassandra/db/RowTest.java | 5 ++- .../db/compaction/CompactionsPurgeTest.java | 6 +-- .../db/index/PerRowSecondaryIndexTest.java | 15 +++- .../cassandra/service/QueryPagerTest.java | 2 +- 33 files changed, 92 insertions(+), 139 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/4485e6db/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index a4811f6..34533cc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -55,6 +55,7 @@ * Multi-threaded scrub/cleanup/upgradesstables (CASSANDRA-5547) * Optimize cellname comparison (CASSANDRA-6934) * Native protocol v3 (CASSANDRA-6855) + * Optimize Cell liveness checks and clean up Cell (CASSANDRA-7119) Merged from 2.0: * Allow overriding cassandra-rackdc.properties file (CASSANDRA-7072) * Set JMX RMI port to 7199 (CASSANDRA-7087) http://git-wip-us.apache.org/repos/asf/cassandra/blob/4485e6db/src/java/org/apache/cassandra/cql/QueryProcessor.java -- diff --git a/src/java/org/apache/cassandra/cql/QueryProcessor.java b/src/java/org/apache/cassandra/cql/QueryProcessor.java index 3b3..3c1d555 100644 --- a/src/java/org/apache/cassandra/cql/QueryProcessor.java +++ b/src/java/org/apache/cassandra/cql/QueryProcessor.java @@ -469,7 +469,7 @@ public class QueryProcessor { for (org.apache.cassandra.db.Cell c : row.cf.getSortedColumns()) { -if (c.isMarkedForDelete(now)) +if (!c.isLive(now)) continue; ColumnDefinition cd = metadata.getColumnDefinition(c.name()); @@ -515,7 +515,7 @@ public class QueryProcessor if (cd != null) result.schema.value_types.put(nameBytes, TypeParser.getShortName(cd.type)); org.apache.cassandra.db.Cell c = row.cf.getColumn(name); -if (c == null || c.isMarkedForDelete(System.currentTimeMillis())) +if (c == null || !c.isLive()) thriftColumns.add(new
git commit: fix build
Repository: cassandra Updated Branches: refs/heads/trunk 6b4d98035 - cf3f5b6ef fix build Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/cf3f5b6e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cf3f5b6e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cf3f5b6e Branch: refs/heads/trunk Commit: cf3f5b6efbe80a95bfc57e40e60ef5531eddc71e Parents: 6b4d980 Author: Jonathan Ellis jbel...@apache.org Authored: Wed Apr 30 14:07:51 2014 -0500 Committer: Jonathan Ellis jbel...@apache.org Committed: Wed Apr 30 14:08:30 2014 -0500 -- src/java/org/apache/cassandra/service/AbstractRowResolver.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf3f5b6e/src/java/org/apache/cassandra/service/AbstractRowResolver.java -- diff --git a/src/java/org/apache/cassandra/service/AbstractRowResolver.java b/src/java/org/apache/cassandra/service/AbstractRowResolver.java index a84a6b6..9e287cf 100644 --- a/src/java/org/apache/cassandra/service/AbstractRowResolver.java +++ b/src/java/org/apache/cassandra/service/AbstractRowResolver.java @@ -21,6 +21,7 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.List; import java.util.concurrent.ConcurrentLinkedQueue; import org.slf4j.Logger; @@ -37,7 +38,7 @@ public abstract class AbstractRowResolver implements IResponseResolverReadRespo protected final String keyspaceName; // synchronizedList gives us thread-safety without the overhead of guaranteeing uniqueness like a Set would -protected final CollectionMessageInReadResponse replies = Collections.synchronizedList(new ArrayListMessageInReadResponse()); +protected final ListMessageInReadResponse replies = Collections.synchronizedList(new ArrayListMessageInReadResponse()); protected final DecoratedKey key; public AbstractRowResolver(ByteBuffer key, String keyspaceName)
[jira] [Commented] (CASSANDRA-7121) Fix build error introduced by CASSANDRA-7116
[ https://issues.apache.org/jira/browse/CASSANDRA-7121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985943#comment-13985943 ] Benedict commented on CASSANDRA-7121: - That was fast. I probably would have just replaced replies.get(0) with replies.peek(), but no biggy Fix build error introduced by CASSANDRA-7116 Key: CASSANDRA-7121 URL: https://issues.apache.org/jira/browse/CASSANDRA-7121 Project: Cassandra Issue Type: Bug Reporter: Doğan Çeçen Priority: Trivial Attachments: trunk-7121.txt RowDataResolver is calling {{replies.get}} method, but Collection interface doesn't contain {{get}} method (List does). Build reports some errors about this. -- This message was sent by Atlassian JIRA (v6.2#6252)
[2/2] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk Conflicts: src/java/org/apache/cassandra/cql/QueryProcessor.java test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b35486a1 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b35486a1 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b35486a1 Branch: refs/heads/trunk Commit: b35486a19b43eebd3be1d2fec6a827db0903c8cb Parents: cf3f5b6 4485e6d Author: Aleksey Yeschenko alek...@apache.org Authored: Wed Apr 30 21:14:09 2014 +0200 Committer: Aleksey Yeschenko alek...@apache.org Committed: Wed Apr 30 21:14:09 2014 +0200 -- CHANGES.txt | 1 + .../cassandra/cql3/statements/Selection.java| 2 +- .../org/apache/cassandra/db/AbstractCell.java | 39 +--- .../cassandra/db/BufferCounterUpdateCell.java | 6 +-- .../apache/cassandra/db/BufferDeletedCell.java | 8 ++-- .../apache/cassandra/db/BufferExpiringCell.java | 8 ++-- src/java/org/apache/cassandra/db/Cell.java | 9 + .../apache/cassandra/db/CounterMutation.java| 2 +- .../cassandra/db/HintedHandOffManager.java | 2 +- .../apache/cassandra/db/NativeDeletedCell.java | 8 ++-- .../apache/cassandra/db/NativeExpiringCell.java | 8 ++-- .../db/compaction/LazilyCompactedRow.java | 5 +-- .../db/composites/AbstractCellNameType.java | 4 +- .../AbstractSimplePerColumnSecondaryIndex.java | 3 +- .../db/index/SecondaryIndexManager.java | 8 ++-- .../CompositesIndexOnCollectionKey.java | 4 +- .../CompositesIndexOnCollectionValue.java | 10 ++--- .../composites/CompositesIndexOnRegular.java| 8 +--- .../db/index/composites/CompositesSearcher.java | 8 +--- .../cassandra/db/index/keys/KeysIndex.java | 8 +--- .../cassandra/db/index/keys/KeysSearcher.java | 2 +- .../apache/cassandra/service/CacheService.java | 2 +- .../cassandra/thrift/CassandraServer.java | 10 ++--- .../apache/cassandra/db/ColumnFamilyTest.java | 5 ++- .../apache/cassandra/db/CounterCellTest.java| 8 ++-- .../apache/cassandra/db/RangeTombstoneTest.java | 2 +- .../org/apache/cassandra/db/RemoveCellTest.java | 14 +++ .../apache/cassandra/db/RemoveSubCellTest.java | 5 ++- test/unit/org/apache/cassandra/db/RowTest.java | 5 ++- .../db/compaction/CompactionsPurgeTest.java | 6 +-- .../db/index/PerRowSecondaryIndexTest.java | 15 +++- .../cassandra/service/QueryPagerTest.java | 2 +- 32 files changed, 90 insertions(+), 137 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b35486a1/CHANGES.txt -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b35486a1/src/java/org/apache/cassandra/thrift/CassandraServer.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b35486a1/test/unit/org/apache/cassandra/db/RangeTombstoneTest.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b35486a1/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java -- diff --cc test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java index 6a98873,751e7ae..5820312 --- a/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java +++ b/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java @@@ -275,7 -273,7 +275,7 @@@ public class CompactionsPurgeTest exten ColumnFamily cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(key, cfName, System.currentTimeMillis())); assertEquals(10, cf.getColumnCount()); for (Cell c : cf) - assertFalse(c.isMarkedForDelete(System.currentTimeMillis())); -assert c.isLive(); ++assertTrue(c.isLive()); } @Test @@@ -319,7 -317,7 +319,7 @@@ cf = cfs.getColumnFamily(filter); assertEquals(10, cf.getColumnCount()); for (Cell c : cf) - assertFalse(c.isMarkedForDelete(System.currentTimeMillis())); -assert c.isLive(); ++assertTrue(c.isLive()); } @Test
[1/2] git commit: Optimize Cell liveness checks and clean up Cell
Repository: cassandra Updated Branches: refs/heads/trunk cf3f5b6ef - b35486a19 Optimize Cell liveness checks and clean up Cell patch by Aleksey Yeschenko; reviewed by Benedict Elliott Smith for CASSANDRA-7119 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/4485e6db Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/4485e6db Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/4485e6db Branch: refs/heads/trunk Commit: 4485e6dbfed89c9137a58412210e56ae88cfe217 Parents: 9872b74 Author: Aleksey Yeschenko alek...@apache.org Authored: Wed Apr 30 21:06:46 2014 +0200 Committer: Aleksey Yeschenko alek...@apache.org Committed: Wed Apr 30 21:06:46 2014 +0200 -- CHANGES.txt | 1 + .../apache/cassandra/cql/QueryProcessor.java| 4 +- .../cassandra/cql3/statements/Selection.java| 2 +- .../org/apache/cassandra/db/AbstractCell.java | 39 +--- .../cassandra/db/BufferCounterUpdateCell.java | 6 +-- .../apache/cassandra/db/BufferDeletedCell.java | 8 ++-- .../apache/cassandra/db/BufferExpiringCell.java | 8 ++-- src/java/org/apache/cassandra/db/Cell.java | 9 + .../apache/cassandra/db/CounterMutation.java| 2 +- .../cassandra/db/HintedHandOffManager.java | 2 +- .../apache/cassandra/db/NativeDeletedCell.java | 8 ++-- .../apache/cassandra/db/NativeExpiringCell.java | 8 ++-- .../db/compaction/LazilyCompactedRow.java | 5 +-- .../db/composites/AbstractCellNameType.java | 4 +- .../AbstractSimplePerColumnSecondaryIndex.java | 3 +- .../db/index/SecondaryIndexManager.java | 8 ++-- .../CompositesIndexOnCollectionKey.java | 4 +- .../CompositesIndexOnCollectionValue.java | 10 ++--- .../composites/CompositesIndexOnRegular.java| 8 +--- .../db/index/composites/CompositesSearcher.java | 8 +--- .../cassandra/db/index/keys/KeysIndex.java | 8 +--- .../cassandra/db/index/keys/KeysSearcher.java | 2 +- .../apache/cassandra/service/CacheService.java | 2 +- .../cassandra/thrift/CassandraServer.java | 10 ++--- .../apache/cassandra/db/ColumnFamilyTest.java | 5 ++- .../apache/cassandra/db/CounterCellTest.java| 8 ++-- .../apache/cassandra/db/RangeTombstoneTest.java | 2 +- .../org/apache/cassandra/db/RemoveCellTest.java | 14 +++ .../apache/cassandra/db/RemoveSubCellTest.java | 5 ++- test/unit/org/apache/cassandra/db/RowTest.java | 5 ++- .../db/compaction/CompactionsPurgeTest.java | 6 +-- .../db/index/PerRowSecondaryIndexTest.java | 15 +++- .../cassandra/service/QueryPagerTest.java | 2 +- 33 files changed, 92 insertions(+), 139 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/4485e6db/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index a4811f6..34533cc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -55,6 +55,7 @@ * Multi-threaded scrub/cleanup/upgradesstables (CASSANDRA-5547) * Optimize cellname comparison (CASSANDRA-6934) * Native protocol v3 (CASSANDRA-6855) + * Optimize Cell liveness checks and clean up Cell (CASSANDRA-7119) Merged from 2.0: * Allow overriding cassandra-rackdc.properties file (CASSANDRA-7072) * Set JMX RMI port to 7199 (CASSANDRA-7087) http://git-wip-us.apache.org/repos/asf/cassandra/blob/4485e6db/src/java/org/apache/cassandra/cql/QueryProcessor.java -- diff --git a/src/java/org/apache/cassandra/cql/QueryProcessor.java b/src/java/org/apache/cassandra/cql/QueryProcessor.java index 3b3..3c1d555 100644 --- a/src/java/org/apache/cassandra/cql/QueryProcessor.java +++ b/src/java/org/apache/cassandra/cql/QueryProcessor.java @@ -469,7 +469,7 @@ public class QueryProcessor { for (org.apache.cassandra.db.Cell c : row.cf.getSortedColumns()) { -if (c.isMarkedForDelete(now)) +if (!c.isLive(now)) continue; ColumnDefinition cd = metadata.getColumnDefinition(c.name()); @@ -515,7 +515,7 @@ public class QueryProcessor if (cd != null) result.schema.value_types.put(nameBytes, TypeParser.getShortName(cd.type)); org.apache.cassandra.db.Cell c = row.cf.getColumn(name); -if (c == null || c.isMarkedForDelete(System.currentTimeMillis())) +if (c == null || !c.isLive()) thriftColumns.add(new Column().setName(nameBytes));
[jira] [Commented] (CASSANDRA-6546) disablethrift results in unclosed file descriptors
[ https://issues.apache.org/jira/browse/CASSANDRA-6546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985953#comment-13985953 ] Mikhail Stepura commented on CASSANDRA-6546: For some reason {{ThriftSessionManager.connectionComplete(SocketAddress)}} is never called in this case. {code} mstepura-mac:logs mikhail$ lsof -p 84299 | grep CLOSE_WAIT | wc -l 150 {code} And all those 150 connections are still sitting in ThriftSessionManager disablethrift results in unclosed file descriptors -- Key: CASSANDRA-6546 URL: https://issues.apache.org/jira/browse/CASSANDRA-6546 Project: Cassandra Issue Type: Bug Reporter: Jason Harvey Assignee: Mikhail Stepura Priority: Minor Attachments: 2014-04-30 12-22-17.png, 2014-04-30 12-22-58.png Disabling thrift results in unclosed thrift sockets being left around. Steps to reproduce and observe: 1. Have a handful of clients connect via thrift. 2. Disable thrift. 3. Enable thrift, have the clients reconnect. 4. Observe netstat or lsof, and you'll find a lot of thrift sockets in CLOSE_WAIT state, and they'll never go away. * Also verifiable from org.apache.cassandra.metrics:type=Client,name=connectedThriftClients MBean. What's extra fun about this is the leaked sockets still count towards your maximum RPC thread count. As a result, toggling thrift enough times will result in an rpc_max_threads number of CLOSED_WAIT sockets, with no new clients able to connect. This was reproduced with HSHA. I haven't tried it in sync yet. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-6546) disablethrift results in unclosed file descriptors
[ https://issues.apache.org/jira/browse/CASSANDRA-6546?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mikhail Stepura updated CASSANDRA-6546: --- Attachment: 2014-04-30 12-22-17.png 2014-04-30 12-22-58.png disablethrift results in unclosed file descriptors -- Key: CASSANDRA-6546 URL: https://issues.apache.org/jira/browse/CASSANDRA-6546 Project: Cassandra Issue Type: Bug Reporter: Jason Harvey Assignee: Mikhail Stepura Priority: Minor Attachments: 2014-04-30 12-22-17.png, 2014-04-30 12-22-58.png Disabling thrift results in unclosed thrift sockets being left around. Steps to reproduce and observe: 1. Have a handful of clients connect via thrift. 2. Disable thrift. 3. Enable thrift, have the clients reconnect. 4. Observe netstat or lsof, and you'll find a lot of thrift sockets in CLOSE_WAIT state, and they'll never go away. * Also verifiable from org.apache.cassandra.metrics:type=Client,name=connectedThriftClients MBean. What's extra fun about this is the leaked sockets still count towards your maximum RPC thread count. As a result, toggling thrift enough times will result in an rpc_max_threads number of CLOSED_WAIT sockets, with no new clients able to connect. This was reproduced with HSHA. I haven't tried it in sync yet. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Comment Edited] (CASSANDRA-6546) disablethrift results in unclosed file descriptors
[ https://issues.apache.org/jira/browse/CASSANDRA-6546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13985953#comment-13985953 ] Mikhail Stepura edited comment on CASSANDRA-6546 at 4/30/14 7:27 PM: - For some reason {{ThriftSessionManager.connectionComplete(SocketAddress)}} is never called in this case. {code} mstepura-mac:logs mikhail$ lsof -p 84299 | grep CLOSE_WAIT | wc -l 150 {code} And all those 150 connections are still sitting in ThriftSessionManager !2014-04-30 12-22-17.png! !2014-04-30 12-22-58.png! was (Author: mishail): For some reason {{ThriftSessionManager.connectionComplete(SocketAddress)}} is never called in this case. {code} mstepura-mac:logs mikhail$ lsof -p 84299 | grep CLOSE_WAIT | wc -l 150 {code} And all those 150 connections are still sitting in ThriftSessionManager disablethrift results in unclosed file descriptors -- Key: CASSANDRA-6546 URL: https://issues.apache.org/jira/browse/CASSANDRA-6546 Project: Cassandra Issue Type: Bug Reporter: Jason Harvey Assignee: Mikhail Stepura Priority: Minor Attachments: 2014-04-30 12-22-17.png, 2014-04-30 12-22-58.png Disabling thrift results in unclosed thrift sockets being left around. Steps to reproduce and observe: 1. Have a handful of clients connect via thrift. 2. Disable thrift. 3. Enable thrift, have the clients reconnect. 4. Observe netstat or lsof, and you'll find a lot of thrift sockets in CLOSE_WAIT state, and they'll never go away. * Also verifiable from org.apache.cassandra.metrics:type=Client,name=connectedThriftClients MBean. What's extra fun about this is the leaked sockets still count towards your maximum RPC thread count. As a result, toggling thrift enough times will result in an rpc_max_threads number of CLOSED_WAIT sockets, with no new clients able to connect. This was reproduced with HSHA. I haven't tried it in sync yet. -- This message was sent by Atlassian JIRA (v6.2#6252)