mirror of https://github.com/apache/druid.git
bug fix for getNewNodes() in ListenerDiscoverer (#3092)
This commit is contained in:
parent
5a3db634ff
commit
e6b32c24ae
|
@ -166,7 +166,7 @@ public class ListenerDiscoverer
|
|||
}
|
||||
}
|
||||
);
|
||||
lastSeenMap = priorSeenMap;
|
||||
lastSeenMap = currentMap;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
|
|
@ -135,6 +135,12 @@ public class ListenerDiscovererTest extends CuratorTestBase
|
|||
ImmutableSet.of(HostAndPort.fromString(node.toString())),
|
||||
listenerDiscoverer.getNodes(listenerKey)
|
||||
);
|
||||
// 2nd call of two concurrent getNewNodes should return no entry collection
|
||||
listenerDiscoverer.getNewNodes(listenerKey);
|
||||
Assert.assertEquals(
|
||||
0,
|
||||
listenerDiscoverer.getNewNodes(listenerKey).size()
|
||||
);
|
||||
Assert.assertEquals(
|
||||
ImmutableSet.of(listenerKey, listenerTier),
|
||||
ImmutableSet.copyOf(listenerDiscoverer.discoverChildren(null))
|
||||
|
|
Loading…
Reference in New Issue