nileshkumar3 opened a new pull request, #23765: URL: https://github.com/apache/kafka/pull/23765
## Summary - `LogSegment.recover()` no longer throws `LogSegmentOffsetOverflowException` before truncating. It keeps the overflowing batches, drops only the preallocated zero tail, then rethrows so `splitOverflowedSegment` runs on a file whose size is the real batches. - `appendFromFile` stops at `records.sizeInBytes()` instead of `start + sizeInBytes()`, so a later split segment does not read past the end of the file. - Adds a recovery test that pads an overflowed segment with 1 MB of zeros and checks that every key survives the split. ## Test plan - [x] `./gradlew :storage:test --tests org.apache.kafka.storage.internals.log.LogLoaderTest.testRecoveryOfPreallocatedSegmentWithOffsetOverflow` - [x] `./gradlew :storage:test --tests org.apache.kafka.storage.internals.log.LogLoaderTest.testRecoveryOfSegmentWithOffsetOverflow` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
