appchemist opened a new pull request, #21540: URL: https://github.com/apache/kafka/pull/21540
Description: This change fixes a bug in recursive parent-node matching where a previously found ancestor match could be overwritten by a later branch returning null. The issue occurs when traversing multiple parents. if an earlier parent path finds a matching ancestor but a later parent path does not, the previous implementation could return null instead of preserving the first valid match. This can lead to incorrect ancestor detection during topology optimization for merged streams and may prevent expected repartition-topic sharing behavior. The fix returns immediately when a recursive parent traversal finds a non-null match, and returns null only after all parent branches have been checked with no match. Testing strategy: - Added a unit test that reproduces the multi-parent traversal case and verifies the matching ancestor is preserved. - Added topology optimization tests for merged streams with key-changing operations on both left and right branches, verifying repartition-topic sharing still produces a single repartition node. -- 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]
