You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2014/04/25 02:43:45 UTC
[1/4] git commit: Fix CFMetaData#getColumnDefinitionFromColumnName()
Repository: cassandra
Updated Branches:
refs/heads/trunk 16bb16ed2 -> bd6431323
Fix CFMetaData#getColumnDefinitionFromColumnName()
patch by Benedict Elliott Smith; reviewed by Aleksey Yeschenko for
CASSANDRA-7074
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/72203c50
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/72203c50
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/72203c50
Branch: refs/heads/trunk
Commit: 72203c503767618ba89c6ed03c0ed091dc6e701b
Parents: 9359b7a
Author: belliottsmith <gi...@sub.laerad.com>
Authored: Fri Apr 25 03:01:41 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Fri Apr 25 03:14:56 2014 +0300
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../cassandra/cache/SerializingCache.java | 52 +++++++++++++++-----
2 files changed, 42 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/72203c50/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 69e9d37..b3470bf 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -11,6 +11,7 @@
* 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)
1.2.16
http://git-wip-us.apache.org/repos/asf/cassandra/blob/72203c50/src/java/org/apache/cassandra/cache/SerializingCache.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cache/SerializingCache.java b/src/java/org/apache/cassandra/cache/SerializingCache.java
index c7430d2..58da56b 100644
--- a/src/java/org/apache/cassandra/cache/SerializingCache.java
+++ b/src/java/org/apache/cassandra/cache/SerializingCache.java
@@ -20,6 +20,7 @@ package org.apache.cassandra.cache;
import java.io.IOException;
import java.util.Set;
+import com.google.common.base.Throwables;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -92,7 +93,7 @@ public class SerializingCache<K, V> implements ICache<K, V>
}
catch (IOException e)
{
- logger.debug("Cannot fetch in memory data, we will failback to read from disk ", e);
+ logger.debug("Cannot fetch in memory data, we will fallback to read from disk ", e);
return null;
}
}
@@ -119,6 +120,7 @@ public class SerializingCache<K, V> implements ICache<K, V>
}
catch (IOException e)
{
+ freeableMemory.unreference();
throw new RuntimeException(e);
}
return freeableMemory;
@@ -177,7 +179,17 @@ public class SerializingCache<K, V> implements ICache<K, V>
if (mem == null)
return; // out of memory. never mind.
- RefCountedMemory old = map.put(key, mem);
+ RefCountedMemory old;
+ try
+ {
+ old = map.put(key, mem);
+ }
+ catch (Throwable t)
+ {
+ mem.unreference();
+ throw Throwables.propagate(t);
+ }
+
if (old != null)
old.unreference();
}
@@ -188,7 +200,17 @@ public class SerializingCache<K, V> implements ICache<K, V>
if (mem == null)
return false; // out of memory. never mind.
- RefCountedMemory old = map.putIfAbsent(key, mem);
+ RefCountedMemory old;
+ try
+ {
+ old = map.putIfAbsent(key, mem);
+ }
+ catch (Throwable t)
+ {
+ mem.unreference();
+ throw Throwables.propagate(t);
+ }
+
if (old != null)
// the new value was not put, we've uselessly allocated some memory, free it
mem.unreference();
@@ -202,24 +224,32 @@ public class SerializingCache<K, V> implements ICache<K, V>
if (old == null)
return false;
+ V oldValue;
+ // reference old guy before de-serializing
+ if (!old.reference())
+ return false; // we have already freed hence noop.
+
+ oldValue = deserialize(old);
+ old.unreference();
+
+ if (!oldValue.equals(oldToReplace))
+ return false;
+
// see if the old value matches the one we want to replace
RefCountedMemory mem = serialize(value);
if (mem == null)
return false; // out of memory. never mind.
- V oldValue;
- // reference old guy before de-serializing
- if (!old.reference())
- return false; // we have already freed hence noop.
+ boolean success;
try
{
- oldValue = deserialize(old);
+ success = map.replace(key, old, mem);
}
- finally
+ catch (Throwable t)
{
- old.unreference();
+ mem.unreference();
+ throw Throwables.propagate(t);
}
- boolean success = oldValue.equals(oldToReplace) && map.replace(key, old, mem);
if (success)
old.unreference(); // so it will be eventually be cleaned
[3/4] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Posted by al...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1
Conflicts:
CHANGES.txt
src/java/org/apache/cassandra/cache/RefCountedMemory.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f5fd02f4
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f5fd02f4
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f5fd02f4
Branch: refs/heads/trunk
Commit: f5fd02f453cd06573b7a4a70c03f6435727705b8
Parents: ab87f83 871a603
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Fri Apr 25 03:42:53 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Fri Apr 25 03:42:53 2014 +0300
----------------------------------------------------------------------
CHANGES.txt | 3 +-
.../cassandra/cache/RefCountedMemory.java | 7 ++-
.../cassandra/cache/SerializingCache.java | 53 +++++++++++++++-----
3 files changed, 48 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/f5fd02f4/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 11630e7,73c5034..9c78e33
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,59 -1,4 +1,58 @@@
-2.0.8
+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)
+ * 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)
+Merged from 2.0:
- 2.0.8
* 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)
@@@ -124,9 -78,7 +123,11 @@@ Merged from 1.2
* Schedule schema pulls on change (CASSANDRA-6971)
* Non-droppable verbs shouldn't be dropped from OTC (CASSANDRA-6980)
* Shutdown batchlog executor in SS#drain() (CASSANDRA-7025)
+ * Fix batchlog to account for CF truncation records (CASSANDRA-6999)
+ * Fix CQLSH parsing of functions and BLOB literals (CASSANDRA-7018)
* Properly load trustore in the native protocol (CASSANDRA-6847)
++ * Always clean up references in SerializingCache (CASSANDRA-6994)
++ * Don't shut MessagingService down when replacing a node (CASSANDRA-6476)
2.0.6
http://git-wip-us.apache.org/repos/asf/cassandra/blob/f5fd02f4/src/java/org/apache/cassandra/cache/RefCountedMemory.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cache/RefCountedMemory.java
index e5c543e,43c87b9..fd26e2b
--- a/src/java/org/apache/cassandra/cache/RefCountedMemory.java
+++ b/src/java/org/apache/cassandra/cache/RefCountedMemory.java
@@@ -21,10 -21,9 +21,9 @@@ import java.util.concurrent.atomic.Atom
import org.apache.cassandra.io.util.Memory;
- public class RefCountedMemory extends Memory
+ public class RefCountedMemory extends Memory implements AutoCloseable
{
- private volatile int references = 1;
- private final AtomicInteger references = new AtomicInteger(1);
+ private static final AtomicIntegerFieldUpdater<RefCountedMemory> UPDATER = AtomicIntegerFieldUpdater.newUpdater(RefCountedMemory.class, "references");
public RefCountedMemory(long size)
{
@@@ -50,20 -49,12 +49,24 @@@
/** decrement reference count. if count reaches zero, the object is freed. */
public void unreference()
{
- if (references.decrementAndGet() == 0)
- free();
+ if (UPDATER.decrementAndGet(this) == 0)
+ super.free();
+ }
+
+ public RefCountedMemory copy(long newSize)
+ {
+ RefCountedMemory copy = new RefCountedMemory(newSize);
+ copy.put(0, this, 0, Math.min(size(), newSize));
+ return copy;
+ }
+
+ public void free()
+ {
+ throw new AssertionError();
}
+ public void close()
+ {
+ unreference();
+ }
}
[2/4] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Posted by al...@apache.org.
Merge branch 'cassandra-1.2' into cassandra-2.0
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/871a6030
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/871a6030
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/871a6030
Branch: refs/heads/trunk
Commit: 871a6030bc6ed475e652e67a8631338010c607dc
Parents: b9bb2c8 72203c5
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Fri Apr 25 03:19:17 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Fri Apr 25 03:19:17 2014 +0300
----------------------------------------------------------------------
CHANGES.txt | 2 +
.../cassandra/cache/RefCountedMemory.java | 7 ++-
.../cassandra/cache/SerializingCache.java | 53 +++++++++++++++-----
3 files changed, 49 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/871a6030/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 0b6aeaa,b3470bf..73c5034
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -12,61 -10,11 +12,63 @@@ 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)
-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 query with composite start/finish (CASSANDRA-6825)
+ * Fix unintended update with conditional statement (CASSANDRA-6893)
+ * Fix map element access in IF (CASSANDRA-6914)
+ * Avoid costly range calculations for range queries on system keyspaces
+ (CASSANDRA-6906)
+ * Fix SSTable not released if stream session fails (CASSANDRA-6818)
+ * Avoid build failure due to ANTLR timeout (CASSANDRA-6991)
+Merged from 1.2:
* 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/871a6030/src/java/org/apache/cassandra/cache/RefCountedMemory.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cache/RefCountedMemory.java
index 887bd86,887bd86..43c87b9
--- a/src/java/org/apache/cassandra/cache/RefCountedMemory.java
+++ b/src/java/org/apache/cassandra/cache/RefCountedMemory.java
@@@ -21,7 -21,7 +21,7 @@@ import java.util.concurrent.atomic.Atom
import org.apache.cassandra.io.util.Memory;
--public class RefCountedMemory extends Memory
++public class RefCountedMemory extends Memory implements AutoCloseable
{
private final AtomicInteger references = new AtomicInteger(1);
@@@ -52,4 -52,4 +52,9 @@@
if (references.decrementAndGet() == 0)
free();
}
++
++ public void close()
++ {
++ unreference();
++ }
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/871a6030/src/java/org/apache/cassandra/cache/SerializingCache.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cache/SerializingCache.java
index 2210f10,58da56b..ca65fcc
--- a/src/java/org/apache/cassandra/cache/SerializingCache.java
+++ b/src/java/org/apache/cassandra/cache/SerializingCache.java
@@@ -68,7 -69,7 +68,7 @@@ public class SerializingCache<K, V> imp
public static <K, V> SerializingCache<K, V> create(long weightedCapacity, Weigher<RefCountedMemory> weigher, ISerializer<V> serializer)
{
-- return new SerializingCache<K, V>(weightedCapacity, weigher, serializer);
++ return new SerializingCache<>(weightedCapacity, weigher, serializer);
}
public static <K, V> SerializingCache<K, V> create(long weightedCapacity, ISerializer<V> serializer)
@@@ -177,7 -179,17 +178,17 @@@
if (mem == null)
return; // out of memory. never mind.
- RefCountedMemory old = map.put(key, mem);
+ RefCountedMemory old;
+ try
+ {
+ old = map.put(key, mem);
+ }
+ catch (Throwable t)
+ {
+ mem.unreference();
- throw Throwables.propagate(t);
++ throw t;
+ }
+
if (old != null)
old.unreference();
}
@@@ -188,7 -200,17 +199,17 @@@
if (mem == null)
return false; // out of memory. never mind.
- RefCountedMemory old = map.putIfAbsent(key, mem);
+ RefCountedMemory old;
+ try
+ {
+ old = map.putIfAbsent(key, mem);
+ }
+ catch (Throwable t)
+ {
+ mem.unreference();
- throw Throwables.propagate(t);
++ throw t;
+ }
+
if (old != null)
// the new value was not put, we've uselessly allocated some memory, free it
mem.unreference();
@@@ -207,19 -240,16 +239,16 @@@
if (mem == null)
return false; // out of memory. never mind.
- V oldValue;
- // reference old guy before de-serializing
- if (!old.reference())
- return false; // we have already freed hence noop.
+ boolean success;
try
{
- oldValue = deserialize(old);
+ success = map.replace(key, old, mem);
}
- finally
+ catch (Throwable t)
{
- old.unreference();
+ mem.unreference();
- throw Throwables.propagate(t);
++ throw t;
}
- boolean success = oldValue.equals(oldToReplace) && map.replace(key, old, mem);
if (success)
old.unreference(); // so it will be eventually be cleaned
[4/4] git commit: Merge branch 'cassandra-2.1' into trunk
Posted by al...@apache.org.
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/bd643132
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/bd643132
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/bd643132
Branch: refs/heads/trunk
Commit: bd64313231a91f879697450998ca5cffa49bcc2f
Parents: 16bb16e f5fd02f
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Fri Apr 25 03:43:29 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Fri Apr 25 03:43:29 2014 +0300
----------------------------------------------------------------------
CHANGES.txt | 3 +-
.../cassandra/cache/RefCountedMemory.java | 7 ++-
.../cassandra/cache/SerializingCache.java | 53 +++++++++++++++-----
3 files changed, 48 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/bd643132/CHANGES.txt
----------------------------------------------------------------------