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

In non-tx caches, write operations may not be atomic during rebalance

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      If the cache topology changes while a write command is running and before it has actually committed the entry to the data container, we retry the command (see ISPN-3366 and ISPN-3357). But before we detect the topology change, one or more of the backup owners may have already applied the modification.

      Retrying the command re-acquires the key lock on the primary owner (even if the primary owner didn't change). That means another command could have modified the same key in the meantime, but the retried command is going to ignore any changes and is going to return the value before the first attempt. Obviously, the command is not retried if the first attempt is not successful, but scenarios like this are possible:

      thread 1: putIfAbsent(k, v1) -> null
      thread 2: putIfAbsent(k, v2) -> null
      

              dberinde@redhat.com Dan Berindei (Inactive)
              dberinde@redhat.com Dan Berindei (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: