Denis Mekhanikov created IGNITE-6388:
----------------------------------------

             Summary: ExpiryPolicy is used incorrectly during invoke
                 Key: IGNITE-6388
                 URL: https://issues.apache.org/jira/browse/IGNITE-6388
             Project: Ignite
          Issue Type: Bug
    Affects Versions: 2.1, 2.0, 1.9, 1.8, 1.7
            Reporter: Denis Mekhanikov


Behavior of {{invoke(...)}} regarding {{ExpiryPolicy}} doesn't conform to the 
spec.

Based on {{EntryProcessor}} doc, the expected behavior is:

{code:java}
cache.invoke(key, (e, a) -> {
    e.getValue(); // getExpiryForAccess()
    e.setValue(2);
    e.getValue();
    e.setValue(3); // getExpiryForUpdate()
    return e.getValue();
});
{code}

{code:java}
cache.invoke(key, (e, a) -> {
    e.getValue(); // getExpiryForAccess()
    e.remove();
    e.getValue();
    e.setValue(2); // getExpiryForUpdate()
    return e.getValue();
});
{code}

{code:java}
cache.invoke(key, (e, a) -> {
    e.getValue(); // getExpiryForAccess()
    e.setValue(2);
    e.getValue();
    e.setValue(3);
    e.remove();
    return e.getValue();
});
{code}

Additionally, if {{CacheStore}} with read-through is configured, and the 
accessed value wasn't loaded before, then {{getExpiryForCreation()}} should be 
called.

Currently behavior depends on configured atomicity mode and none of observed 
options conform to the spec.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to