You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2013/06/25 21:19:12 UTC
[1/3] git commit: Revert #5665
(b7e13b89c265c28acfb624a984b97a06a837c3ea) due to tests failures
Updated Branches:
refs/heads/trunk a607ee077 -> 2c271e2c0
Revert #5665 (b7e13b89c265c28acfb624a984b97a06a837c3ea) due to tests failures
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2d90eb65
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2d90eb65
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2d90eb65
Branch: refs/heads/trunk
Commit: 2d90eb65bffd5787ff77403a4f3bc05605cfcd5a
Parents: 81619fe
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Tue Jun 25 09:56:14 2013 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Tue Jun 25 09:56:14 2013 +0200
----------------------------------------------------------------------
src/java/org/apache/cassandra/gms/Gossiper.java | 46 +++++++++-----------
1 file changed, 21 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/2d90eb65/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java
index b629824..efa9865 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -871,7 +871,6 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
if (logger.isTraceEnabled())
logger.trace("Updating heartbeat state generation to " + remoteGeneration + " from " + localGeneration + " for " + ep);
// major state change will handle the update by inserting the remote state directly
- copyNewerApplicationStates(remoteState, localEpStatePtr);
handleMajorStateChange(ep, remoteState);
}
else if ( remoteGeneration == localGeneration ) // generation has not changed, apply new states
@@ -881,18 +880,11 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
int remoteMaxVersion = getMaxEndpointStateVersion(remoteState);
if ( remoteMaxVersion > localMaxVersion )
{
- if (logger.isTraceEnabled())
- {
- logger.trace("Updating heartbeat state version to " + remoteState.getHeartBeatState().getHeartBeatVersion() +
- " from " + localEpStatePtr.getHeartBeatState().getHeartBeatVersion() + " for " + ep);
- }
- localEpStatePtr.setHeartBeatState(remoteState.getHeartBeatState());
- Map<ApplicationState, VersionedValue> merged = copyNewerApplicationStates(localEpStatePtr, remoteState);
- for (Entry<ApplicationState, VersionedValue> appState : merged.entrySet())
- doNotifications(ep, appState.getKey(), appState.getValue());
+ // apply states, but do not notify since there is no major change
+ applyNewStates(ep, localEpStatePtr, remoteState);
}
else if (logger.isTraceEnabled())
- logger.trace("Ignoring remote version " + remoteMaxVersion + " <= " + localMaxVersion + " for " + ep);
+ logger.trace("Ignoring remote version " + remoteMaxVersion + " <= " + localMaxVersion + " for " + ep);
if (!localEpStatePtr.isAlive() && !isDeadState(localEpStatePtr)) // unless of course, it was dead
markAlive(ep, localEpStatePtr);
}
@@ -911,24 +903,28 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
}
}
- private Map<ApplicationState, VersionedValue> copyNewerApplicationStates(EndpointState toState, EndpointState fromState)
+ private void applyNewStates(InetAddress addr, EndpointState localState, EndpointState remoteState)
{
- Map<ApplicationState, VersionedValue> merged = new HashMap<ApplicationState, VersionedValue>();
- for (Entry<ApplicationState, VersionedValue> fromEntry : fromState.getApplicationStateMap().entrySet())
+ // don't assert here, since if the node restarts the version will go back to zero
+ int oldVersion = localState.getHeartBeatState().getHeartBeatVersion();
+
+ localState.setHeartBeatState(remoteState.getHeartBeatState());
+ if (logger.isTraceEnabled())
+ logger.trace("Updating heartbeat state version to " + localState.getHeartBeatState().getHeartBeatVersion() + " from " + oldVersion + " for " + addr + " ...");
+
+ // we need to make two loops here, one to apply, then another to notify, this way all states in an update are present and current when the notifications are received
+ for (Entry<ApplicationState, VersionedValue> remoteEntry : remoteState.getApplicationStateMap().entrySet())
{
- ApplicationState key = fromEntry.getKey();
- VersionedValue value = fromEntry.getValue();
+ ApplicationState remoteKey = remoteEntry.getKey();
+ VersionedValue remoteValue = remoteEntry.getValue();
- if ( (toState.applicationState.containsKey(key) && toState.applicationState.get(key).compareTo(value) < 0)
- || !toState.applicationState.containsKey(key) )
- {
- if (logger.isTraceEnabled())
- logger.trace("merging {}:{} into ApplicationState", key, value);
- toState.addApplicationState(key, value);
- merged.put(key, value);
- }
+ assert remoteState.getHeartBeatState().getGeneration() == localState.getHeartBeatState().getGeneration();
+ localState.addApplicationState(remoteKey, remoteValue);
+ }
+ for (Entry<ApplicationState, VersionedValue> remoteEntry : remoteState.getApplicationStateMap().entrySet())
+ {
+ doNotifications(addr, remoteEntry.getKey(), remoteEntry.getValue());
}
- return merged;
}
// notify that an application state has changed
[3/3] git commit: Merge branch 'cassandra-1.2' into trunk
Posted by br...@apache.org.
Merge branch 'cassandra-1.2' into trunk
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/2c271e2c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2c271e2c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2c271e2c
Branch: refs/heads/trunk
Commit: 2c271e2c0d957b6ebfcea4dcd70f3c8b8c6cf0cd
Parents: a607ee0 a6ca5d4
Author: Brandon Williams <br...@apache.org>
Authored: Tue Jun 25 14:18:53 2013 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Tue Jun 25 14:18:53 2013 -0500
----------------------------------------------------------------------
CHANGES.txt | 2 +
src/java/org/apache/cassandra/gms/Gossiper.java | 46 +++++++++-----------
2 files changed, 23 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/2c271e2c/CHANGES.txt
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/2c271e2c/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/gms/Gossiper.java
index 46f19f5,efa9865..a74da02
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@@ -874,28 -871,20 +874,20 @@@ public class Gossiper implements IFailu
if (logger.isTraceEnabled())
logger.trace("Updating heartbeat state generation to " + remoteGeneration + " from " + localGeneration + " for " + ep);
// major state change will handle the update by inserting the remote state directly
- copyNewerApplicationStates(remoteState, localEpStatePtr);
handleMajorStateChange(ep, remoteState);
}
- else if ( remoteGeneration == localGeneration ) // generation has not changed, apply new states
+ else if (remoteGeneration == localGeneration) // generation has not changed, apply new states
{
/* find maximum state */
int localMaxVersion = getMaxEndpointStateVersion(localEpStatePtr);
int remoteMaxVersion = getMaxEndpointStateVersion(remoteState);
- if ( remoteMaxVersion > localMaxVersion )
+ if (remoteMaxVersion > localMaxVersion)
{
- if (logger.isTraceEnabled())
- {
- logger.trace("Updating heartbeat state version to " + remoteState.getHeartBeatState().getHeartBeatVersion() +
- " from " + localEpStatePtr.getHeartBeatState().getHeartBeatVersion() + " for " + ep);
- }
- localEpStatePtr.setHeartBeatState(remoteState.getHeartBeatState());
- Map<ApplicationState, VersionedValue> merged = copyNewerApplicationStates(localEpStatePtr, remoteState);
- for (Entry<ApplicationState, VersionedValue> appState : merged.entrySet())
- doNotifications(ep, appState.getKey(), appState.getValue());
+ // apply states, but do not notify since there is no major change
+ applyNewStates(ep, localEpStatePtr, remoteState);
}
else if (logger.isTraceEnabled())
- logger.trace("Ignoring remote version " + remoteMaxVersion + " <= " + localMaxVersion + " for " + ep);
+ logger.trace("Ignoring remote version " + remoteMaxVersion + " <= " + localMaxVersion + " for " + ep);
if (!localEpStatePtr.isAlive() && !isDeadState(localEpStatePtr)) // unless of course, it was dead
markAlive(ep, localEpStatePtr);
}
[2/3] git commit: Changelog update
Posted by br...@apache.org.
Changelog update
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a6ca5d49
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a6ca5d49
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a6ca5d49
Branch: refs/heads/trunk
Commit: a6ca5d496facf79c187310e81b3eeba3e6bc4b43
Parents: 2d90eb6
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Tue Jun 25 09:58:10 2013 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Tue Jun 25 09:58:10 2013 +0200
----------------------------------------------------------------------
CHANGES.txt | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/a6ca5d49/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index be0c1d0..2931916 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,8 +1,3 @@
-1.2.7
- * Fix ReadResponseSerializer.serializedSize() for digest reads (CASSANDRA-5476)
- * allow sstable2json on 2i CFs (CASSANDRA-5694)
-
-
1.2.6
* Fix tracing when operation completes before all responses arrive (CASSANDRA-5668)
* Fix cross-DC mutation forwarding (CASSANDRA-5632)
@@ -39,6 +34,8 @@
* Gossiper incorrectly drops AppState for an upgrading node (CASSANDRA-5660)
* Connection thrashing during multi-region ec2 during upgrade, due to messaging version (CASSANDRA-5669)
* Avoid over reconnecting in EC2MRS (CASSANDRA-5678)
+ * Fix ReadResponseSerializer.serializedSize() for digest reads (CASSANDRA-5476)
+ * allow sstable2json on 2i CFs (CASSANDRA-5694)
Merged from 1.1:
* Remove buggy thrift max message length option (CASSANDRA-5529)
* Fix NPE in Pig's widerow mode (CASSANDRA-5488)