kafka/core
Chirag Wadhwa def5f16c33
KAFKA-19630: Reordered OR operands in archiveRecords method for SharePartiton (#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.

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>
2025-08-22 09:23:12 +01:00
..
src KAFKA-19630: Reordered OR operands in archiveRecords method for SharePartiton (#20391) 2025-08-22 09:23:12 +01:00
.gitignore