Uploaded image for project: 'Hot Rod Native client'
  1. Hot Rod Native client
  2. HRCPP-332

.NET HotRod client does not fail over automatically

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.1.0.Beta1
    • None
    • .NET
    • None

      After the primary data center is shut down the client should fail over to the backup DC but it still tries to connect to the primary DC and eventually fails.

      Error message is the following:

      4: Errors and Failures:
      4: 1) Test Error : Infinispan.HotRod.Tests.XSiteFailoverTest.FailoverTest
      4:    Infinispan.HotRod.Exceptions.TransportException : Failed to connect (host:
       127.0.0.1 port: 11222) No connection could be made because the target machine a
      ctively refused it.
      4:
      4:    at Infinispan.HotRod.SWIGGen.RemoteByteArrayCache.get(ByteArray key) in C:
      \workdir\dotnet-client\build_windows\swig\RemoteByteArrayCache.cs:line 66
      4:    at Infinispan.HotRod.Impl.RemoteCacheSWIGGenImpl`2.Get(K key) in C:\workdi
      r\dotnet-client\src\main\cs\Infinispan\HotRod\Impl\RemoteCacheSWIGImpl.cs:line 1
      35
      4:    at Infinispan.HotRod.Tests.XSiteFailoverTest.FailoverTest() in C:\workdir\
      dotnet-client\src\test\cs\Infinispan\HotRod\XSiteFailoverTest.cs:line 38
      

      This can be reproduced by the following test.

                 Assert.IsNull(cache1.Put("k1", "v1"));
                  Assert.AreEqual("v1", cache1.Get("k1"), "Expected v1 from cache1");
                  Assert.AreEqual("v1", cache2.Get("k1"), "Expected v1 from cache2");
                  XSiteTestSuite.server1.ShutDownHotrodServer();
           //client1 should failover but fails here ----vvv
                  Assert.AreEqual("v1", cache1.Get("k1"), "Expected v1 from cache1 after failover");
                  Assert.AreEqual("v1", cache2.Get("k1"), "Expected v1 from cache2 after failover");
                  XSiteTestSuite.server1.StartHotRodServer();
                  manager1.SwitchToDefaultCluster();
                  //client1 should get null as state transfer is not enabled
                  Assert.IsNull(cache1.Get("k1"));
                  Assert.IsNull(cache1.Put("k2", "v2"));
                  Assert.AreEqual("v2", cache1.Get("k2"));
                  //double check client2
                  Assert.AreEqual("v1", cache2.Get("k1"), "Expected v1 from cache2 after starting LON back again");
      

              vrigamon@redhat.com Vittorio Rigamonti
              mgencur Martin Gencur
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: