lbradstreet commented on a change in pull request #10318: URL: https://github.com/apache/kafka/pull/10318#discussion_r595047309
########## File path: core/src/main/scala/kafka/server/FetchSession.scala ########## @@ -428,7 +428,7 @@ class IncrementalFetchContext(private val time: Time, val mustRespond = cachedPart.maybeUpdateResponseData(respData, updateFetchContextAndRemoveUnselected) if (mustRespond) { nextElement = element - if (updateFetchContextAndRemoveUnselected) { + if (updateFetchContextAndRemoveUnselected && FetchResponse.recordsSize(respData) > 0) { Review comment: @chia7712 I believe it only affects the order of the fetching on the following fetch. Previously those partitions would be penalized in fetch order if their hwm or log start offset updated and there was no data to be returned. All of the partitions where the fetch metadata had been updated without any data to be returned will end up behind the partitions ordered prior to them that were part of the full fetch response. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org