lymerin opened a new pull request, #7450: URL: https://github.com/apache/shenyu/pull/7450
Fixes #7439. ### Problem The UPDATED predicate required matching `instanceId` values and `!InstanceInfo.equals()`. However, `equals()` compares instance identity only, so matching IDs made `!equals()` false. Content changes therefore never satisfied the update predicate. ADDED and DELETED used set membership based on the same identity equality. An instance whose identity remained unchanged belonged to both snapshots, so neither branch detected its content changes. All three branches remained silent for this update. ### Impact Changes to weight, protocol, or upstream properties on an existing Eureka instance left admin and gateway upstream configuration stale. Emitting UPDATED alone does not complete the refresh: inconsistent hostname/IP addresses prevent row matching, the SQL binds the wrong handler parameter, and the gateway cache does not refresh all affected configuration fields. ### Changes - Compare generated upstream data for matching instance IDs, preserving existing ADDED and DELETED behavior. Metadata that is not part of the upstream payload still emits no event. - Use the instance IP consistently across full discovery and watcher events, so subsequent updates match the stored upstream URL. ShenYu’s SDK registration path already assigns the same `instance.getHost()` value to both hostname and IP address, so this address alignment does not change SDK-registered upstream addresses. - Bind `discoveryHandlerId` instead of the absent upstream record ID, and populate the update timestamp required by the database. - Refresh cached protocol and properties-derived configuration while preserving runtime statistics. Discovery protocol changes update the existing cached instance; explicit additions/deletions and multiple-protocol entries retain their existing identity handling. - Add regression coverage for the affected discovery, persistence, and gateway paths. ### Validation Targeted regression tests and Checkstyle passed. The full clean install with tests passed locally. ### Checklist Make sure that: - [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]
