HDDS-15533. DNS refresh on heartbeat failure for DN to SCM (on HDDS-15682)#11
Closed
kerneltime wants to merge 2 commits into
Closed
HDDS-15533. DNS refresh on heartbeat failure for DN to SCM (on HDDS-15682)#11kerneltime wants to merge 2 commits into
kerneltime wants to merge 2 commits into
Conversation
…ent HostAndPort host-spelling From the AI-assisted review of apache#10612: - SCMNodeInfo block/client/security/datanode getters NPE on null fields; the prior String getters returned null gracefully, so restore that contract. - Document the host-spelling contract on the InetSocketAddress-derived HostAndPort constructor so equal-by-host instances do not miss each other in the endpoint maps. Generated-by: Claude Code (AI-assisted)
…ort identity model) Ports the DN->SCM DNS-refresh feature onto HDDS-15682's host:port identity. Because SCM nodes are now keyed by the stable host:port, this drops the endpoint re-key dance, the resolved-address collision check, and the StateContext queue migration that the InetSocketAddress-keyed version (apache#10488) needed. - HostAndPort.refresh(): re-resolve the host:port and swap the cached address if the IP changed (DNS lookup outside the monitor; only the swap synchronized). Completes the mutable-address hook. - SCMConnectionManager.refreshSCMServer(): on a changed IP, rebuild the endpoint value under the same key and close the stale proxy. buildScmEndpoint() factored out of addSCMServer. - HeartbeatEndpointTask: on a connection-class heartbeat failure, gated by the resolve-needed flag and the new hdds.heartbeat.address.refresh.threshold knob, ask the connection manager to refresh. Generated-by: Claude Code (AI-assisted)
This was referenced Jun 26, 2026
|
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days. |
Author
|
Superseded by apache#10844, rebuilt on Generated-by: Claude Code (Opus 4.8) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Daisy-chained on apache#10612 (HDDS-15682), which keys SCM-node identity on the configured host:port instead of the resolved
InetSocketAddress. Two commits:Address review nits on HDDS-15682. Use the original configured host and port to identify SCM nodes apache/ozone#10612 — null-safe
SCMNodeInfogetters (theStringgetters returnednullgracefully before HDDS-15682. Use the original configured host and port to identify SCM nodes apache/ozone#10612; theHostAndPortversions NPE on the nullable block/client/security/datanode addresses), plus a contract note on theInetSocketAddress-derivedHostAndPortconstructor.HDDS-15533 DN→SCM DNS refresh — ports the feature from HDDS-15533. DNS refresh on heartbeat failure for DN to SCM apache/ozone#10488 onto the new identity model. Because the map key is now the stable host:port, it is far smaller than HDDS-15533. DNS refresh on heartbeat failure for DN to SCM apache/ozone#10488: it drops the endpoint re-key dance, the resolved-address collision check, and the
StateContextqueue migration.HostAndPort.refresh()re-resolves and swaps the cached address (DNS lookup outside the monitor; only the swap synchronized) — completing the mutable-address hook HDDS-15682. Use the original configured host and port to identify SCM nodes apache/ozone#10612 left, and justifying thesynchronizedgetter.SCMConnectionManager.refreshSCMServer()rebuilds the endpoint value under the same key and closes the stale proxy (buildScmEndpoint()factored out ofaddSCMServer).HeartbeatEndpointTasktriggers it on a connection-class failure, gated byozone.client.failover.resolve-neededand the newhdds.heartbeat.address.refresh.thresholdknob.Verified that apache#10612 alone does not fix the stale-IP bug:
HostAndPortresolves once in its constructor andgetAddress()returns the cached value, and the RPC proxy freezes it — so the failure-triggered refresh is still required.Relationship to the existing PRs
masteronce HDDS-15682. Use the original configured host and port to identify SCM nodes apache/ozone#10612 merges; until then the diff here is only the two commits above.InetSocketAddress-keyed version is left as-is for now and will be closed once this lands.What is the link to the Apache JIRA?
https://issues.apache.org/jira/browse/HDDS-15533
How was this patch tested?
New
TestHeartbeatEndpointTaskDnsRefreshcovers the trigger gating: a connection-class failure at the threshold triggers a refresh; flag-off, application-level errors, and below-threshold do not.mvn checkstyle:checkpasses onhadoop-hdds/commonandhadoop-hdds/container-service. Full module build/test was not run locally; relying on CI.Generated-by: Claude Code (AI-assisted)