chirag-wadhwa5 opened a new pull request, #20391:
URL: https://github.com/apache/kafka/pull/20391

   As per the current implementation in archiveRecords, when LSO is updated, if 
we have multiple record batches before the new LSO, then only the first one 
gets archived. This is because of the following lines of code ->
   
   `isAnyOffsetArchived = isAnyOffsetArchived || 
archivePerOffsetBatchRecords(inFlightBatch, startOffset, endOffset - 1, 
initialState);`
   
   `isAnyBatchArchived = isAnyBatchArchived || 
archiveCompleteBatch(inFlightBatch, initialState);`
   
   The first record / batch will make `isAnyOffsetArchived` / 
`isAnyBatchArchived` true, after which this line of code will short-circuit and 
the methods `archivePerOffsetBatchRecords` /  `archiveCompleteBatch` will not 
be called again. This PR changes the order of the expressions so that the 
short-circuit does not prevent from archiving all the required batches.


-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to