lymerin opened a new pull request, #7625: URL: https://github.com/apache/shenyu/pull/7625
Fixes #7438 ### Problem Dubbo gray upstreams can share the same protocol and address while using different `group` or `version` values. Previously, `Upstream` equality and the shared cache identified entries only by protocol and URL, collapsing distinct logical targets into one cached upstream. Round Robin, Hash, and Least Active also used address-based keys, causing shared state, overwritten hash-ring nodes, or duplicate-key failures when those variants remained in the candidate list. ### Changes - Introduce an immutable `UpstreamIdentity` based on protocol, URL, group, and version. - Use the identity in `Upstream` equality and `UpstreamCacheManager` to keep same-address variants independent during insertion, weight updates, offline handling, and unhealthy-state matching. - Separate Round Robin state, Hash ring entries, and Least Active counters for different logical targets. - Preserve existing Hash URL seeds and Least Active domain keys for upstreams without group or version. - Cache the derived identity on `Upstream` to avoid repeated JSON serialization during load balancing, invalidating it from the URL, group, and version setters. - Add regression tests for identity stability, independent cache and load-balancer state, and real Dubbo gray routing with weighted same-address variants. ### Validation - All 103 targeted tests passed. - Checkstyle passed with zero violations. - Apache RAT license checks passed. - `./mvnw clean install -Dmaven.javadoc.skip=true` passed. ### Checklist - [x] You have read the [[contribution guidelines](https://shenyu.apache.org/community/contributor-guide)](https://shenyu.apache.org/community/contributor-guide). - [x] You submit test cases (unit or integration tests) that back your changes. - [x] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`. -- 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]
