You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2013/12/14 05:11:53 UTC

[1/6] git commit: fix race referencing tokenMetadataCache patch by jbellis; reviewed by rbranson for CASSANDRA-6485

Updated Branches:
  refs/heads/cassandra-1.2 11455738f -> a3d91dc9d
  refs/heads/cassandra-2.0 c96097595 -> a3796f5f7
  refs/heads/trunk fe58dffef -> 14ebfbf7f


fix race referencing tokenMetadataCache
patch by jbellis; reviewed by rbranson for CASSANDRA-6485


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a3d91dc9
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a3d91dc9
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a3d91dc9

Branch: refs/heads/cassandra-1.2
Commit: a3d91dc9d67572e16d9ad92f22b89eb969373899
Parents: 1145573
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Dec 13 22:10:13 2013 -0600
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Dec 13 22:10:13 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                              |  7 ++-----
 .../cassandra/locator/AbstractReplicationStrategy.java   | 11 ++++++-----
 2 files changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3d91dc9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b7bbe09..e586592 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,9 +1,6 @@
-1.2.14
- * Randomize batchlog candidates selection (CASSANDRA-6481)
-
-
 1.2.13
- * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345)
+ * Randomize batchlog candidates selection (CASSANDRA-6481)
+ * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345, 6485)
  * Optimize FD phi calculation (CASSANDRA-6386)
  * Improve initial FD phi estimate when starting up (CASSANDRA-6385)
  * Don't list CQL3 table in CLI describe even if named explicitely 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3d91dc9/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
index 51c4119..c36fde4 100644
--- a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
+++ b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
@@ -116,19 +116,20 @@ public abstract class AbstractReplicationStrategy
         ArrayList<InetAddress> endpoints = getCachedEndpoints(keyToken);
         if (endpoints == null)
         {
-            if (tokenMetadataClone == null)
+            TokenMetadata tm; // local reference in case another thread nulls tMC out from under us
+            if ((tm = tokenMetadataClone) == null)
             {
                 // synchronize to prevent thundering herd post-invalidation
                 synchronized (this)
                 {
-                    if (tokenMetadataClone == null)
-                        tokenMetadataClone = tokenMetadata.cloneOnlyTokenMap();
+                    if ((tm = tokenMetadataClone) == null)
+                        tm = tokenMetadataClone = tokenMetadata.cloneOnlyTokenMap();
                 }
                 // if our clone got invalidated, it's possible there is a new token to account for too
-                keyToken = TokenMetadata.firstToken(tokenMetadataClone.sortedTokens(), searchToken);
+                keyToken = TokenMetadata.firstToken(tm.sortedTokens(), searchToken);
             }
 
-            endpoints = new ArrayList<InetAddress>(calculateNaturalEndpoints(searchToken, tokenMetadataClone));
+            endpoints = new ArrayList<InetAddress>(calculateNaturalEndpoints(searchToken, tm));
             cachedEndpoints.put(keyToken, endpoints);
         }
 


[6/6] git commit: Merge branch 'cassandra-2.0' into trunk

Posted by jb...@apache.org.
Merge branch 'cassandra-2.0' into trunk


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/14ebfbf7
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/14ebfbf7
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/14ebfbf7

Branch: refs/heads/trunk
Commit: 14ebfbf7f8b5091ba2d9a5f6cbb34a00cdb5dbc3
Parents: fe58dff a3796f5
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Dec 13 22:11:35 2013 -0600
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Dec 13 22:11:35 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                              |  3 ++-
 .../cassandra/locator/AbstractReplicationStrategy.java   | 11 ++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/14ebfbf7/CHANGES.txt
----------------------------------------------------------------------


[2/6] git commit: fix race referencing tokenMetadataCache patch by jbellis; reviewed by rbranson for CASSANDRA-6485

Posted by jb...@apache.org.
fix race referencing tokenMetadataCache
patch by jbellis; reviewed by rbranson for CASSANDRA-6485


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a3d91dc9
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a3d91dc9
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a3d91dc9

Branch: refs/heads/cassandra-2.0
Commit: a3d91dc9d67572e16d9ad92f22b89eb969373899
Parents: 1145573
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Dec 13 22:10:13 2013 -0600
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Dec 13 22:10:13 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                              |  7 ++-----
 .../cassandra/locator/AbstractReplicationStrategy.java   | 11 ++++++-----
 2 files changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3d91dc9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b7bbe09..e586592 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,9 +1,6 @@
