Merge branch 'cassandra-1.2' into cassandra-2.0

Conflicts:
	CHANGES.txt
	src/java/org/apache/cassandra/service/StorageProxy.java
This commit is contained in:
Aleksey Yeschenko 2014-06-03 19:03:16 +03:00
commit e8aaffa1b7
3 changed files with 15 additions and 3 deletions

View File

@ -15,6 +15,7 @@
Merged from 1.2:
* Fix availability validation for LOCAL_ONE CL (CASSANDRA-7319)
* Use LOCAL_ONE for non-superuser auth queries (CASSANDRA-7328)
* Fix handling of empty counter replication mutations (CASSANDRA-7144)
2.0.8

View File

@ -104,7 +104,8 @@ public class CounterMutation implements IMutation
ColumnFamily cf = row.cf;
replicationMutation.add(cf);
}
return replicationMutation;
return replicationMutation.isEmpty() ? null : replicationMutation;
}
private void addReadCommandFromColumnFamily(String keyspaceName, ByteBuffer key, ColumnFamily columnFamily, long timestamp, List<ReadCommand> commands)

View File

@ -1077,8 +1077,18 @@ public class StorageProxy implements StorageProxyMBean
{
public void runMayThrow() throws OverloadedException
{
// send mutation to other replica
sendToHintedEndpoints(cm.makeReplicationMutation(), remotes, responseHandler, localDataCenter);
// send the mutation to other replicas, if not null (see CASSANDRA-7144 for details)
RowMutation replicationMutation = cm.makeReplicationMutation();
if (replicationMutation != null)
{
sendToHintedEndpoints(replicationMutation, remotes, responseHandler, localDataCenter);
}
else
{
// simulate the rest of the responses to avoid the timeout
for (int i = 0; i < remotes.size(); i++)
responseHandler.response(null);
}
}
});
}