jolshan opened a new pull request #10041: URL: https://github.com/apache/kafka/pull/10041
Currently the partition.metadata file is created when the log is created. However, clusters with older inter-broker protocols will never use this file. This PR moves the creation of the file to when we write to the file. I considered also gating the creation of the file on the IBP of the broker receiving the LeaderAndIsrRequest, rather than just checking if the request has a valid ID. There are two cases where the IBP of the broker could be lower than the controller that sent the request. Both cases are rare since they likely require creation of a topic during an upgrade/downgrade and specific brokers to have different IBPs. 1. The upgrade case: in this case, the broker will eventually become the higher IBP and thus gets the file slightly earlier. 2. The downgrade case: in this case, the topic ID has been written to ZK. If the topic changes, before re-upgrading the user will need to delete the file. If it seems better to check the IBP of the broker before writing a file, let me know. ### 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