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

Two concurrent putIfAbsent operations can both return null during rebalance

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

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Critical Critical
    • None
    • 6.0.2.Final
    • Core, State Transfer

      If the cache topology changes while executing a putIfAbsent operation, the old primary owner will throw an OutdatedTopologyException, and the originator will retry on the new owner.

      When retrying the PutKeyValueCommand on the new primary owner, we compare the current value with the command's new value. If they are equal, we assume that the initial command wrote the old value, and we return null.

      However, the value might have been written by another putIfAbsent operation. So we could have two putIfAbsent(k, v) operations, both returning null.

      A is the originator, B is the primary owner, k = null
      A -> B: putIfAbsent(k, v1)
      B dies before writing v, C is now primary owner
      D -> C: putIfAbsent(k, v1) // another put operation from D, with the same value
      C -> D: null // correct
      A -> C: retry_putIfAbsent(k, v1)
      C -> A: null // C assumes A is overwriting its own value, so it's also returning null
      

            [ISPN-4286] Two concurrent putIfAbsent operations can both return null during rebalance

            Tristan Tarrant <ttarrant@redhat.com> changed the Status of bug 1163725 from NEW to ASSIGNED

            RH Bugzilla Integration added a comment - Tristan Tarrant <ttarrant@redhat.com> changed the Status of bug 1163725 from NEW to ASSIGNED

            We would need versioning to fix this, since there's no way to distinguish between one v1 and the other.

            Dan Berindei (Inactive) added a comment - We would need versioning to fix this, since there's no way to distinguish between one v1 and the other.

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

                Created:
                Updated:
                Resolved:
                Archived: