…empty This patch changes the behavior of MemoryRecords.filterTo() to always mark empty batches as non-control batches, rather than taking the attribute from the original batch. Empty control batches will cause fatal errors in segment recovery or the log cleaner due to trying access a record in an empty batch. In order to prevent errors from logs that are already in this state, this patch also adds a check to DefaultRecordBatch.isControlBatch() so that it will only return true if the batch is non-empty. Finally, it adds isControl to the output of DumpLogSegments. MemoryRecords and DefaultRecordsBatch changes were tested with unit tests, DumpLogSegments change was tested manually.
### 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/5727 ] This message was relayed via gitbox.apache.org for [email protected]
