adoroszlai opened a new pull request, #4916:
URL: https://github.com/apache/ozone/pull/4916
## What changes were proposed in this pull request?
Fix a memory leak where datanodes re-registering with different address were
left in the `dnsToUuidMap`. This was caused by trying to remove `dnsName`
instead of `uuid` from the value `Set<String>` of `dnsToUuidMap`. The bug is
revealed by changing `Set<String>` to `Set<UUID>` (being done in HDDS-8854).
Reproduced by adding assertion in existing test:
```
TestSCMNodeManager.testScmRegisterNodeWithUpdatedIpAndHostname Time
elapsed: 3.104 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <[]> but was:
<[4cea4603-f41f-4008-9ec5-6862bf56737b(host2/2.3.4.5)]>
at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
at
org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
at
org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at
org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1141)
at
org.apache.hadoop.hdds.scm.node.TestSCMNodeManager.testScmRegisterNodeWithUpdatedIpAndHostname(TestSCMNodeManager.java:2082)
```
Get rid of `SuppressFBWarnings` by using `computeIfAbsent` instead of `get`
and `put`.
https://issues.apache.org/jira/browse/HDDS-8867
## How was this patch tested?
Unit test modified.
CI:
https://github.com/adoroszlai/hadoop-ozone/actions/runs/5287322307
--
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]