-1.2.14
- * Randomize batchlog candidates selection (CASSANDRA-6481)
-
-
 1.2.13
- * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345)
+ * Randomize batchlog candidates selection (CASSANDRA-6481)
+ * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345, 6485)
  * Optimize FD phi calculation (CASSANDRA-6386)
  * Improve initial FD phi estimate when starting up (CASSANDRA-6385)
  * Don't list CQL3 table in CLI describe even if named explicitely 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3d91dc9/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
index 51c4119..c36fde4 100644
--- a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
+++ b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
@@ -116,19 +116,20 @@ public abstract class AbstractReplicationStrategy
         ArrayList<InetAddress> endpoints = getCachedEndpoints(keyToken);
         if (endpoints == null)
         {
-            if (tokenMetadataClone == null)
+            TokenMetadata tm; // local reference in case another thread nulls tMC out from under us
+            if ((tm = tokenMetadataClone) == null)
             {
                 // synchronize to prevent thundering herd post-invalidation
                 synchronized (this)
                 {
-                    if (tokenMetadataClone == null)
-                        tokenMetadataClone = tokenMetadata.cloneOnlyTokenMap();
+                    if ((tm = tokenMetadataClone) == null)
+                        tm = tokenMetadataClone = tokenMetadata.cloneOnlyTokenMap();
                 }
                 // if our clone got invalidated, it's possible there is a new token to account for too
-                keyToken = TokenMetadata.firstToken(tokenMetadataClone.sortedTokens(), searchToken);
+                keyToken = TokenMetadata.firstToken(tm.sortedTokens(), searchToken);
             }
 
-            endpoints = new ArrayList<InetAddress>(calculateNaturalEndpoints(searchToken, tokenMetadataClone));
+            endpoints = new ArrayList<InetAddress>(calculateNaturalEndpoints(searchToken, tm));
             cachedEndpoints.put(keyToken, endpoints);
         }
 


[3/6] git commit: fix race referencing tokenMetadataCache patch by jbellis; reviewed by rbranson for CASSANDRA-6485

Posted by jb...@apache.org.
fix race referencing tokenMetadataCache
patch by jbellis; reviewed by rbranson for CASSANDRA-6485


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a3d91dc9
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a3d91dc9
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a3d91dc9

Branch: refs/heads/trunk
Commit: a3d91dc9d67572e16d9ad92f22b89eb969373899
Parents: 1145573
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Dec 13 22:10:13 2013 -0600
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Dec 13 22:10:13 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                              |  7 ++-----
 .../cassandra/locator/AbstractReplicationStrategy.java   | 11 ++++++-----
 2 files changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3d91dc9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b7bbe09..e586592 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,9 +1,6 @@
-1.2.14
- * Randomize batchlog candidates selection (CASSANDRA-6481)
-
-
 1.2.13
- * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345)
+ * Randomize batchlog candidates selection (CASSANDRA-6481)
+ * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345, 6485)
  * Optimize FD phi calculation (CASSANDRA-6386)
  * Improve initial FD phi estimate when starting up (CASSANDRA-6385)
  * Don't list CQL3 table in CLI describe even if named explicitely 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3d91dc9/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
index 51c4119..c36fde4 100644
--- a/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
+++ b/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
@@ -116,19 +116,20 @@ public abstract class AbstractReplicationStrategy
         ArrayList<InetAddress> endpoints = getCachedEndpoints(keyToken);
         if (endpoints == null)
         {
-            if (tokenMetadataClone == null)
+            TokenMetadata tm; // local reference in case another thread nulls tMC out from under us
+            if ((tm = tokenMetadataClone) == null)
             {
                 // synchronize to prevent thundering herd post-invalidation
                 synchronized (this)
                 {
-                    if (tokenMetadataClone == null)
-                        tokenMetadataClone = tokenMetadata.cloneOnlyTokenMap();
+                    if ((tm = tokenMetadataClone) == null)
+                        tm = tokenMetadataClone = tokenMetadata.cloneOnlyTokenMap();
                 }
                 // if our clone got invalidated, it's possible there is a new token to account for too
-                keyToken = TokenMetadata.firstToken(tokenMetadataClone.sortedTokens(), searchToken);
+                keyToken = TokenMetadata.firstToken(tm.sortedTokens(), searchToken);
             }
 
-            endpoints = new ArrayList<InetAddress>(calculateNaturalEndpoints(searchToken, tokenMetadataClone));
+            endpoints = new ArrayList<InetAddress>(calculateNaturalEndpoints(searchToken, tm));
             cachedEndpoints.put(keyToken, endpoints);
         }
 


