[ 
https://issues.apache.org/jira/browse/HADOOP-18059?focusedWorklogId=701856&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-701856
 ]

ASF GitHub Bot logged work on HADOOP-18059:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Dec/21 11:23
            Start Date: 29/Dec/21 11:23
    Worklog Time Spent: 10m 
      Work Description: secfree commented on pull request #3837:
URL: https://github.com/apache/hadoop/pull/3837#issuecomment-1002546807


   @ferhui yes, you are right. Now only `DatanodeManager#registerDatanode` 
calls `reloadCachedMappings` and it handles the parameters well. So it is ok to 
keep the current version.
   
   But for CachedDNSToSwitchMapping itself, `resolve` and 
`reloadCachedMappings` are not consistent, as the UT shows.  I meet a related 
issue when implementing the topology refreshing feature. If others need to 
implement other features, they may also encounter similar issues.
   
   It is ok for me to leave this patch un-merged. It is up to you, master.
   
   


-- 
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 701856)
    Time Spent: 50m  (was: 40m)

> CachedDNSToSwitchMapping#reloadCachedMappings is not consistent with 
> CachedDNSToSwitchMapping#resolve
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-18059
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18059
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: secfree
>            Assignee: secfree
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> The follow test case failed.
> {code}
> public class TestCachedDNSToSwitchMapping {
>   @Test
>   public void testReloadCachedMappings() {
>     StaticMapping.resetMap();
>     StaticMapping.addNodeToRack("127.0.0.1", "/rack0");
>     StaticMapping.addNodeToRack("notexisit.host.com", "/rack1");
>     CachedDNSToSwitchMapping cacheMapping =
>         new CachedDNSToSwitchMapping(new StaticMapping());
>     List<String> names = new ArrayList<>();
>     names.add("localhost");
>     names.add("notexisit.host.com");
>     cacheMapping.resolve(names);
>     Assert.assertTrue(cacheMapping.getSwitchMap().containsKey("127.0.0.1"));
>     
> Assert.assertTrue(cacheMapping.getSwitchMap().containsKey("notexisit.host.com"));
>     cacheMapping.reloadCachedMappings(names);
>     // failed here
>     Assert.assertEquals(0, cacheMapping.getSwitchMap().keySet().size());
>   }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to