JiayaoS commented on PR #22345: URL: https://github.com/apache/kafka/pull/22345#issuecomment-4513852609
This revives and updates apache/kafka#20256 for KAFKA-15038. `RemoteLogManager` previously maintained its own topic ID cache, populated from leadership changes and cleared during stop-partition handling. That duplicated metadata state and could be missing during topic deletion or partition stop paths. With this change, `RemoteLogManager` no longer owns a topic ID cache. Normal operations resolve topic IDs from the broker metadata cache. Stop-partition handling uses the `TopicIdPartition` supplied by the caller. This is important for KRaft topic deletion, where the metadata cache may already reflect the new image before `ReplicaManager.applyDelta` processes the delete delta. `ReplicaManager` now uses the previous metadata image topic ID when constructing `StopPartition`, allowing `RemoteLogManager` to clean up remote log state with the correct topic ID. Tests: - Added `ReplicaManager` coverage for topic deletion where the current metadata cache no longer contains the deleted topic ID. - Added `RemoteLogManager` coverage to verify `stopPartitions` uses the `TopicIdPartition` supplied by `StopPartition`. - Removed obsolete `RemoteLogManager` tests that validated `topicIdByPartitionMap` cache population/eviction and cache-based partition readiness, since `RemoteLogManager` no longer maintains that cache. - Updated existing tests for the new `StopPartition` topic ID flow. -- 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]