[5/6] git commit: merge from 1.2

Posted by jb...@apache.org.
merge from 1.2


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a3796f5f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a3796f5f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a3796f5f

Branch: refs/heads/cassandra-2.0
Commit: a3796f5f7d9473452dd856aad3d99940eb307716
Parents: c960975 a3d91dc
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Dec 13 22:11:31 2013 -0600
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Dec 13 22:11:31 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                              |  3 ++-
 .../cassandra/locator/AbstractReplicationStrategy.java   | 11 ++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3796f5f/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 182bada,e586592..a54231e
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,17 -1,10 +1,18 @@@
 -1.2.13
 +2.0.4
 + * Fix assertion failure in filterColdSSTables (CASSANDRA-6483)
 + * Fix row tombstones in larger-than-memory compactions (CASSANDRA-6008)
 + * Fix cleanup ClassCastException (CASSANDRA-6462)
 + * Reduce gossip memory use by interning VersionedValue strings (CASSANDRA-6410)
 + * Allow specifying datacenters to participate in a repair (CASSANDRA-6218)
 + * Fix divide-by-zero in PCI (CASSANDRA-6403)
 + * Fix setting last compacted key in the wrong level for LCS (CASSANDRA-6284)
 + * Add sub-ms precision formats to the timestamp parser (CASSANDRA-6395)
 + * Expose a total memtable size metric for a CF (CASSANDRA-6391)
 + * cqlsh: handle symlinks properly (CASSANDRA-6425)
 + * Don't resubmit counter mutation runnables internally (CASSANDRA-6427)
 +Merged from 1.2:
-  * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345)
+  * Randomize batchlog candidates selection (CASSANDRA-6481)
+  * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345, 6485)
 - * Optimize FD phi calculation (CASSANDRA-6386)
 - * Improve initial FD phi estimate when starting up (CASSANDRA-6385)
 - * Don't list CQL3 table in CLI describe even if named explicitely 
 -   (CASSANDRA-5750)
   * cqlsh: quote single quotes in strings inside collections (CASSANDRA-6172)
   * Improve gossip performance for typical messages (CASSANDRA-6409)
   * Throw IRE if a prepared statement has more markers than supported 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3796f5f/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
----------------------------------------------------------------------


[4/6] git commit: merge from 1.2

Posted by jb...@apache.org.
merge from 1.2


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a3796f5f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a3796f5f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a3796f5f

Branch: refs/heads/trunk
Commit: a3796f5f7d9473452dd856aad3d99940eb307716
Parents: c960975 a3d91dc
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Dec 13 22:11:31 2013 -0600
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Dec 13 22:11:31 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                              |  3 ++-
 .../cassandra/locator/AbstractReplicationStrategy.java   | 11 ++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3796f5f/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 182bada,e586592..a54231e
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,17 -1,10 +1,18 @@@
 -1.2.13
 +2.0.4
 + * Fix assertion failure in filterColdSSTables (CASSANDRA-6483)
 + * Fix row tombstones in larger-than-memory compactions (CASSANDRA-6008)
 + * Fix cleanup ClassCastException (CASSANDRA-6462)
 + * Reduce gossip memory use by interning VersionedValue strings (CASSANDRA-6410)
 + * Allow specifying datacenters to participate in a repair (CASSANDRA-6218)
 + * Fix divide-by-zero in PCI (CASSANDRA-6403)
 + * Fix setting last compacted key in the wrong level for LCS (CASSANDRA-6284)
 + * Add sub-ms precision formats to the timestamp parser (CASSANDRA-6395)
 + * Expose a total memtable size metric for a CF (CASSANDRA-6391)
 + * cqlsh: handle symlinks properly (CASSANDRA-6425)
 + * Don't resubmit counter mutation runnables internally (CASSANDRA-6427)
 +Merged from 1.2:
-  * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345)
+  * Randomize batchlog candidates selection (CASSANDRA-6481)
+  * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345, 6485)
 - * Optimize FD phi calculation (CASSANDRA-6386)
 - * Improve initial FD phi estimate when starting up (CASSANDRA-6385)
 - * Don't list CQL3 table in CLI describe even if named explicitely 
 -   (CASSANDRA-5750)
   * cqlsh: quote single quotes in strings inside collections (CASSANDRA-6172)
   * Improve gossip performance for typical messages (CASSANDRA-6409)
   * Throw IRE if a prepared statement has more markers than supported 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a3796f5f/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
----------------------------------------------------------------------