infinispan/infinispan — pull request #2254 by danberindei (2013-12-03 16:05:41+00:00)
Title: ISPN-3422 In non-tx caches, write operations may not be atomic during rebalance

https://issues.jboss.org/browse/ISPN-3422

* Replace the ignorePreviousValue flag with a ValueMatchingPolicy enum.
* Set the matching policy to MATCH_EXPECTED_OR_NEW when retrying a
putIfAbsent(k, value).
* Regular put(k, value) still won't be atomic, because we don't keep the
previous value around.
* replace(k, expected, newValue) and remove(k, expected) will also be
retried with MATCH_EXPECTED_OR_NEW.
* Same as regular put(k, value), replace(k, newValue) and remove(k) won't
be atomic.
* Check the primary owner's response and update the status of the command.
Only successful commands should be retried if the topology changes.