Merge KAFKA-1451

JIRA:https://jira.internal.cloudgenix.com/browse/CGB-419
KAFKA-1451:https://issues.apache.org/jira/secure/attachment/12657983/KAFKA-1451.patch