Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-14428

size() and keySet() are not reliable and return fuzzy results

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 14.0.5.Final, 15.0.0.Final
    • 14.0.0.Final
    • None
    • None
    • Hide

      caches.xml  TestHotRodClient.java

      • remove the security from infinispan.xml
      • - start 3 nodes
      • run the TstHotRodClient with enabled statement -> client.insertTests(1, 10);
      • remove the client.insertTests(1, 10); line
      • run the client several times to show the differences for size() and keySet()

       

      Show
      caches.xml   TestHotRodClient.java remove the security from infinispan.xml - start 3 nodes run the TstHotRodClient with enabled statement -> client.insertTests(1, 10); remove the client.insertTests(1, 10); line run the client several times to show the differences for size() and keySet()  
    • User Experience

      With the current 15.0.0-SNAPSHOT I tested the following scenario

      added a distributed cache (2 owners) with file-store to a 3 node cluster.

      Add 10 entries.
      Invoke size() keySet() keySet().size() and a loop of get() to retrieve the data.

      Without restart the keySet() will be randomly wrong and show less or more entries like

      ~~~

      Simple cache size is : 10   <-- output of size()
      --> output of keySet().size()  and keySet().toString()
      Keys in cache [8] : [test8, test4, test2, test9, test7, test3, test10, test1, test5, test6]
      --> testloop with get(1...10) has correctly all entries

      Simple cache size is : 8
      Keys in cache [10] : [test4, test9, test7, test3, test10, test1, test8, test5, test6, test2]

      Simple cache size is : 10
      Keys in cache [10] : [test8, test4, test2, test9, test7, test3, test10, test1, test5, test6, test6]

      ~~~

      The client is started several times and the output differs some times as shown above.
      Note:
      size() can be 8 or 10 (for me, but maybe related to teh key distribution)
      keySet().size() shows also 8 or 10
      keySet() list sometimes duplicates of keys, could be 10 or up to 15 (for me)

      All that seems to be a race condition because II'm able to reproduce that with my Laptop (12 cores 64GB) but on another machine (6 cores) it does not happen.
      Servers and client (IDE) are running on the same box

       

        1. caches.xml
          0.6 kB
        2. TestHotRodClient.java
          5 kB
        3. TestHotRodClient-1.java
          5 kB
        4. TestHotRodClient-2.java
          7 kB
        5. withTRACE_NoPersistence.zip
          1.87 MB

              rh-ee-jbolina Jose Bolina
              rhn-support-wfink Wolf Fink
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: