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

TopologyAwareConsistentHash can run in an endless loop when rehashing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 5.0.0.CR3, 5.0.0.FINAL
    • 4.2.1.FINAL
    • Core
    • None
    • Hide

      What I did to reproduce the case was:

      • Filling the caches with data
      • Then stopping all nodes.
      • Start them again.

      This caused the first node to run in an endless loop and it was not coming up.
      (I have to add that this doesn't happen all the time).

      Show
      What I did to reproduce the case was: Filling the caches with data Then stopping all nodes. Start them again. This caused the first node to run in an endless loop and it was not coming up. (I have to add that this doesn't happen all the time).
    • Hide

      Use "DefaultConsistentHash" instead of "TopologyAwareConsistentHash".

      Show
      Use "DefaultConsistentHash" instead of "TopologyAwareConsistentHash".

    Description

      I'm not exactly sure how to reproduce it and why it happened but at least the problem is a quality / error handling issue.

      TopologyAwareConsistentHash can run in an endless loop when rehashing runs and 'numOwners' is greater than the available addresses in 'processSequence'.

      The endless loop is in the method getOwners() and the reason for it is shown in the simplified snippet below. It would really be helpful if the method either throws an exception with an exact definition what went wrong (e.g. including the address list and numOwners count) or handle the case if it's normal that this can happen when the cluster is just about to be built up.

      private List<Address> getOwners(Address address, int numOwners) {
         ...
         ArrayList<Address> processSequence = ...
         ...
         List<Address> result = new ArrayList<Address>();
         while (result.size() < numOwners) {
             Iterator<Address> addrIt = processSequence.iterator();
             while (addrIt.hasNext()) {
                result.add(addrIt.next());
                addrIt.remove();
             }
         }
         return result;
      }
      

      Attachments

        Activity

          People

            mircea.markus Mircea Markus (Inactive)
            jkellerer Jürgen Kellerer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: