Backport CASSANDRA-6747

patch by yukim; reviewed by krummas for CASSANDRA-7560