Fix of KAFKA-1194 brought down to the minimal amount of code change. Related to #5603 In testing
### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) [ Full content available at: https://github.com/apache/kafka/pull/5604 ] This message was relayed via gitbox.apache.org for [email protected]
