ramu11 opened a new pull request, #23418:
URL: https://github.com/apache/kafka/pull/23418

   When processing a full `LeaderAndIsrRequest` via 
`LogManager.findStrayReplicas` (e.g., during ZooKeeper-to-KRaft migration), 
encountering a local log directory that lacks a topic ID caused a 
`RuntimeException` via an unsafe `getOrElse` call. 
   
   This change updates `findStrayReplicas` to check for `log.topicId.isEmpty` 
and safely treat these logs as stray replicas rather than crashing the broker, 
aligning the behavior with standard KRaft migration expectations.
   
   Summary of testing strategy:
   
   - Added a regression unit test `testFindStrayReplicasMissingTopicId` in 
`LogManagerTest.scala` to verify that logs missing topic IDs are correctly 
marked as stray replicas.
   - Executed `./gradlew :core:compileScala :core:compileTestScala` and 
verified the core module test suite passes cleanly.
   


-- 
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]

Reply via email to