Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-11670

Java thin client: Queries are inconsistent in case of failover

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.8
    • Component/s: thin client
    • Labels:
      None

      Description

      When a thin client does failover and switches to a new server, open cursors become inconsistent and silently returns the wrong result.

      Reproducer:

          public void testQueryFailover() throws Exception {
              try (LocalIgniteCluster cluster = LocalIgniteCluster.start(1);
                   IgniteClient client = Ignition.startClient(new ClientConfiguration()
                       .setAddresses(cluster.clientAddresses().iterator().next()))
              ) {
                  ObjectName mbeanName = U.makeMBeanName(Ignition.allGrids().get(0).name(), "Clients",
                      ClientListenerProcessor.class.getSimpleName());
      
                  ClientProcessorMXBean mxBean = MBeanServerInvocationHandler.newProxyInstance(
                      ManagementFactory.getPlatformMBeanServer(), mbeanName, ClientProcessorMXBean.class, true);
      
                  ClientCache<Integer, Integer> cache = client.createCache("cache");
      
                  cache.put(0, 0);
                  cache.put(1, 1);
      
                  Query<Cache.Entry<Integer, String>> qry = new ScanQuery<Integer, String>().setPageSize(1);
      
                  try (QueryCursor<Cache.Entry<Integer, String>> cur = cache.query(qry)) {
                      int cnt = 0;
      
                      for (Iterator<Cache.Entry<Integer, String>> it = cur.iterator(); it.hasNext(); it.next()) {
                          cnt++;
      
                          if (cnt == 1)
                              mxBean.dropAllConnections();
                      }
      
                      assertEquals(2, cnt);
                  }
              }
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex_pl Aleksey Plekhanov
                Reporter:
                alex_pl Aleksey Plekhanov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h