chia7712 opened a new pull request #9423: URL: https://github.com/apache/kafka/pull/9423
The following actions results in this issue. 1. handle_1 gets the current log 2. ReplicaAlterLogDirsThread replaces current log by future log 3. handle_1 set the new hw to “current” log but the log is actually invalid The solution is that the action 1 and 3 must be executed within same read lock of leaderIsrUpdateLock to avoid adding new hw to invalid log (which is replaced by ReplicaAlterLogDirsThread) **Test Plan** Relying on ```PlaintextAdminIntegrationTest.testAlterReplicaLogDirs```. I have looped the test with this patch 100 times. all pass ### 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