[ 
https://issues.apache.org/jira/browse/IGNITE-27188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18048385#comment-18048385
 ] 

Pavel Tupitsyn commented on IGNITE-27188:
-----------------------------------------

https://github.com/apache/ignite-3/commit/7df27a595d8890f62b76187d53c423f1b326debd

> Java Client: Connection is not restored to restarted node
> ---------------------------------------------------------
>
>                 Key: IGNITE-27188
>                 URL: https://issues.apache.org/jira/browse/IGNITE-27188
>             Project: Ignite
>          Issue Type: Bug
>          Components: platforms ai3, thin clients ai3
>            Reporter: Pavel Pereslegin
>            Assignee: Pavel Tupitsyn
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.2
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> During integration testing of the {{backgroundReconnectInterval}} client 
> property, it was discovered that the connection to a node that was restarted 
> is not re-established because the node ID changes during the restart.
> Reproducer
> {code:java}
>   @Test
>   void testBackgroundReconnectInterval() {
>       int nodesCount = 3;
>       cluster.startAndInit(nodesCount, new int[]{2});
>       String[] addresses = IntStream.range(0, nodesCount)
>               .mapToObj(i -> "127.0.0.1:" + (10800 + i))
>               .toArray(String[]::new);
>       try (IgniteClient client = IgniteClient.builder()
>               .backgroundReconnectInterval(100)
>               .addresses(addresses).build()) {
>           Awaitility.await().until(() -> client.connections().size(), 
> CoreMatchers.is(nodesCount));
>           cluster.stopNode(0);
>           Awaitility.await().until(() -> client.connections().size(), 
> CoreMatchers.is(nodesCount - 1));
>           cluster.startNode(0);
>           // Fails.
>           Awaitility.await().until(() -> client.connections().size(), 
> CoreMatchers.is(nodesCount ));
>       }
>   }
> {code}
> The test works fine if we comment the following lines in the 
> ClientChannelHolder.getOrCreateChannelAsync:
> {code:java}
>   if (oldServerNode != null && !oldServerNode.id().equals(newNode.id())) {
>       // New node on the old address.
>       nodeChannelsByName.remove(oldServerNode.name(), this);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to