[infinispan-issues] [JBoss JIRA] (ISPN-4286) Two concurrent putIfAbsent operations can both return null during rebalance

RH Bugzilla Integration (JIRA) issues at jboss.org
Wed Nov 26 09:13:40 EST 2014


    [ https://issues.jboss.org/browse/ISPN-4286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13023242#comment-13023242 ] 

RH Bugzilla Integration commented on ISPN-4286:
-----------------------------------------------

Tristan Tarrant <ttarrant at redhat.com> changed the Status of [bug 1163725|https://bugzilla.redhat.com/show_bug.cgi?id=1163725] from NEW to ASSIGNED

> Two concurrent putIfAbsent operations can both return null during rebalance
> ---------------------------------------------------------------------------
>
>                 Key: ISPN-4286
>                 URL: https://issues.jboss.org/browse/ISPN-4286
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Core, State Transfer
>    Affects Versions: 6.0.2.Final
>            Reporter: Dan Berindei
>            Assignee: Dan Berindei
>            Priority: Critical
>             Fix For: 7.1.0.Alpha1
>
>
> 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}}.
> {code}
> 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
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.8#6338)


More information about the infinispan-issues mailing list