You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2014/05/07 10:51:02 UTC
[1/3] git commit: Warn when timestamps are provided on CAS batch
Repository: cassandra
Updated Branches:
refs/heads/cassandra-2.1 4d9da02fb -> 0ca494240
Warn when timestamps are provided on CAS batch
patch by slebresne; reviewed by iamaleksey for CASSANDRA-7067
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/32e1b16b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/32e1b16b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/32e1b16b
Branch: refs/heads/cassandra-2.1
Commit: 32e1b16b81af5afb244860af9dad368575d69988
Parents: b4a3b52
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Wed May 7 10:27:04 2014 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Wed May 7 10:27:04 2014 +0200
----------------------------------------------------------------------
CHANGES.txt | 4 ++++
.../cql3/statements/BatchStatement.java | 24 +++++++++++++++++++-
2 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/32e1b16b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 517f0ab..1e60fc3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,7 @@
+2.0.9
+ * Warn when 'USING TIMESTAMP' is used on a CAS BATCH (CASSANDRA-7067)
+
+
2.0.8
* Correctly delete scheduled range xfers (CASSANDRA-7143)
* Make batchlog replica selection rack-aware (CASSANDRA-6551)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/32e1b16b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
index 8e61ae5..c03548b 100644
--- a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
@@ -41,6 +41,9 @@ import org.apache.cassandra.transport.messages.ResultMessage;
*/
public class BatchStatement implements CQLStatement, MeasurableForPreparedCache
{
+ private static boolean loggedCASTimestamp = false;
+ private static boolean loggedCounterTimestamp = false;
+
public static enum Type
{
LOGGED, UNLOGGED, COUNTER
@@ -102,9 +105,28 @@ public class BatchStatement implements CQLStatement, MeasurableForPreparedCache
if (attrs.isTimeToLiveSet())
throw new InvalidRequestException("Global TTL on the BATCH statement is not supported.");
+ boolean timestampSet = attrs.isTimestampSet();
+ if (timestampSet)
+ {
+ if (hasConditions && !loggedCASTimestamp)
+ {
+ logger.warn("Detected use of 'USING TIMESTAMP' on a BATCH with conditions. This is invalid, " +
+ "custom timestamps are not allowed when conditions are used and the timestamp has been ignored. " +
+ "Such queries will be rejected in Cassandra 2.1+ - please fix your queries before then.");
+ loggedCASTimestamp = true;
+ }
+ if (type == Type.COUNTER && !loggedCounterTimestamp)
+ {
+ logger.warn("Detected use of 'USING TIMESTAMP' in a counter BATCH. This is invalid " +
+ "because counters do not use timestamps, and the timestamp has been ignored. " +
+ "Such queries will be rejected in Cassandra 2.1+ - please fix your queries before then.");
+ loggedCounterTimestamp = true;
+ }
+ }
+
for (ModificationStatement statement : statements)
{
- if (attrs.isTimestampSet() && statement.isTimestampSet())
+ if (timestampSet && statement.isTimestampSet())
throw new InvalidRequestException("Timestamp must be set either on BATCH or individual statements");
}
}
[3/3] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Posted by sl...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1
Conflicts:
CHANGES.txt
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/0ca49424
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0ca49424
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0ca49424
Branch: refs/heads/cassandra-2.1
Commit: 0ca4942403f18e3d6a84034330c533bfbfacb320
Parents: 4d9da02 19ff193
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Wed May 7 10:50:54 2014 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Wed May 7 10:50:54 2014 +0200
----------------------------------------------------------------------
CHANGES.txt | 4 ----
.../apache/cassandra/cql3/statements/BatchStatement.java | 11 ++++++++++-
2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0ca49424/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index c03cc36,fc192ef..684d003
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -16,75 -25,20 +16,71 @@@ Merged from 1.2
* remove duplicate query for local tokens (CASSANDRA-7182)
-2.0.7
+2.1.0-beta2
+ * Increase default CL space to 8GB (CASSANDRA-7031)
+ * Add range tombstones to read repair digests (CASSANDRA-6863)
+ * Fix BTree.clear for large updates (CASSANDRA-6943)
+ * Fail write instead of logging a warning when unable to append to CL
+ (CASSANDRA-6764)
+ * Eliminate possibility of CL segment appearing twice in active list
+ (CASSANDRA-6557)
+ * Apply DONTNEED fadvise to commitlog segments (CASSANDRA-6759)
+ * Switch CRC component to Adler and include it for compressed sstables
+ (CASSANDRA-4165)
+ * Allow cassandra-stress to set compaction strategy options (CASSANDRA-6451)
+ * Add broadcast_rpc_address option to cassandra.yaml (CASSANDRA-5899)
+ * Auto reload GossipingPropertyFileSnitch config (CASSANDRA-5897)
+ * Fix overflow of memtable_total_space_in_mb (CASSANDRA-6573)
+ * Fix ABTC NPE and apply update function correctly (CASSANDRA-6692)
+ * Allow nodetool to use a file or prompt for password (CASSANDRA-6660)
+ * Fix AIOOBE when concurrently accessing ABSC (CASSANDRA-6742)
+ * Fix assertion error in ALTER TYPE RENAME (CASSANDRA-6705)
+ * Scrub should not always clear out repaired status (CASSANDRA-5351)
+ * Improve handling of range tombstone for wide partitions (CASSANDRA-6446)
+ * Fix ClassCastException for compact table with composites (CASSANDRA-6738)
+ * Fix potentially repairing with wrong nodes (CASSANDRA-6808)
+ * Change caching option syntax (CASSANDRA-6745)
+ * Fix stress to do proper counter reads (CASSANDRA-6835)
+ * Fix help message for stress counter_write (CASSANDRA-6824)
+ * Fix stress smart Thrift client to pick servers correctly (CASSANDRA-6848)
+ * Add logging levels (minimal, normal or verbose) to stress tool (CASSANDRA-6849)
+ * Fix race condition in Batch CLE (CASSANDRA-6860)
+ * Improve cleanup/scrub/upgradesstables failure handling (CASSANDRA-6774)
+ * ByteBuffer write() methods for serializing sstables (CASSANDRA-6781)
+ * Proper compare function for CollectionType (CASSANDRA-6783)
+ * Update native server to Netty 4 (CASSANDRA-6236)
+ * Fix off-by-one error in stress (CASSANDRA-6883)
+ * Make OpOrder AutoCloseable (CASSANDRA-6901)
+ * Remove sync repair JMX interface (CASSANDRA-6900)
+ * Add multiple memory allocation options for memtables (CASSANDRA-6689, 6694)
+ * Remove adjusted op rate from stress output (CASSANDRA-6921)
+ * Add optimized CF.hasColumns() implementations (CASSANDRA-6941)
+ * Serialize batchlog mutations with the version of the target node
+ (CASSANDRA-6931)
+ * Optimize CounterColumn#reconcile() (CASSANDRA-6953)
+ * Properly remove 1.2 sstable support in 2.1 (CASSANDRA-6869)
+ * Lock counter cells, not partitions (CASSANDRA-6880)
+ * Track presence of legacy counter shards in sstables (CASSANDRA-6888)
+ * Ensure safe resource cleanup when replacing sstables (CASSANDRA-6912)
+ * Add failure handler to async callback (CASSANDRA-6747)
+ * Fix AE when closing SSTable without releasing reference (CASSANDRA-7000)
+ * Clean up IndexInfo on keyspace/table drops (CASSANDRA-6924)
+ * Only snapshot relative SSTables when sequential repair (CASSANDRA-7024)
+ * Require nodetool rebuild_index to specify index names (CASSANDRA-7038)
+ * fix cassandra stress errors on reads with native protocol (CASSANDRA-7033)
+ * Use OpOrder to guard sstable references for reads (CASSANDRA-6919)
+ * Preemptive opening of compaction result (CASSANDRA-6916)
+ * 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)
+ * Support consistent range movements (CASSANDRA-2434)
+Merged from 2.0:
+ * Allow overriding cassandra-rackdc.properties file (CASSANDRA-7072)
+ * Set JMX RMI port to 7199 (CASSANDRA-7087)
+ * Use LOCAL_QUORUM for data reads at LOCAL_SERIAL (CASSANDRA-6939)
+ * Log a warning for large batches (CASSANDRA-6487)
* Put nodes in hibernate when join_ring is false (CASSANDRA-6961)
- * Continue assassinating even if the endpoint vanishes (CASSANDRA-6787)
- * Non-droppable verbs shouldn't be dropped from OTC (CASSANDRA-6980)
- * Shutdown batchlog executor in SS#drain() (CASSANDRA-7025)
- * Schedule schema pulls on change (CASSANDRA-6971)
* Avoid early loading of non-system keyspaces before compaction-leftovers
cleanup at startup (CASSANDRA-6913)
* Restrict Windows to parallel repairs (CASSANDRA-6907)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0ca49424/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
index 95d504d,c03548b..a7d06df
--- a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
@@@ -104,9 -105,28 +104,18 @@@ public class BatchStatement implements
if (attrs.isTimeToLiveSet())
throw new InvalidRequestException("Global TTL on the BATCH statement is not supported.");
+ boolean timestampSet = attrs.isTimestampSet();
+ if (timestampSet)
+ {
- if (hasConditions && !loggedCASTimestamp)
- {
- logger.warn("Detected use of 'USING TIMESTAMP' on a BATCH with conditions. This is invalid, " +
- "custom timestamps are not allowed when conditions are used and the timestamp has been ignored. " +
- "Such queries will be rejected in Cassandra 2.1+ - please fix your queries before then.");
- loggedCASTimestamp = true;
- }
- if (type == Type.COUNTER && !loggedCounterTimestamp)
- {
- logger.warn("Detected use of 'USING TIMESTAMP' in a counter BATCH. This is invalid " +
- "because counters do not use timestamps, and the timestamp has been ignored. " +
- "Such queries will be rejected in Cassandra 2.1+ - please fix your queries before then.");
- loggedCounterTimestamp = true;
- }
++ if (hasConditions)
++ throw new InvalidRequestException("Cannot provide custom timestamp for conditional BATCH");
++ if (type == Type.COUNTER)
++ throw new InvalidRequestException("Cannot provide custom timestamp for counter BATCH");
+ }
+
for (ModificationStatement statement : statements)
{
- if (attrs.isTimestampSet() && statement.isTimestampSet())
+ if (timestampSet && statement.isTimestampSet())
throw new InvalidRequestException("Timestamp must be set either on BATCH or individual statements");
}
}
[2/3] git commit: Remove duplicate entries in changelog
Posted by sl...@apache.org.
Remove duplicate entries in changelog
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/19ff1932
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/19ff1932
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/19ff1932
Branch: refs/heads/cassandra-2.1
Commit: 19ff1932cd3275f114a8820d3a5d0cdf176aa261
Parents: 32e1b16
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Wed May 7 10:30:14 2014 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Wed May 7 10:30:14 2014 +0200
----------------------------------------------------------------------
CHANGES.txt | 4 ----
1 file changed, 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/19ff1932/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1e60fc3..fc192ef 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -39,10 +39,6 @@ Merged from 1.2:
2.0.7
* Put nodes in hibernate when join_ring is false (CASSANDRA-6961)
- * Continue assassinating even if the endpoint vanishes (CASSANDRA-6787)
- * Non-droppable verbs shouldn't be dropped from OTC (CASSANDRA-6980)
- * Shutdown batchlog executor in SS#drain() (CASSANDRA-7025)
- * Schedule schema pulls on change (CASSANDRA-6971)
* Avoid early loading of non-system keyspaces before compaction-leftovers
cleanup at startup (CASSANDRA-6913)
* Restrict Windows to parallel repairs (CASSANDRA-6907)