pratx08 opened a new pull request, #22462: URL: https://github.com/apache/kafka/pull/22462
**LogLoader** computes recovery offsets after loading and validating the local log segments. In the branch where the log end offset may already be available, the previous code used Optional.orElse with _readNextOffset_ as the fallback. Optional.orElse evaluates its fallback eagerly, so _readNextOffset_ could be called even when the existing log end offset was already present. Since _readNextOffset_ reads the next offset from the segment, this can add unnecessary work during log recovery. This change keeps the behavior the same, but makes the fallback explicit so _readNextOffset_ is only called when the log end offset was not already computed. -- 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]
