Permalink
Browse files

Merge branch 'cassandra-1.2' into trunk

  • Loading branch information...
2 parents 3563350 + 59bd0e7 commit 32c3b6e526e191532358730f0d4d9dfbf1aa7b0e @pcmanus pcmanus committed May 6, 2013
View
@@ -64,6 +64,8 @@
(CASSANDRA-5531)
* cqlsh: add CLUSTERING ORDER BY support to DESCRIBE (CASSANDRA-5528)
* Add custom secondary index support to CQL3 (CASSANDRA-5484)
+ * Fix repair hanging silently on unexpected error (CASSANDRA-5229)
+ * Fix Ec2Snitch regression introduced by CASSANDRA-5171 (CASSANDRA-5432)
Merged from 1.1
* Add retry mechanism to OTC for non-droppable_verbs (CASSANDRA-5393)
* Use allocator information to improve memtable memory usage estimate
@@ -23,13 +23,11 @@
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.URL;
-import java.util.Map;
import com.google.common.base.Charsets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.apache.cassandra.db.SystemTable;
import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.gms.ApplicationState;
import org.apache.cassandra.gms.EndpointState;
@@ -46,7 +44,6 @@
protected static final String ZONE_NAME_QUERY_URL = "http://169.254.169.254/latest/meta-data/placement/availability-zone";
private static final String DEFAULT_DC = "UNKNOWN-DC";
private static final String DEFAULT_RACK = "UNKNOWN-RACK";
- private Map<InetAddress, Map<String, String>> savedEndpoints;
protected String ec2zone;
protected String ec2region;
@@ -96,13 +93,7 @@ public String getRack(InetAddress endpoint)
return ec2zone;
EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
if (state == null || state.getApplicationState(ApplicationState.RACK) == null)
- {
- if (savedEndpoints == null)
- savedEndpoints = SystemTable.loadDcRackInfo();
- if (savedEndpoints.containsKey(endpoint))
- return savedEndpoints.get(endpoint).get("rack");
return DEFAULT_RACK;
- }
return state.getApplicationState(ApplicationState.RACK).value;
}
@@ -112,13 +103,7 @@ public String getDatacenter(InetAddress endpoint)
return ec2region;
EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
if (state == null || state.getApplicationState(ApplicationState.DC) == null)
- {
- if (savedEndpoints == null)
- savedEndpoints = SystemTable.loadDcRackInfo();
- if (savedEndpoints.containsKey(endpoint))
- return savedEndpoints.get(endpoint).get("data_center");
return DEFAULT_DC;
- }
return state.getApplicationState(ApplicationState.DC).value;
}
}
@@ -132,6 +132,8 @@ public Socket newSocket() throws IOException
InetAddress endPoint()
{
+ if (id.equals(FBUtilities.getBroadcastAddress()))
+ return FBUtilities.getLocalAddress();
return resetedEndpoint == null ? id : resetedEndpoint;
}
@@ -121,6 +121,12 @@ public void read() throws IOException
retry();
throw ex;
}
+ catch (RuntimeException e)
+ {
+ // if we encountered unexpected exception, fail this session
+ session.close(false);
+ throw e;
+ }
}
session.closeIfFinished();

0 comments on commit 32c3b6e

Please sign in to comment.