RamanVerma opened a new pull request #9364: URL: https://github.com/apache/kafka/pull/9364
LogManager writes a clean shutdown file when the broker shuts down. The presence of this file indicates that the broker had a clean shutdown and log recovery is not needed upon the next boot up. Earlier, LogManager would check for this file at the start of log loading workflow, and delete it after the log has been loaded. If the broker were to crash while loading logs, the file would not be deleted and mislead LogManager when it tries to load logs upon next boot up. Hence, a crash during log loading will not be considered a hard reset of broker. As part of this fix, we delete the clean shutdown file as soon as we look it up, at the start of log loading workflow. Thereafter, we maintain a boolean flag to indicate if broker underwent clean shutdown or not. So, if the broker were to crash while logs are being loaded, LogManager will be able to detect this as a hard reset. *More detailed description of your change, if necessary. The PR title and PR message become the squashed commit message, so use a separate comment to ping reviewers.* *Summary of testing strategy (including rationale) for the feature or bug fix. Unit and/or integration tests are expected for any behaviour change and system tests should be considered for larger changes.* ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- 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