apply CASSANDRA-8027 to cassandra-2.0 branch