Copilot commented on code in PR #11370:
URL: https://github.com/apache/ozone/pull/11370#discussion_r4142540521
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ScmClient.java:
##########
@@ -132,8 +132,11 @@ static Pipeline newPipelineWithDNCache(Pipeline pipeline,
for (DatanodeDetails node : pipeline.getNodes()) {
DatanodeDetails datanodeDetails =
datanodeDetailsCache.getIfPresent(node.getID());
- // Call compareNodeValues to handle IP / hostname changes
- if (datanodeDetails != null && node.compareNodeValues(datanodeDetails)) {
+ // Use the cached entry only when it matches on both network identity
+ // (compareNodeValues: hostname / IP / ports) and wire-protocol
capability
+ // version (compareNodeVersions: currentVersion).
+ if (datanodeDetails != null && node.compareNodeValues(datanodeDetails)
+ && node.compareNodeVersions(datanodeDetails)) {
Review Comment:
Please add a regression test for the version-only refresh that keeps the
pipeline ID and datanode UUIDs unchanged while increasing one node's
`currentVersion`, then verifies the refreshed key location exposes the new
value. The existing `TestScmClient` case changes only the IP address, and
`TestKeyManagerUnit.testGetKeyInfo` changes the pipeline ID/member set, so both
would pass without this fix and do not protect the ZDU scenario described by
the PR.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]