merge from 0.6

git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@979508 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2010-07-27 03:17:10 +00:00
parent 9064f4c33a
commit 619cbd124d
2 changed files with 8 additions and 7 deletions

View File

@ -67,6 +67,9 @@ dev
* remove gossip message size limit (CASSANDRA-1138)
* parallelize local and remote reads during multiget, and respect snitch
when determining whether to do local read for CL.ONE (CASSANDRA-1317)
* fix read repair to use requested consistency level on digest mismatch,
rather than assuming QUORUM (CASSANDRA-1316)
0.6.3

View File

@ -422,8 +422,7 @@ public class StorageProxy implements StorageProxyMBean
logger.debug("strongread reading " + (m == message ? "data" : "digest") + " for " + command + " from " + m.getMessageId() + "@" + endpoint);
}
AbstractReplicationStrategy rs = StorageService.instance.getReplicationStrategy(command.table);
ReadResponseResolver resolver = new ReadResponseResolver(command.table);
QuorumResponseHandler<Row> quorumResponseHandler = rs.getQuorumResponseHandler(resolver, consistency_level, command.table);
QuorumResponseHandler<Row> quorumResponseHandler = rs.getQuorumResponseHandler(new ReadResponseResolver(command.table), consistency_level, command.table);
MessagingService.instance.sendRR(messages, endpoints, quorumResponseHandler);
quorumResponseHandlers.add(quorumResponseHandler);
commandEndpoints.add(endpoints);
@ -447,10 +446,10 @@ public class StorageProxy implements StorageProxyMBean
{
if (randomlyReadRepair(command))
{
IResponseResolver<Row> resolver = new ReadResponseResolver(command.table);
AbstractReplicationStrategy rs = StorageService.instance.getReplicationStrategy(command.table);
QuorumResponseHandler<Row> quorumResponseHandlerRepair = rs.getQuorumResponseHandler(resolver, ConsistencyLevel.QUORUM, command.table);
logger.info("DigestMismatchException: " + ex.getMessage());
QuorumResponseHandler<Row> quorumResponseHandlerRepair = rs.getQuorumResponseHandler(new ReadResponseResolver(command.table), ConsistencyLevel.QUORUM, command.table);
if (logger.isDebugEnabled())
logger.debug("Digest mismatch:", ex);
Message messageRepair = command.makeReadMessage();
MessagingService.instance.sendRR(messageRepair, commandEndpoints.get(commandIndex), quorumResponseHandlerRepair);
try
@ -461,8 +460,7 @@ public class StorageProxy implements StorageProxyMBean
}
catch (DigestMismatchException e)
{
// TODO should this be a thrift exception?
throw new RuntimeException("digest mismatch reading key " + FBUtilities.bytesToHex(command.key), e);
throw new AssertionError(e); // full data requested from each node here, no digests should be sent
}
}
}