hachikuji commented on pull request #10240: URL: https://github.com/apache/kafka/pull/10240#issuecomment-789032940
Ok, I think I see what is going on now. The failing system test is verifying what happens when inter-broker communication no longer works. This results in different behavior because `AutoTopicCreationManager` relies on the `MetadataCache` in order to determine the number of live brokers while the old logic checked zk directly. That makes the `INVALID_REPLICATION_FACTOR` more dangerous since it is not retriable and the cache may be stale. In particular, when inter-broker communication is down, the cache will be empty and the broker will end up trying to auto-create all topics. I can think of a few options to address the problem: 1. Bring back the old logic to check Zookeeper for the live brokers. This might be fine for 2.8, but it does not address the problem for KIP-500. 2. Return a retriable error instead. Really `UNKNOWN_TOPIC_OR_PARTITION` would be a better error in this case. 3. Make `INVALID_REPLICATION_FACTOR` a retriable error. I guess we have to understand how clients My inclination is probably option 2. The downside is that the user would no longer get a clear error when a topic cannot be auto-created. But I feel overall it's the safest and most consistent way to handle this case. There might be other options though. It's interesting to note that this relates back to some of the discussion in the auto-create PR itself. We had discussed skipping the replication factor check on the broker and sending the request to the controller. But either way, we have to rely on the metadata cache locally at least to determine whether the topic already exists or not, so it might not have really helped. ---------------------------------------------------------------- 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