backport CASSANDRA-6927 to 2.0